Customer has one really big serverless file. This is just one out of many repos. This one repo in particular get’s the ‘not more than 500 resources in a cloudformation’ error. I tried a split stack plugin but it doesn’t support v4. Now I’m stuck and don’t really know what to do?
Is there a native v4 way of making nested cfn stacks without having to create yet another serverless file which will create yet another api gateway? I also can’t really tell this customer to “just refactor your app.”
I’m fine with some custom code if needed. I would just need to be pointed to some resource that shows me how to manipulate the underlying CFN.
Edit: Just posting the plugins I found which both seemingly had the same error and does not support v4
This unresolved issue is what I’m stuck on, happens in both of the above:
opened 07:47AM - 16 Sep 19 UTC
`The CloudFormation template is invalid: Template format error: Unresolved resou… rce dependencies [ServerlessDeploymentBucket] in the Resources block of the template`
I'm getting above error trying to use this plugin but I can't figure out why,
other plugins:
```
plugins:
- serverless-webpack
- serverless-dynamodb-local
- serverless-offline
- serverless-domain-manager
- serverless-plugin-warmup
- serverless-es-logs
- serverless-pseudo-parameters
- serverless-plugin-split-stacks
```
split stacks config:
```
splitStacks:
perFunction: false
perType: true
perGroupFunction: false
```
and this stacks-map.js:
```
module.exports = (resourceObj, logicalId) => {
resourceType = resourceObj.Type;
if (resourceType.startsWith("AWS::ApiGateway::Method")) return { destination: 'AWSApiGatewayMethod', force: true };
if (resourceType.startsWith("AWS::ApiGateway::Resource")) return { destination: 'AWSApiGatewayResource', force: true };
if (resourceType.startsWith("AWS::Lambda::Function")) return { destination: 'AWSLambdaFunction', force: true };
if (resourceType.startsWith("AWS::Lambda::Permission")) return { destination: 'AWSLambdaPermission', force: true };
if (resourceType.startsWith("AWS::Logs::LogGroup")) return { destination: 'AWSLogsLogGroup', force: true };
if (resourceType.startsWith("AWS::Logs::SubscriptionFilter")) return { destination: 'AWSLogsSubscriptionFilter', force: true };
if (resourceType.startsWith("AWS::ApiGateway::Authorizer")) return { destination: 'Misc', force: true };
if (resourceType.startsWith("AWS::ApiGateway::GatewayResponse")) return { destination: 'Misc', force: true };
if (resourceType.startsWith("AWS::Events::Rule")) return { destination: 'Misc', force: true };
if (resourceType.startsWith("AWS::IAM::Role")) return { destination: 'Misc', force: true };
if (resourceType.startsWith("AWS::S3::Bucket")) return { destination: 'Misc', force: true };
if (resourceType.startsWith("AWS::ApiGateway::RestApi")) return false;
if (resourceType.startsWith("AWS::ApiGateway::BasePathMapping")) return false;
if (resourceType.startsWith("AWS::ApiGateway::Deployment")) return false;
return false;
};
```
nbcch
October 6, 2024, 2:29am
2
A few things you can do:
Turn off Lambda versioning by setting versionFunctions: false
in Serverless.yml
Some resources like security groups or IAM roles can be created beforehand and pass into Serverless.yml
Let me know if these work
Ultimately, the customer just split the repo into three. This works and I didn’t really have to do anything.