Skip to content
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

aws_lambda_function_event_invoke_config documentation example produces state error #13166

Closed
lwiegma1 opened this issue May 5, 2020 · 3 comments · Fixed by #14851
Closed
Labels
bug Addresses a defect in current functionality. service/lambda Issues and PRs that pertain to the lambda service.
Milestone

Comments

@lwiegma1
Copy link

lwiegma1 commented May 5, 2020

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

  1. Create a function, alias, and event_invoke_config with the documented example.
  2. terraform apply
  3. attempt any further plan or apply operation
@ghost ghost added the service/lambda Issues and PRs that pertain to the lambda service. label May 5, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label May 5, 2020
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 26, 2020
@bflad bflad added this to the v3.5.0 milestone Aug 31, 2020
@bflad
Copy link
Contributor

bflad commented Sep 1, 2020

The fix for this has been merged and will be released with version 3.5.0 of the Terraform AWS Provider, later this week. Thanks to @nikhil-goenka for the fix. 👍

@ghost
Copy link

ghost commented Sep 3, 2020

This has been released in version 3.5.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Oct 1, 2020

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.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/lambda Issues and PRs that pertain to the lambda service.
Projects
None yet
3 participants