Lambda function needed to be manually tainted to adopt changes #6794
Labels
bug
Addresses a defect in current functionality.
service/lambda
Issues and PRs that pertain to the lambda service.
stale
Old or inactive issues managed by automation, if no further action taken these will get closed.
This issue was originally opened by @RobWalker as hashicorp/terraform#19599. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
I was trying to configure a lambda@edge function on a cloudfront distribution:
Terraform Configuration Files
Actual Behavior
Initially I had specified the
aws_lambda_function.s3redirect_guide
function without the publish flag, which did not create a published version, so cloudfront rejected the distribution. All good.Adding
and rerunning
terraform apply
had no effect, terraform did not mark the lambda as needing to be recreated.Manually tainting the resource worked.
Cloudfront then complained that the lambda had an environment variable defined which was not allowed for edge functions.
I removed the block:
rerunning
terraform apply
identified the change to the environment and applied it, but not in a way that cloudfront would accept: produced the same error.Again manually tainting the resource worked and the edge function was acccepted.
Expected Behavior
The lambda resource show have been recreated automatically based on the configuration changes without the need to manually taint
The text was updated successfully, but these errors were encountered: