Skip to content

A short demo of IaC (Infrastructure as Code) using AWS ECS, Docker and Terraform

Notifications You must be signed in to change notification settings

matsskoglund/ecs-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infrastructure as Code Demo

A short demo of IaC (Infrastructure as Code) using AWS ECS, Docker and Terraform. The use of the code is shown in the IaC video demonstration on Youtube

In order for this to work vpc, subnet1, subnet2 and AWS profile need to be changed or specified using the Terraform -var flag.

The terraform commands used

The terraform commands used is terraform apply to create and change the infrastructure and terraform destroy -force to delete it.

The code in the demo used VPC, subnet and AWS profiles specific for my account. You must use other values for your AWS account. You can do this in at least two ways. One way is to change the variables.tf file by updating the default values of the following variables:

Another way is to pass these values as arguments as show below:

To create the infrastructure using the orange image and pass the neccessary values as arguments use:

terraform apply -var "cluster_vpc=[your_vpc]" -var "subnet1=[your_subnet1]" -var "subnet2=[your_subnet2]" -var "image_tag=orange" -var profile="[your_profilename]"

To use the green image:

terraform apply -var "cluster_vpc=[your_vpc]" -var "subnet1=[your_subnet1]" -var "subnet2=[your_subnet2]" -var "image_tag=green" -var profile="[your_profilename]"

To destroy the infrastructure:

terraform destroy -force

The docker images of used used can be found here.

Terraform

AWS ECS

About

A short demo of IaC (Infrastructure as Code) using AWS ECS, Docker and Terraform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published