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: Enable route_settings in default stage #80

Merged
merged 5 commits into from
Sep 12, 2022

Conversation

honglus
Copy link
Contributor

@honglus honglus commented Sep 9, 2022

Description

Enable route_settings in default stage
route_settings will override default_settings, So even I just want to set throttling_rate_limit on route "POST /test", I have to set the remaining variables to use default_route_settings values, otherwise it will be AWS default value not default_route_settings value. e.g detailed_metrics_enabled will become false.

  • Enable route_settings and add only the route with at least one of the options:
    data_trace_enabled, logging_level, throttling_burst_limit, throttling_rate_limit, detailed_metrics_enabled is not null
  • set the remaining variables to use use default_route_settings values

Motivation and Context

#78

Breaking Changes

No

How Has This Been Tested?

I have tested and deployed to my company AWS environment.

@honglus honglus changed the title Enable route_settings in default stage feat!: Enable route_settings in default stage Sep 9, 2022
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please verify and update examples/complete-http to work with proposed changes. Now I run it and got these errors:

╷
│ Error: error creating API Gateway v2 stage: NotFoundException: Unable to find Route by key GET /some-route within the provided RouteSettings
│ {
│   RespMetadata: {
│     StatusCode: 404,
│     RequestID: "0bedb742-75a3-43b4-975a-c0b0a986fd48"
│   },
│   Message_: "Unable to find Route by key GET /some-route within the provided RouteSettings"
│ }
│ 
│   with module.api_gateway.aws_apigatewayv2_stage.default[0],
│   on ../../main.tf line 63, in resource "aws_apigatewayv2_stage" "default":
│   63: resource "aws_apigatewayv2_stage" "default" {
│ 
╵
╷
│ Error: error creating API Gateway v2 route: BadRequestException: Invalid Route authorization type specified. Authorization Scopes are only valid for COGNITO_USER_POOLS and JWT authorization types
│ 
│   with module.api_gateway.aws_apigatewayv2_route.this["GET /some-route-with-authorizer-and-different-scope"],
│   on ../../main.tf line 121, in resource "aws_apigatewayv2_route" "this":
│  121: resource "aws_apigatewayv2_route" "this" {
│ 
╵
╷
│ Error: error creating API Gateway v2 route: BadRequestException: Invalid Route authorization type specified. Authorization Scopes are only valid for COGNITO_USER_POOLS and JWT authorization types
│ 
│   with module.api_gateway.aws_apigatewayv2_route.this["GET /some-route-with-authorizer-and-scope"],
│   on ../../main.tf line 121, in resource "aws_apigatewayv2_route" "this":
│  121: resource "aws_apigatewayv2_route" "this" {
│ 
╵

@honglus
Copy link
Contributor Author

honglus commented Sep 11, 2022

sorry, it is not easy for me to provision all resources in the example. Can you try

  1. examples/complete-http is successful before the change.
  2. try to pin AWS version to v4.25.0, which is the version I tested successfully for my company's resource.

@antonbabenko
Copy link
Member

I am pretty sure that example worked before this PR. I will take a look into this PR during this week.

@antonbabenko antonbabenko changed the title feat!: Enable route_settings in default stage feat: Enable route_settings in default stage Sep 12, 2022
@antonbabenko antonbabenko merged commit a13ef33 into terraform-aws-modules:master Sep 12, 2022
antonbabenko pushed a commit that referenced this pull request Sep 12, 2022
## [2.2.0](v2.1.0...v2.2.0) (2022-09-12)

### Features

* Enable route_settings in default stage ([#80](#80)) ([a13ef33](a13ef33))
@antonbabenko
Copy link
Member

This PR is included in version 2.2.0 🎉

@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.

2 participants