hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.66k stars 9.04k forks source link

[Docs]: Error creating API Gateway Deployment: BadRequestException: No integration defined for method #27271

Open abhijith-kandankutty-philips opened 1 year ago

abhijith-kandankutty-philips commented 1 year ago

Documentation Link

https://registry.terraform.io/providers/hashicorp/aws/2.33.0/docs/guides/serverless-with-aws-lambda-and-api-gateway

Description

Hi Team,

I am following Serverless Applications with AWS Lambda and API Gateway document for a POC project. I have followed until [Allowing API Gateway to Access Lambda] step, however when i perform terraform apply, im getting below error.

aws_api_gateway_deployment.example: Creating... ╷ │ Error: Error creating API Gateway Deployment: BadRequestException: No integration defined for method │ │ with aws_api_gateway_deployment.example, │ on lambda.tf line 81, in resource "aws_api_gateway_deployment" "example": │ 81: resource "aws_api_gateway_deployment" "example" {

PFA lambda.tf & api_gateway.tf files. What am i missing. Could you please assist.

api_gateway.txt lambda.txt

References

No response

Would you like to implement a fix?

No response

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

abhijith-kandankutty-philips commented 1 year ago

Any updates?

sabhika commented 1 year ago

Facing the same issue

stepintooracledba commented 3 months ago

API Gateway deployment creation starts before integration is complete. Add a dependency in aws_api_gateway_deployment for aws_api_gateway_integration. This should solve this issue.