Skip to content

Issue with split stack plugin for Lambda functions. #266

Description

@hmshoaib

Hi,
I have gone through the closed and open issues regarding the limit issues which is 60 per stack. I have modified my stacks-map.js The problem is I am using all the data sources as lambda and the resources count for GraphQLDsLambda gets to 182. I am assuming its because of IAM roles and etc is there any fix for this? this is the stack summary

Serverless: [serverless-plugin-split-stacks]:    Resources per stack:
Serverless: [serverless-plugin-split-stacks]:    - (root): 193
Serverless: [serverless-plugin-split-stacks]:    - GraphQlFunctionConfigurationNestedStack: 39
Serverless: [serverless-plugin-split-stacks]:    - GraphQlResolverMutationNestedStack: 58
Serverless: [serverless-plugin-split-stacks]:    - GraphQlResolverQueryNestedStack: 28

Here is mystifying stacks-map.js


ServerlessPluginSplitStacks.resolveMigration = function(
    resource,
    logicalId,
    serverless
) {
    if (logicalId.startsWith('GraphQlResolverMutation'))
        return { destination: 'GraphQlResolverMutation', allowSuffix: true  };
    if (logicalId.startsWith('GraphQlResolverQuery'))
        return { destination: 'GraphQlResolverQuery', allowSuffix: true  };
    if (logicalId.startsWith('GraphQlFunctionConfiguration'))
        return { destination: 'GraphQlFunctionConfiguration', allowSuffix: true  };

    // Fallback to default:
    return this.stacksMap[resource.Type];
};

if i add below code it gives me error

// if (logicalId.startsWith('GraphQlDsLambda'))
    //     return { destination: 'GraphQlDsLambda', allowSuffix: true  };
    // if (logicalId.startsWith('GraphQlDsLambdaD'))
    //     return { destination: 'GraphQlDsLambdaD', allowSuffix: true  };
    // if (logicalId.startsWith('GraphQlDsLambdaU'))
    //     return { destination: 'GraphQlDsLambdaU', allowSuffix: true  };
    // if (logicalId.startsWith('GraphQlDsLambdaG'))
    //     return { destination: 'GraphQlDsLambdaG', allowSuffix: true  };

Here is the error that i get

 Serverless Error ---------------------------------------
 
  An error occurred: GraphQlDsLambdaUNestedStack - Embedded stack arn:aws:cloudformation:ap-southeast-1:651110316028:stack/sc-manager-appsync-beta-dev-GraphQlDsLambdaUNestedStack-5YBYY3ZEAHS8/3581d490-b1ec-11e9-913d-0a9b79aa12c6 was not successfully created: The following resource(s) failed to create: [GraphQlDsLambdaUpdateFBLSRole, GraphQlDsLambdaUpdateDefaultFieldRole, GraphQlDsLambdaUpdateLeadRole, GraphQlDsLambdaUpdateWonDataRole, GraphQlDsLambdaUpdateFollowUpRole, GraphQlDsLambdaUpdateUserRole, GraphQlDsLambdaUpdateLeadAndActionTemplateRole, GraphQlDsLambdaUpdateTagRole, GraphQlDsLambdaUpdateWonScreenTemplateRole, GraphQlDsLambdaUpdateCandyPixelRole, GraphQlDsLambdaUpdateGroupRole, GraphQlDsLambdaUnArchiveFBListRole, GraphQlDsLambdaUpdateProjectRole, GraphQlDsLambdaUpdateProjectGroupRole, GraphQlDsLambdaUpdateSmartAlertRole]. .

I have to add more mutations, queries and subscriptions so it will break. Please if any one have solved this already.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions