Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform Version
Terraform v0.12.17
Terraform v0.12.23
Behavior was also observed in
Terraform v0.11.14
Affected Resource(s)
- aws_lambda_function_event_invoke_config
Terraform Configuration Files
In the Documentation for the resource, the example code under the heading "Configuration for Alias Name" will produce an error when used:
resource "aws_lambda_function_event_invoke_config" "example" {
function_name = aws_lambda_alias.example.function_name #---this line does not work
qualifier = aws_lambda_alias.example.name
# ... other configuration ...
}
The aws_lambda_alias.example.function_name appears to return an arn, and results in a corruption of the state. It works if the code is:
resource "aws_lambda_function_event_invoke_config" "example" {
function_name = aws_lambda_function.example.function_name
qualifier = aws_lambda_alias.example.name
# ... other configuration ...
}
Panic Output
Expected Behavior
Expect the resource to either gracefully handle the arn in the state or correct the documentation
Actual Behavior
Once the code in question runs, further plans are not possible, and only produce this error until the resource is manually removed from the state.
Error: unexpected format of function resource (arn:aws:lambda:us-east-1:123456789012:function:example_function:example_alias), expected name:qualifier
Steps to Reproduce
- Create a function, alias, and event_invoke_config with the documented example.
- terraform apply
- attempt any further plan or apply operation
Community Note
Terraform Version
Terraform v0.12.17
Terraform v0.12.23
Behavior was also observed in
Terraform v0.11.14
Affected Resource(s)
Terraform Configuration Files
In the Documentation for the resource, the example code under the heading "Configuration for Alias Name" will produce an error when used:
The aws_lambda_alias.example.function_name appears to return an arn, and results in a corruption of the state. It works if the code is:
Panic Output
Expected Behavior
Expect the resource to either gracefully handle the arn in the state or correct the documentation
Actual Behavior
Once the code in question runs, further plans are not possible, and only produce this error until the resource is manually removed from the state.
Steps to Reproduce