Skip to content

aws_lambda_function_event_invoke_config documentation example produces state error #13166

@lwiegma1

Description

@lwiegma1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/lambdaIssues and PRs that pertain to the lambda service.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions