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 Risposta
1
Risposta accettata

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
ESPERTO
con risposta 9 mesi fa
profile pictureAWS
ESPERTO
verificato 9 mesi fa
  • Thank You for the Help

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande