Is there a way to pass ignore_changes
into a module. I.E. I want to ignore aws_instance.ami
only for some instances of a module. I tried adding ignore_changes
as a new module variable, but getting:
aws_instance.instance: lifecycle ignore_changes cannot contain interpolations
# in module
lifecycle {
ignore_changes = [
"${var.ignore_changes}",
]
}
I've just run into this same issue. in my case I've got AWS CodePipeline doing CI/CD for a lambda function in my dev account, and I don't want terraform to overwrite the version deployed in dev, but in prod I want to lock it down and be more explicit about which version I'm running. So I want to do something like:
lifecycle {
ignore_changes = "${var.environment == "prod" ? list() : list("s3_key")}"
}
However, even in the latest build of terraform there is an explicit check preventing interpolations for lifecycle.ignore_changes
This issue appears to be a duplicate of #3116 (or at least, I'm assuming it will work once that issue is fixed).
@apparentlymart - since that issue is locked I can't comment on it, but is there any chance this could be revisited, given the changes to interpolation that were made in terraform 0.12?
Is there any update on this or workaround?
The other issue with locking the other discussion is that we can't add our 馃憤 to the issue, thus I'm not sure we have an accurate number of how many folks are being bitten by this. Could the issue be unlocked, maybe?
Most helpful comment
This issue appears to be a duplicate of #3116 (or at least, I'm assuming it will work once that issue is fixed).
@apparentlymart - since that issue is locked I can't comment on it, but is there any chance this could be revisited, given the changes to interpolation that were made in terraform 0.12?