-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Version 2.0] Still unable to ignore ARN change in CloudFront lambda_function_association #7780
Comments
Hi @vhiairrassary 👋 Are you able to achieve what you are looking for with the below? resource "aws_cloudfront_distribution" "cdn" {
# ... other configuration ...
lifecycle {
ignore_changes = ["default_cache_behavior.0.lambda_function_association"]
}
} Given the current Terraform functionality with |
@bflad 👋 the workaround is good enough for now. Hopefully it will still work if we have several lambdas attached to the distribution 😬 Thanks! |
Hi, we're running into this issue as well, terraform keeps wanting to change from |
The aforementioned workaround does not work in TF 0.12 and provider.aws 2.12.0, the ignore is ignored :)
|
Hi @byF 👋 Sorry you are running into trouble there. There is a known issue upstream in Terraform Core relating to the |
The issue #21433 mentioned above appears to have been closed but the behavior of wanting to revert a lambda function to a prior ARN (based on a config) or removed completely still exists. We are on v0.12.3 but also did validation using v0.12.7 and see the same issue. Defined lambda function variables (ARN):
The lifecycle definition in the distribution:
In the default cache behavior definition for CloudFront:
and generating the following during plan (arn version was updated in console to demonstrate):
|
@byF it seems to work for me without the quotes: resource "aws_cloudfront_distribution" "cdn" {
# ... other configuration ...
lifecycle {
ignore_changes = [default_cache_behavior.0.lambda_function_association]
}
} In my use-case, lambda@edge are deployed from an automated pipeline using Current versions:
|
@bflad Do I still have to define the My use case is similar to what OP is having. I am managing all the AWS infra with Terraform except the Lambda functions which are handled by Serverless. Serverless builds, packages, uploads the function and associates it to a Cloudfront distribution that was previously created by Terraform (for those interested -- using this plugin). Currently I have to declare Is there perhaps a way to make Terraform ignore any |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform Version
Affected Resource(s)
Description
Version 2.0 of the provider removed a lot of noise for
aws_cloudfront_distribution
(especially #7732) but we are still not able to ignore change oflambda_arn
in thelambda_function_association
block.Here is the plan with version 2.0:
If I add the following lifecycle block (which I don't think is a good idea since I don't know if
4010905183
&609050106
will be valid in the future and in deployments in other regions):Then the plan becomes:
At the end we want to be able to create the lambda & the lambda_function_association in terraform with an empty lambda to bootstrap the infra and then be able to update them outside of terraform, i.e. in our CI tool.
References
The text was updated successfully, but these errors were encountered: