Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying API Gateway through Amplify custom resource results in error: "REST API doesn't contain any methods ..." #5913

Open
14 tasks
livioschlaepfer opened this issue Feb 9, 2025 · 1 comment
Assignees
Labels
pending-community-response Pending response from the issue opener or other community members pending-triage This issue is in the backlog of issues to triage to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided

Comments

@livioschlaepfer
Copy link

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

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

  1. Create custom resource using 'amplify add custom' and selecting 'AWS CDK'
  2. Define RestApi using AWS CDK
  3. 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

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.22.2

Amplify Flutter Version

2.30

Deployment Method

Amplify CLI (Gen 1)

Schema

@github-actions github-actions bot added pending-triage This issue is in the backlog of issues to triage pending-maintainer-response Pending response from a maintainer of this repository labels Feb 9, 2025
@ekjotmultani
Copy link
Member

Hi @livioschlaepfer, thanks for taking the time to raise this issue. Are you trying to deploy a new API, or use an already existing API Gateway resource? If the latter, can you confirm you have updated your Amplify configuration file? If the former, I will attempt to reproduce and get back to you, but is there a use case for custom deploying an API vs using the existing API category?

@github-actions github-actions bot removed the pending-maintainer-response Pending response from a maintainer of this repository label Feb 11, 2025
@ekjotmultani ekjotmultani self-assigned this Feb 13, 2025
@ekjotmultani ekjotmultani added pending-community-response Pending response from the issue opener or other community members to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-community-response Pending response from the issue opener or other community members pending-triage This issue is in the backlog of issues to triage to-be-reproduced Issues that have not been reproduced yet, but have reproduction steps provided
Projects
None yet
Development

No branches or pull requests

2 participants