sid88in / sid88in/serverless-appsync-plugin

serverless-plugin-split-stacks: AppSync Api not found in stack. Did you forget to deploy?

Open
#594 12 comments 0 reactions 1 assignee View on GitHub

@AlexHladin is already working on this.

Since May 31, 2026.

in-CR
Dominant language
TypeScript
Stars
955
Forks
187
PR merge metrics
No merged PRs in 30d

Description

I am getting the error AppSync Api not found in stack. Did you forget to deploy?.

Here is the environment and output.

✖ Stack tech-xxxxxx-dev failed to deploy (1353s)
Environment: darwin, node 18.13.0, framework 3.27.0 (local), plugin 6.2.3, SDK 4.3.2
Credentials: Local, "wgv-app-dev" profile
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues

Error:
AppSync Api not found in stack. Did you forget to deploy?

I am trying to migrate from V1 of the plugin using the migration guide.

All the resources appear to deploy for a short period of time before a ROLLBACK is issued. And then they disappear. I suspect that the Rollback is initiated by the serverless framework itself since the appsync plugin throws this error.

async getApiId() {
   this.loadConfig();

   if (!this.naming) {
     throw new this.serverless.classes.Error(
       'Could not find the naming service. This should not happen.',
     );
   }

   const logicalIdGraphQLApi = this.naming.getApiLogicalId();

   const { StackResources } = await this.provider.request<
     DescribeStackResourcesInput,
     DescribeStackResourcesOutput
   >('CloudFormation', 'describeStackResources', {
     StackName: this.provider.naming.getStackName(),
     LogicalResourceId: logicalIdGraphQLApi,
   });

   const apiId = last(StackResources?.[0]?.PhysicalResourceId?.split('/'));

   if (!apiId) {
     throw new this.serverless.classes.Error(
       'AppSync Api not found in stack. Did you forget to deploy?',
     );
   }

   return apiId;
 }

So apiId is not found for some reason which throws an exception.

I am probably missing something in my serverless.yml or do I need to explicitly Output some CloudFormation values to fix this.

Here is the header of my serverless yml file.

appSync:
  name: "${self:service}-${self:provider.stage}"
  authentication:
    type: AMAZON_COGNITO_USER_POOLS
    config:
      awsRegion: ${self:provider.region}
      defaultAction: ALLOW
      userPoolId:
        Fn::ImportValue: ${self:custom.resources.PROJECT_PREFIX}-UserPoolId
  additionalAuthentications:
    - type: API_KEY
  apiKeys:
    - name: Default-${self:provider.stage}
      description: Default-${self:provider.stage} generated by Serverless deployment
      expiresAfter: 1y
      apiKeyId: ${self:custom.resources.APPSYNC_API_KEY}
....

It would be very helpful if there is a working example available to compare with.

Thanks in advance.

O.,

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.