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]: Removal of the Default route throttling for an API GatewayV2 sets the limits to 0 #30373

Open
davidg-idealo opened this issue Mar 31, 2023 · 6 comments
Labels
bug Addresses a defect in current functionality. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.

Comments

@davidg-idealo
Copy link

davidg-idealo commented Mar 31, 2023

Terraform Core Version

1.1.7

AWS Provider Version

4.61.0

Affected Resource(s)

aws_apigatewayv2_api
aws_apigatewayv2_stage

Expected Behavior

Before configuring the Default route throttling for an API-GW2 the Burst- and Rate limit is set to Not configured. This means that the account wide throttling limits are taken into account.

After configuring these values and remove them again afterwards my exception would be that the values are set to the initial value Not configured.

Actual Behavior

After removing the configuration for Default route throttling the values are set to 0.
The problem is that the underlaying API is immediately unavailable because the API GW responds with 429 - Too many requests.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

Step 1:

resource "aws_apigatewayv2_api" "example" {
  name          = "example-http-api"
  protocol_type = "HTTP"
}

resource "aws_apigatewayv2_stage" "example" {
  api_id = aws_apigatewayv2_api.example.id
  name   = "example-stage"
  default_route_settings {
    throttling_burst_limit = 500
    throttling_rate_limit  = 1000
  }
}

Step 2:

resource "aws_apigatewayv2_api" "example" {
  name          = "example-http-api"
  protocol_type = "HTTP"
}

resource "aws_apigatewayv2_stage" "example" {
  api_id = aws_apigatewayv2_api.example.id
  name   = "example-stage"
}

Steps to Reproduce

First create an API-GW2 with default route limits. (Step1)
Afterwards remove the limits. (Step 2)

Check the limits and you will see that they are set to 0 and it is not possible to set them back to Not configured in the console.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

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

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/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. label Mar 31, 2023
@scalp42
Copy link
Contributor

scalp42 commented Apr 4, 2023

@davidg-idealo I can confirm, bit me last night 😂

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Apr 27, 2023
@rdepping
Copy link

rdepping commented Nov 15, 2023

Related issue.

Including a different optional setting in your TF for an APIGW stage like detailed_metrics_enabled will force the limits to 0 - even if you have never set them.

e.g.

include the following under aws_apigatewayv2_api

  default_route_settings {
    detailed_metrics_enabled = true
  }

Effectively you get the following optional params set for "free" to 0 - which to me is unexpected and surprising and high impact as it cuts off the APIGW from any usage.

  default_route_settings {
    throttling_burst_limit = 0
    throttling_rate_limit = 0
  }

Note - there is a long thread on this over at #14742 and it does appear this is at least partially an issue on the AWS side (see https://stackref.substack.com/p/psa-aws-api-gateway-429-errors-and?s=r)

However I would not expect that setting detailed_metrics_enabled in the TF would force setting the burst limits with such disastrous consequences.

@oeed
Copy link

oeed commented Nov 29, 2023

Would really appreciate this receive the attention it deserves. Having your API rate limited for seemingly no reason is not fun.

@alena-m
Copy link

alena-m commented May 10, 2024

The problem still exists. Updating request_parameters causes throttling_burst_limit and throttling_rate_limit to be reset to 0.

Terraform Core version 1.2.0
AWS Provider version: 5.36.0

resource "aws_apigatewayv2_integration" "this" {
  api_id                    = aws_apigatewayv2_api.this.id
  integration_type          = "HTTP_PROXY"
  connection_type           = "INTERNET"
  content_handling_strategy = "CONVERT_TO_TEXT"
  integration_method        = "POST"
  integration_uri           = var.integration_uri
  request_parameters = {
    "integration.request.header.connectionId" = "context.connectionId",
    "integration.request.header.sourceIp" = "context.identity.sourceIp"
  }
}

@zan-xhipe
Copy link

Can confirm, suddenly being throttled to 0 is NOT fun, especially when you were expecting to just get better metrics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.
Projects
None yet
Development

No branches or pull requests

7 participants