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

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ