This is an example of creating a simple infrastructure using Terraform and AWS cloud provider. It consists of:
- Virtual Private Cloud (VPC) with 2 public subnets in 2 availability zones.
- Elastic Container Service (ECS) using EC2 launch type.
- Application Load Balancer (ALB).
This example requires that you have AWS account and Terraform CLI installed.
git clone https://github.com/sanhidalgoo/ecs_cluster.gitcd ecs_cluster/srcterraform initterraform planterraform apply -target aws_ecr_repository.pyxis-app- Make a manual push to ECR of your docker image (In this case pyxis-app). See the commands in the AWS console. After that, put the URI of the image given by Amazon ECR in the image parameter of the file container-definition.json
terraform apply
Note: In variables.tf file set your key pair name and cluster name.
