Skip to content

docs: Update for usage of the triggers variable with force_new_deployment #284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

chan-vince
Copy link
Contributor

Description

The triggers varable is used to ensure force_new_deployment=true is respected by Terraform, for when you want to have an ECS Service that deploys tasks with image tags that don't change - e.g. if you use rolling image tags, perhaps managed outside of terraform entirely.

This triggers feature was originally implemented from this issue which provides an example like so:

resource "aws_ecs_service" "foo" {
  ...
  force_new_deployment = true

  triggers = {
    update = timestamp()  # force update in-place every apply
  }
}

But this won't work because timestamp() is evaluated at apply time, not plan - as explained here. The solution is that the plantimestamp() function must be used instead.

The main terraform-provider-aws docs have already been updated it seems - but that's not a very visible doc, so I think it's important to have it updated here as well.

Motivation and Context

This PR just updates the documentation here to make it consistent and fix the current example in the docs which won't work; so that if one visits the documentation page here, it is no longer misleading.

Breaking Changes

None - this is purely a small documentation update.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

@chan-vince chan-vince changed the title Update docs for usage of the triggers variable with force_new_deployment docs: Update for usage of the triggers variable with force_new_deployment May 28, 2025
@bryantbiggs bryantbiggs merged commit 7570dbf into terraform-aws-modules:master May 28, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants