Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/devdevx/aws-cloudmap-fargate
- Owner: devdevx
- Created: 2024-12-05T23:17:36.000Z (about 1 month ago)
- Default Branch: master
- Last Pushed: 2024-12-05T23:30:08.000Z (about 1 month ago)
- Last Synced: 2024-12-06T00:23:01.160Z (about 1 month ago)
- Topics: aws, aws-api-gateway-v2, cloudmap, ecs-fargate, terraform
- Language: HCL
- Homepage:
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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`