Resource handler returned message: "The REST API doesn't contain any methods

0

Hello, I get this error from my Cloudformation when try to create a multiple deployment stages for my RestAPI.

Error OutPut:

Resource handler returned message: "The REST API doesn't contain any methods (Service: ApiGateway, Status Code: 400, Request ID: 0041fbd4-40b8-45f0-82ea-548ec54fc50c)" (RequestToken: fb35e5d7-1ee6-d3e0-8d05-1d7ec51e83bf, HandlerErrorCode: InvalidRequest)

Sample Template used

 APIProdDeployment:
    Type: AWS::ApiGateway::Deployment
    Properties:
      RestApiId: !Ref RestAPI

APITestDeployment:
    Type: AWS::ApiGateway::Deployment
    Properties:
      RestApiId: !Ref RestAPI

1개 답변
1
수락된 답변

Hi,

you will need to add a dependency on the methods.

If you create an AWS::ApiGateway::RestApi resource and its methods (using AWS::ApiGateway::Method) in the same template as your deployment, the deployment must depend on the RestApi's methods. To create a dependency, add a DependsOn attribute to the deployment. If you don't, AWS CloudFormation creates the deployment right after it creates the RestApi resource that doesn't contain any methods, and AWS CloudFormation encounters the following error: The REST API doesn't contain any methods.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-deployment.html

profile pictureAWS
전문가
답변함 9달 전
profile pictureAWS
전문가
검토됨 9달 전
  • Thank You for the Help

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠