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

[Bug]: aws_api_gateway_integration strips lambda qualifier from invoke arn in uri parameter in 4.52.0 #29205

Closed
grimm26 opened this issue Feb 1, 2023 · 9 comments · Fixed by #29235
Labels
bug Addresses a defect in current functionality. service/apigateway Issues and PRs that pertain to the apigateway service.

Comments

@grimm26
Copy link
Contributor

grimm26 commented Feb 1, 2023

Terraform Core Version

1.3.7

AWS Provider Version

4.52.0

Affected Resource(s)

  • aws_api_gateway_integration

Expected Behavior

No change in plan.

Actual Behavior

qualifiers were stripped out of the lambda invoke arn in the uri parameter value. For example:

  # module.odi_apigw.aws_api_gateway_integration.lambda["root/execute_flow/POST"] will be updated in-place
  ~ resource "aws_api_gateway_integration" "lambda" {
        id                      = "agi-245tgrfsxve-f98hju1-POST"
      ~ uri                     = "arn:aws:apigateway:us-east-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-2:666:function:cool_function-staging:staging/invocations" -> "arn:aws:apigateway:us-east-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-2:666:function:cool_function-staging/invocations"
        # (12 unchanged attributes hidden)
    }

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

...

Steps to Reproduce

Set up an API gateway with a lambda integration with a URI that has a qualifier.

Debug Output

No response

Panic Output

No response

Important Factoids

The issue happens when upgrading the provider from 4.50.0 to 4.52.0 with no other changes.

References

I was affected by this bug, #29090, so was excited to upgrade to 4.52.0 but that has made things worse.

Would you like to implement a fix?

None

@grimm26 grimm26 added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Feb 1, 2023
@github-actions
Copy link

github-actions bot commented Feb 1, 2023

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/apigateway Issues and PRs that pertain to the apigateway service. label Feb 1, 2023
@justinretzolk
Copy link
Member

justinretzolk commented Feb 1, 2023

Hey @grimm26 👋 Thank you for taking the time to raise this! Can you supply a sample Terraform configuration so that have an idea how you're supplying the uri argument and can take a look into this?

Possibly related: #29115

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Feb 1, 2023
@grimm26
Copy link
Contributor Author

grimm26 commented Feb 1, 2023

I'll try to put an example together when I get off the train. API gateway terraform is complex ☹️

@grimm26
Copy link
Contributor Author

grimm26 commented Feb 1, 2023

Hey @grimm26 👋 Thank you for taking the time to raise this! Can you supply a sample Terraform configuration so that have an idea how you're supplying the uri argument and can take a look into this?

Possibly related: #29115

I'm getting the uri data from the invoke_arn output of d/aws_lambda_function

@grimm26
Copy link
Contributor Author

grimm26 commented Feb 2, 2023

As I started putting together a test case, I found the issue was in a change in behavior in https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lambda_function but not the same as mentioned in #29115 but definitely caused by #28963. In 4.50.0, providing the qualifier like so:

data "aws_lambda_function" "hello" {
  function_name = "hello_world"
  qualifier     = "staging"
}

would cause the invoke_arn attribute to include the qualifier since the qualifier was there as a parameter. In 4.52.0, it does not include the qualifier and I have to use the qualified_invoke_arn attribute if I want that value. Make sense, I suppose, but it is a rather large API breakage for a minor release and there was NO change in documentation.

@justinretzolk
Copy link
Member

Thank you very much for the updated information @grimm26! It sounds like you're sorted out, but the best course of action might be to update the documentation to be a bit more clear as to what is returned with invoke_arn and qualified_invoke_arn. Does that seem like the right path forward to you as well? I'd be happy to work on that, if that's the case.

@grimm26
Copy link
Contributor Author

grimm26 commented Feb 2, 2023

Thank you very much for the updated information @grimm26! It sounds like you're sorted out, but the best course of action might be to update the documentation to be a bit more clear as to what is returned with invoke_arn and qualified_invoke_arn. Does that seem like the right path forward to you as well? I'd be happy to work on that, if that's the case.

Yes, an indication in the documentation for the invoke_arn attribute that a behavior change happened starting 4.51.0

grimm26 added a commit to grimm26/hashicorp-terraform-provider-aws that referenced this issue Feb 3, 2023
@grimm26
Copy link
Contributor Author

grimm26 commented Feb 3, 2023

@justinretzolk I opened a PR to add a note to the documentation.

@github-actions
Copy link

github-actions bot commented Mar 6, 2023

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2023
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/apigateway Issues and PRs that pertain to the apigateway service.
Projects
None yet
2 participants