mshauneu / fargate-terraform

Deploying Docker containers on AWS Fargate with Terraform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploying Docker container on AWS Fargate with Terraform

Init:

cd terraform
terraform init

Use Elastic Container Registry to store docker image:

terraform apply --target aws_ecr_repository.app

Login to Elastic Container Repository:

$(aws ecr get-login --region $(terraform output aws_region) --no-include-email)

Build and publish docker:

docker build -t app ..
docker tag app $(terraform output app-repo):latest
docker push $(terraform output app-repo):latest

Review:

terraform plan

Deploy:

terraform apply

Test:

curl $(terraform output alb_dns_name)

Destroy:

terraform destroy

About

Deploying Docker containers on AWS Fargate with Terraform


Languages

Language:HCL 83.1%Language:Smarty 8.5%Language:Go 5.7%Language:Dockerfile 2.7%