terraform-aws-codedeploy-for-ecs icon indicating copy to clipboard operation
terraform-aws-codedeploy-for-ecs copied to clipboard

How is the code deploy being triggered?

Open JacobWeyer opened this issue 5 years ago • 3 comments

After the initial deploy are you redeploying the terraform or doing a code deploy command?

JacobWeyer avatar Feb 28 '20 17:02 JacobWeyer

@JacobWeyer, I have the same question. I believe this module will only create the CodeDeploy resource(s) once and the triggering mechanism is left upto you. The best I can think of is to use a Terraform local exec resource to manually run an aws-cli deploy command to trigger the actual deployment. Let me know if you have any findings that suggest otherwise!

thatbeardo avatar May 25 '20 04:05 thatbeardo

@JacobWeyer @thatbeardo

I've used this module in conjunction with an AWS ECS CodePipeline module which is triggered upon artifacts changes.

There are 3 of these artifacts:

  • appspec.yml
  • task_definition.json
  • container image tag

Terraform generates these artifacts from source (checked in template files) and populates the templates using interpolation for various environment variables. This is then zipped up and uploaded to S3 for the appspec and task definition.

The container image tag is simply listening for a specific tag to be pushed to an ECR Repo. For example master-ci for a CI pipeline.

spatel96 avatar Jun 26 '20 16:06 spatel96

This has been very useful to me – https://www.scalefactory.com/blog/2023/03/07/using-codedeploy-with-terraform-and-github-actions/

paambaati avatar Jun 13 '23 11:06 paambaati