Hello there,
I managed to create an aws_api_gateway_REST-API using an openApi document, and with everything to call an aws_lambda with a aws_api_gateway_integration etc.
So the model, resources and methods are automatically created by the
resource "aws_api_gateway_rest_api" "_"{
...
body = data.template_file._.rendered
}
One of my blocker now is the request_validator to ensure request body is validated?
I created a resource "aws_api_gateway_request_validator"
but how do I “attach” it to one or all of my method ?
If I create one method myself using the following code, it’s fine. the request on that method gets validated, by I havent found any ways to attach my request validator to method created by the result of ingesting a openApi document at the rest-api creation.
resource "aws_api_gateway_method" "myPutMethod" {
rest_api_id = aws_api_gateway_rest_api.myServiceApI.id
resource_id = data.aws_api_gateway_resource.myResource.id
http_method = "PUT"
request_validator_id = aws_api_gateway_request_validator.req_validator.id
authorization = "NONE"
}
How would you proceed ?