Skip to content

[FEAT] ApiGateway v1 - Support UpdateStage/GetStage methodSettings field #961

Description

@gkillough

Service

apigateway (v1)

API Action / Feature

UpdateStage/GetStage (method-level settings persistence: methodSettings field)

AWS Documentation

https://docs.aws.amazon.com/apigateway/latest/api/API_UpdateStage.html
https://docs.aws.amazon.com/apigateway/latest/api/API_GetStage.html
https://docs.aws.amazon.com/apigateway/latest/api/API_MethodSetting.html

Why is this needed?

UpdateStage patch paths with the /*/*/ method-settings prefix appear to be accepted but not persisted/reflected in the stage model returned by GetStage.

I was on the fence about whether to file this as a bug, but I know ApiGateway v1 was not fully supported initially, so considering this an expanding of an existing use-case.

When Terraform applies aws_api_gateway_method_settings, it calls UpdateStage with patch operations targeting /*/*/... paths (e.g. /*/*/metrics/enabled, /*/*/logging/loglevel). Floci accepts these patch operations without error (logs confirm they're received), but the GetStage response does not include the methodSettings field at all — it should contain something like:

"methodSettings": {
  "*/*": {
    "metricsEnabled": true,
    "loggingLevel": "ERROR",
    "throttlingBurstLimit": -1,
    "throttlingRateLimit": -1.0
  }
}

Because GetStage returns no methodSettings, the Terraform AWS provider fails with:

Error: reading API Gateway Method Settings (<api_id>-<stage>-*/*): empty result

This blocks any Terraform stack that uses aws_api_gateway_method_settings from applying locally against Floci (this works against Localstack).

To test:

aws --endpoint-url http://localhost:4566 apigateway get-stage --rest-api-id <id> --stage-name <stage>

Are you willing to contribute a PR?

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions