DEV Community

DarkEdges
DarkEdges

Posted on

Deploying a custom API via AWS Fargate

Now we have a Private Application Load Balancer deployed we can look at putting an API behind it. For this we will use an existing container image darkedges/providerapi:1.0.2 which provides a basic API that we are going to serve via an AWS API Gateway V2 protected by an Auth0 Access Token.

For this we will create a number of AWS Configurations

  • ECS Cluster as our Fargate service.
  • ECS Service Task to deploy the custom API Container
  • ALB updates to link it al.

This is a lot of configuration items so they are avaiable in the following branch.

git switch fargate
Enter fullscreen mode Exit fullscreen mode

First we will plan and then apply the changes if that is green, by using the following commands.

terraform plan
terraform apply --auto-approve
Enter fullscreen mode Exit fullscreen mode

Once it has been deployed you should get the following output

alb = "http://alb.elb.localhost.localstack.cloud:4566/"
Enter fullscreen mode Exit fullscreen mode

We will use this address in a future request to confirm the API has been deployed correctly.

Top comments (0)