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

feat: support authorization_type and authorizer_id on routes #17

Merged
merged 2 commits into from
Feb 14, 2021

Conversation

jdjkelly
Copy link
Contributor

@jdjkelly jdjkelly commented Feb 1, 2021

Description

Adds support for setting authorization_type and authorizer_id on the aws_apigatewayv2_route resource, like so:

integrations = {
    "GET /some-route" = {
      lambda_arn = module.some_function.this_lambda_function_arn
      payload_format_version = "2.0"
      authorization_type = "CUSTOM"
      authorizer_id = aws_apigatewayv2_authorizer.some_authorizer.id 
    }
  }

Motivation and Context

This module is helpful but limited by the lack of support for custom authorizers. This commit isn't perfect - it requires you to create an aws_apigatewayv2_authorizer independently, and then reference the id, but it's also immediately useful. If this isn't sufficient to merge, please let me know what you'd like to see in a commit and I'll see if I can match those expectations.

Defaults are set to what aws_apigatewayv2_route expects ("NONE", and null respectively).

Breaking Changes

None that I know of, but I haven't committed to these modules before, so merger beware!

How Has This Been Tested?

I tested this on a private source repository, and successfully deployed more or less the above example. I also tested deploying without these new parameters, successfully (observing authorization_type being set to NONE and authorizer_id being set to null).

@jdjkelly jdjkelly changed the title Support authorization_type and authorizer_id on routes feat: support authorization_type and authorizer_id on routes Feb 1, 2021
@Glen-Moonpig
Copy link

I am developing a V2 API Gateway and require this feature to work. This will be the difference between using this module and going with the raw Terraform so would love to see it merged in. Please 🥺🙏

@antonbabenko
Copy link
Member

@Glen-Moonpig I will do my best to review and finish this PR by the end of this week but meanwhile, you can use the fork of this module by @jdjkelly to use code from this PR if it is sufficient for your case.

@antonbabenko antonbabenko merged commit c31bc3e into terraform-aws-modules:master Feb 14, 2021
@antonbabenko
Copy link
Member

@Glen-Moonpig Thanks for this PR, I have updated the example code to show the authorizer in action.

v0.9.0 has been just released.

@Glen-Moonpig
Copy link

I didn't do the work, credit goes to @jdjkelly, I just want to use the change.

Thanks @jdjkelly and @antonbabenko for getting this added!

@antonbabenko
Copy link
Member

Right :) Anyway, thanks to everyone for being involved in one way or another!

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, 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 Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants