Reputation: 13026
To better improve change analysis and debugging I want to add a 'ModifiedAt' tag to terraform managed AWS resources without creating a lot of noise and churn when plans are applied.
I can ignore all tag changes and so I only modify when there's a substantive change to the resource. However, I really only want to control for the ModifiedAt, ModifiedByJob, ModifiedByCommit, ModifiedByUser tags as they change based on source control, date and build server not due to code changes.
Ignore All Tags
lifecycle {
ignore_changes = ["tag"]
}
Should but doesn't ignore specific tags
lifecycle {
ignore_changes = ["tags.ModifiedAt", "tag.ModifiedAt",
"tags[ModifiedAt]", "tags['ModifiedAt'"]
}
Providers
I'm not sure what's wrong. According to issue 6632 at least one of these should work but they do not for me.
Upvotes: 1
Views: 2145
Reputation: 432
It looks like you need the following, to ignore the 4x tag names you have listed:
lifecycle {
ignore_changes = [
"tags.%", # the count of tag keys, which may change also
"tags.ModifiedAt",
"tags.ModifiedByJob",
"tags.ModifiedByCommit",
"tags.ModifiedByUser"
]
}
Upvotes: 4