Getting error while creating api_gateway using terraform, Below is my code and the error screenshot.. with this code am able to create REST API, but failing in deployment section... can anyone please help me in this
aws_api_gateway_deployment.api-deployment: Creating...
Error: Error creating API Gateway Deployment: BadRequestException: No integration defined for method
Screenshot of the logs
In your "aws_api_gateway_deployment" resource you will need to add a "depends_on" which will need to contain entries for:
that are found in your terraform script, for example:
resource "aws_api_gateway_deployment" "example" {
depends_on = [
aws_api_gateway_method.methodproxy,
aws_api_gateway_integration.apilambda
]
...
}
The problem it from either of the two resource not having been setup.
I faced this error; the problem was that a dev created a new resource (endpoint) via the AWS console in the same API terraform trying to redeploy. He hasn't integrated that endpoint with any of the services.
Once we removed that partial resource, terraform apply worked fine without any issues.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With