Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/devdevx/aws-cloudmap-fargate

Terraform project that deploys a task over fargate, uses cloudmap and serves it over api gateway
https://github.com/devdevx/aws-cloudmap-fargate

aws aws-api-gateway-v2 cloudmap ecs-fargate terraform

Last synced: 24 days ago
JSON representation

Terraform project that deploys a task over fargate, uses cloudmap and serves it over api gateway

Awesome Lists containing this project

README

        

# AWS API ECS

This project uses terraform to launch an http api gateway and connects it to Fargate ecs tasks using Cloud Map service registry

## Architecture

![Diagram](architecture/diagram.png)

## Create the image and upload it

`docker build -t test-rest-api ./test_rest_server`

`docker run -d -p 5000:5000 test-rest-api`

`aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin XXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com`

`docker tag test-rest-api:latest XXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/test/test-rest-api:latest`

`docker push XXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/test/test-rest-api:latest`

*Note:* Remember to replace XXXXXXXXXX with your AWS account id in all commands and files

## Commands

`terraform init`

`terraform plan -var-file=env_dev.tfvars -var-file=env_dev_secrets.tfvars`

`terraform apply -var-file=env_dev.tfvars -var-file=env_dev_secrets.tfvars`

`terraform destroy -var-file=env_dev.tfvars -var-file=env_dev_secrets.tfvars`