This package is ECS Service - Terraform Module using CodePipeline and Codebuild or Gitlab to push a Docker Image to Amazon ECR
-
copy
beta.tfvars
andbeta-init.tfvars
tomyenv.tfvars
andmyenv-init.tfvars
in the same folder to include your config values. Make sure that thebucket
variable points to the S3 State file bucket you just created. -
When calling the Init command, your config cannot have any unused variables, which is why we separate a config for init and plan/apply
-
add the variable
bucket
with the newly created bucket tomyenv.tfvars
andmyenv-init.tfvars
-
export ENV=myenv
-
Make apply
This will deploy the application folder -
The ECR infrastructure lives here. You must push the docker image in order for the ECS Service to come up. The ECS Service can be created without the Docker Image being available.
-
Without a Pipeline, after the
application
folder is deployed, Push ECR Image -
Use CodePipeline, Gitlab or CLI to push the docker image.
-
If using Codepipeline, see
cicd
folder -
.gitlab-ci.yml
file is included -
Deploy the
cicd
folder only if you need it. Release the Pipeline to build the image that the application stack will use- Under the
cicd
folder from the root terraform -chdir=application init -backend-config="conf/beta-init.tfvars --reconfigure"
terraform -chdir=application apply -var-file conf/beta.tfvars
pip install git-remote-codecommit
git remote add cc codecommit::us-east-1://terraform-ecs
- Under the