Skip to content

apigw-data-validation-tf: Update AWS provider and remove duplicate body validation resource #2802

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bentsku
Copy link

@bentsku bentsku commented Jul 23, 2025

Issue #, if available:

Description of changes:
While trying to deploy the apigw-data-validation-tf sample, I've noticed that the Lambda Runtime has been updated to Python 3.13, but the Terraform AWS provider has been pinned to the 4.x version. Python 3.13 is not a valid value for this older runtime, and this makes Terraform reject and fail. I've updated it to 5.x.

It also did not deploy because the Model resource was declared both in the OpenAPI body of the REST API as well as its own Terraform resource, leading to an exception:

╷
│ Error: creating API Gateway Model (Vehicle): operation error API Gateway: CreateModel, https response error StatusCode: 409, RequestID: c2af2518-04d1-4455-baf7-b53fc718c8ac, ConflictException: Model name already exists for this REST API
│ 
│   with aws_api_gateway_model.vehicle_model,
│   on main.tf line 142, in resource "aws_api_gateway_model" "vehicle_model":
│  142: resource "aws_api_gateway_model" "vehicle_model" {
│ 
╵

So I've deleted the OpenAPI body to make sure the Model was declared in Terraform and could be accessed in the aws_api_gateway_method.

The sample now deploys correctly against AWS.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ellisms
Copy link
Contributor

ellisms commented Jul 25, 2025

Hi @bentsku Thanks for catching this and supplying the fix. I validated this works as expected and will add to the publishing queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants