This project has two goals:
- Create an underline architecture for ECS with Fargate and deploy latest image into AWS
- Create CI/CD pipeline to push Docker image from a Java git repository to ECR
This repository is used as example for the deployment Git: https://github.com/cevoaustralia/java-ecs-demo
This terraform project is divided by two modules
-
INFRA
- Contains all infrastructure since Networking to ECS
- The reason to be deployed later is because ECS task definition will fail without the image on ECR
-
CICD
- Code Pipelien deployment
- Connects with Java Application Git Repository
- Push Java application docker container image into ECR
- Deploy image into ECS
You can deploy the modules separately or all together, if is done separately the first time you will need to deploy the Infra module first
terraform plan -target=module.infra -out=infra.tfplan
terraform apply infra.tfplan
Then the CICD modules
terraform plan -target=module.cicd -out=cicd.tfplan
terraform apply cicd.tfplan
Or you can deploy all together
terraform plan -out=tf.plan
terraform apply tf.plan