Description
Amplify fails to deploy custom resource that contains a custom API Gateway with the following error:
(AWS::ApiGateway::Deployment), Event Type: create, Reason: Resource handler returned message: "The REST API doesn't contain any methods (Service: ApiGateway, Status Code: 400, Request ID: ...
Categories
Steps to Reproduce
- Create custom resource using 'amplify add custom' and selecting 'AWS CDK'
- Define RestApi using AWS CDK
- Deploy custom resource to trigger error
CDK stack snippet:
const animalsAuthorizer = new TokenAuthorizer(this, 'AnimalsApiRestAuthorizer', {
handler: animalsAuthorizerFn,
});
const animalsApi = new RestApi(this, 'AnimalsRestApi', {
restApiName: 'animals-rest-api-service',
});
const animals = animalsApi.root.addResource('animals');
// GET /animals
animals.addMethod('GET', new LambdaIntegration(animalsFn), {
authorizer: animalsAuthorizer,
authorizationType: AuthorizationType.CUSTOM,
});
// POST /animals
animals.addMethod('POST', new LambdaIntegration(animalsFn), {
authorizer: animalsAuthorizer,
authorizationType: AuthorizationType.CUSTOM,
});
Screenshots
No response
Platforms
Flutter Version
3.22.2
Amplify Flutter Version
2.30
Deployment Method
Amplify CLI (Gen 1)
Schema
Description
Amplify fails to deploy custom resource that contains a custom API Gateway with the following error:
(AWS::ApiGateway::Deployment), Event Type: create, Reason: Resource handler returned message: "The REST API doesn't contain any methods (Service: ApiGateway, Status Code: 400, Request ID: ...
Categories
Steps to Reproduce
CDK stack snippet:
Screenshots
No response
Platforms
Flutter Version
3.22.2
Amplify Flutter Version
2.30
Deployment Method
Amplify CLI (Gen 1)
Schema