Open bhargavgoli opened 4 years ago
@bhargavgoli This is actually not an issue with the appsync-plugin, but something that needs to be addressed in the split-stack plugin.
There is an open issue about it on that repo: https://github.com/dougmoscrop/serverless-plugin-split-stacks/issues/91
I ran in to the same issue and was able to fiddle with the stacks-map.js
file in order to come up with a temporary workaround.
I also ran into the same issue. When I did a little debugging I found cloud formation stacks work like functions with outputs from one stack passed as parameters for others. There is a hard limit on this parameter/output count and it is 60. Further, every API created has 4-5 resources. So, I had to find a better approach for splitting stacks through stacks-map.js
. I tried grouping by logical groups like logs, functions with this I hit the limit again. Here is how I could achieve this, a new stack for every module in the application. With this, I will able to have 200 such modules and 200 resources in each module. Which is more than sufficient for me. hope it helps others.
module.exports = (resource, logicalId) => {
logicalId = logicalId.toLowerCase();
if (logicalId.includes('graphqlapi') || logicalId.includes('graphqlapikeydefault') || logicalId.includes('graphqlschema')) return { destination: 'AppSyncMeta', allowSuffix: true };
else if (logicalId.includes('dashboard')) return { destination: 'Dashboard', allowSuffix: true };
else if (logicalId.includes('customer')) return { destination: 'Customer', allowSuffix: true };
else if (!logicalId.includes('serverless') && !logicalId.includes('lambdalayer') && !logicalId.startsWith('iamrolelambdaexecution')) return { destination: 'Misc', allowSuffix: true };
};
I have also written an informational post on the same here: https://medium.com/faun/overcoming-cloud-formation-limit-hurdles-with-the-serverless-framework-and-app-sync-4ed91d4ffee9
I got this error because the AppSyncNestedStack outputs are increased to >60, and it will increase day by day, as the backend is got increased.
AWS cloudformation has a limit of outputs upto 60. Can you please help me how can remove outputs on the nestedstack.
The below is the error log:
bash-3.2# sls deploy AppSync Plugin: GraphQl schema valid Serverless: Packaging service... Serverless: Excluding development dependencies... Serverless: [serverless-plugin-split-stacks]: Summary: 181 resources migrated in to 6 nested stacks Serverless: [serverless-plugin-split-stacks]: Resources per stack: Serverless: [serverless-plugin-split-stacks]: - (root): 180 Serverless: [serverless-plugin-split-stacks]: - 1NestedStack: 2 Serverless: [serverless-plugin-split-stacks]: - APINestedStack: 11 Serverless: [serverless-plugin-split-stacks]: - AppSyncNestedStack: 62 Serverless: [serverless-plugin-split-stacks]: - AppSyncResolverNestedStack: 95 Serverless: [serverless-plugin-split-stacks]: - PermissionsNestedStack: 10 Serverless: [serverless-plugin-split-stacks]: - PoliciesNestedStack: 1 Serverless: Uploading CloudFormation file to S3... Serverless: Uploading artifacts... Serverless: Uploading service appsync.zip file to S3 (27.03 MB)... Serverless: Validating template... Serverless: Updating Stack... Serverless: Checking Stack update progress... .............................................................................................................. Serverless: Operation failed! Serverless: View the full error output: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stack/detail?stackId=arn%3Aaws%3Acloudformation%3Aus-east-1%3A884743863304%3Astack%2Fappsync-alpha%2Fbe914050-3dfa-11ea-94ad-0af228e676ce
Serverless Error ---------------------------------------
An error occurred: AppSyncNestedStack - Template format error: Outputs count 61 is greater than max allowed 60.
Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com
Your Environment Information --------------------------- Operating System: darwin Node Version: 12.13.1 Framework Version: 1.61.0 Plugin Version: 3.2.7 SDK Version: 2.2.1 Components Core Version: 1.1.2 Components CLI Version: 1.4.0