-
Notifications
You must be signed in to change notification settings - Fork 820
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
How to split Amplify project into multiple stacks. Error - Limit on the number of resources in a single stack operation exceeded #13536
Comments
Hey @BBopanna, thank you for reaching out. Currently, GraphQL API does provides support for splitting resolvers into custom named stack; documentation. |
Thankyou - problem seems to be around large number of custom resources added in amplify cdk - https://docs.amplify.aws/react/build-a-backend/graphqlapi/modify-amplify-generated-resources/#place-appsync-resolvers-in-custom-named-stacks Is there a way to break custom resources added via amplify cdk into multiple stacks ? |
@BBopanna , it is currently not supported to split the custom resource. From the number of resources provided on custom, the issue may be due to the number of resolvers on the GraphQL API. |
Is there a way to create a new stack in the cdk part of amplify ? This documentation talks about it when working entirely using cdk - https://docs.aws.amazon.com/cdk/v2/guide/stack_how_to_create_multiple_stacks.html Is this possible in cdk part of amplify ? Also use dependOn (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) - may be ? stack1.node.addDependency(stack2) |
@BBopanna tried creating nested and creating a dependOn with a new stack but i have not been able to split the resource. Examples tried:
push ran into also tried
If the use case requires creating custom resources, I would suggest Amplify Gen 2 or using pure cdk with Amplify GraphQL API construct as an workaround. |
Thankyou @ykethan for trying it out and sharing few more valuable resources - We are on Amplify Gen 1 - what are the possible ways we could go about now that you have mentioned that attempting to add new stack in amplify cdk is not working out ? Please advise. |
@BBopanna the workaround would be to limit the resources on |
Thankyou @ykethan, in light of the above road block and intent to break our app into smaller apps/services some questions
|
@BBopanna Amplify Gen 1, does support importing existing auth resources. Refer to https://docs.amplify.aws/javascript/build-a-backend/auth/import-existing-resources/ providing this information. |
Thankyou @ykethan . Why does commenting the resources in custom resources and pushing and the uncommenting and pushing working if we have truly hit a "Limit" problem. Limit should be a limit irrespective of commenting and uncommenting - What is truly happening here ? Also how can we use entities defined in .graphql of Gen1 in Gen2 (since docs talk about defining entity in code in Gen2) ? hope folks at Amplify dont expect Gen1 clients to refactor/rewrite entirely ? |
@BBopanna At this time, CloudFormation has a hard limitation of 2500 resources per nested stack and 500 resources per individual stack. Amplify created stacks are all under one root, nested stack is not fully adjustable at this time. You may be able to explore AWS CDK/Amplify Gen 2 (currently in public preview) which allows for a more IaC design that permits more freedom. However, these resources are all still under one nested stack, too but we can create new stacks as needed to mitigate this. |
thankyou @ykethan |
Closing the issue, feel free in reaching out to us again if you require any further assistance. |
|
I was getting same error, I have 63 models, 10 functions. I add some models to custom stacks with https://docs.amplify.aws/gen1/flutter/build-a-backend/graphqlapi/modify-amplify-generated-resources/#place-appsync-resolvers-in-custom-named-stacks. and pushed with But I couldn't found solution on Gen 2 |
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v18.17.1
Amplify CLI Version
12.0.3
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
NO
Describe the bug
We are getting this error on an amplify project - "Limit on the number of resources in a single stack operation exceeded".
Question is simple - How to split Amplify project into multiple stacks. Are there any documentation with references/examples ?
Expected behavior
References/Documentation on - "How to split Amplify project into multiple stacks"
Reproduction steps
Create an amplify project with AppSync GraphyQL API with 50+ entities and add around 6+ custom resource which build around 30 custom resolvers and try to amplify push to get the error - "Limit on the number of resources in a single stack operation exceeded"
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: