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_apigatewayv2_authorizer is not sending required parameters for REQUEST authorizer #15181

Closed
aleecevanderloop-disney opened this issue Sep 16, 2020 · 5 comments · Fixed by #15232
Assignees
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.
Milestone

Comments

@aleecevanderloop-disney

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 CLI and Terraform AWS Provider Version

0.13.2

Affected Resource(s)

  • aws_apigatewayv2_authorizer

Terraform Configuration Files

resource "aws_apigatewayv2_authorizer" "example" {
  api_id           = aws_apigatewayv2_api.example.id
  authorizer_type  = "REQUEST"
  authorizer_uri   = aws_lambda_function.lambda_function.invoke_arn
  identity_sources = ["$request.header.Auth"]
  name             = "example-authorizer"
}

Debug Output

aws_apigatewayv2_authorizer.example: Creating...

Error: error creating API Gateway v2 authorizer: BadRequestException: AuthorizerPayloadFormatVersion is a required parameter for REQUEST authorizer

Panic Output

Expected Behavior

There is no option to pass in authorizer-payload-format-version and enable-simple-responses which are required by the amazon CLI to set up a REQUEST authorizer type.

The documentation example is also incorrect - when passing in the identity source, something like "$request.header.Auth" should be passed in instead of the documented "route.request.header.Auth" example.

Actual Behavior

API Gateway error of BadRequestException: AuthorizerPayloadFormatVersion is a required parameter for REQUEST authorizer was returned.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@ghost ghost added the service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. label Sep 16, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Sep 16, 2020
@anGie44 anGie44 added bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 16, 2020
@anGie44
Copy link
Contributor

anGie44 commented Sep 16, 2020

Hi @aleecevanderloop-disney, thank you for reporting this issue. Looking at the AWS documentation, it looks like creating an authorizer for lambda functions does indeed require the authorizerPayloadFormatVersion attribute in the API request, so to handle this in the provider, the resource will require the new attribute and need to be tested with an HTTP aws_apigatewayv2_api resource (currently our acceptance testing covers the case of HTTP APIs used with the JWT authorizer type, not REQUEST).

@aleecevanderloop-disney
Copy link
Author

Thanks @anGie44 . Could the enable-simple-responses value also be added to the resource as an optional attribute? Without it, the authorizer will default to IAM policy and our team would like to be able to return simple responses. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-authorizer.html#cfn-apigatewayv2-authorizer-enablesimpleresponses

@ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit self-assigned this Sep 16, 2020
@anGie44 anGie44 added enhancement Requests to existing resources that expand the functionality or scope. and removed bug Addresses a defect in current functionality. labels Sep 16, 2020
@breathingdust breathingdust added this to the v3.8.0 milestone Sep 23, 2020
@ghost
Copy link

ghost commented Sep 24, 2020

This has been released in version 3.8.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 24, 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 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. enhancement Requests to existing resources that expand the functionality or scope. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.
Projects
None yet
4 participants