I'm trying to create a CDK stack in order to create API Gateway. Everything working as excepted if I create the stack in "small pieces" (comment part of the resources), But when I'm trying to create the completed stack I'm getting this exception:
Number of resources, 224, is greater than maximum allowed, 200
Therefore, I tried to split my big stack into 2 smaller stacks, One stack creates the resource and creates half of the resources and the other one fills relevant data.
Code snippet:
const api = new apigateway.RestApi(this, 'ApiGWEndPoint', {
restApiName: 'API_NAME,
deployOptions: {
stageName: 'STAGE_NAME',
},
description: "MyDescription",
endpointTypes: [apigateway.EndpointType.REGIONAL]
});
I tried to create cross-stack
or nested-stack
and pass the API data into it, but no luck so far.
My goal is to create one stack which will contain 2 small stacks- both of them will point to the same API. Or, if it is possible, create a workaround for the resource limit.
Any help will be much appreciated.
Update 1.10.2020:
Currently, there is no workaround for this issue, Ended up splitting the API Gateway Into many API Gateways.
Update 10.24.2020:
AWS CloudFormation now supports increased limits on five service quotas - template size, resources, parameters, mappings, and outputs. The maximum size of a template that can be passed in an S3 Object is now 1MB (previously 450KB). The new per template limits for the maximum number of resources is 500 (previously 200).
More info can be found here.