Closed aki-webii closed 6 years ago
I'M SORRY! I didn't see the lower part of README.
This example is for the project using perFunction. Isn't it?
const ServerlessPluginSplitStacks = require('serverless-plugin-split-stacks');
ServerlessPluginSplitStacks.resolveMigration = function (resource, logicalId, serverless) {
if (logicalId.startsWith("Foo")) return { destination: 'Foo' };
// Fallback to default:
return this.stacksMap[resource.Type];
};
I tried this configure, but there are still problem. I added some configures like below.
const ServerlessPluginSplitStacks = require('serverless-plugin-split-stacks');
ServerlessPluginSplitStacks.resolveMigration = function(
resource,
logicalId,
serverless
) {
if (logicalId.startsWith('account')) return { destination: 'Account' };
if (logicalId.startsWith('programs')) return { destination: 'Programs' };
...
// Fallback to default:
return this.stacksMap[resource.Type];
};
then, encountered new error.
Serverless: Packaging service...
Serverless: Remove /Users/mikami/Projects/ap2/client-api/.webpack
Type Error ---------------------------------------------
Cannot read property 'AWS::Logs::LogGroup' of undefined
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Forums: forum.serverless.com
Chat: gitter.im/serverless/serverless
Your Environment Information -----------------------------
OS: darwin
Node Version: 9.7.0
Serverless Version: 1.26.1
Is this problem occurred by combination of split plugin and webpack plugin? If so, I will change my project build&deploy architecture. or is this caused by something wrong configure of split plugin?
Sorry, I solved my problem myself.
I misunderstood.
Correctly, logicalId.startsWith()
based custom split is for perType split strategy.
Don't set the custom.splitStacks.perFunction
flag on serverless.yml as true, and make configures as below, my stacks are deployed as I expected.
const ServerlessPluginSplitStacks = require('serverless-plugin-split-stacks');
ServerlessPluginSplitStacks.resolveMigration = function(
resource,
logicalId,
serverless
) {
if (logicalId.startsWith('account')) return { destination: 'Account' };
if (logicalId.startsWith('programs')) return { destination: 'Programs' };
...
// Fallback to default:
return this.stacksMap[resource.Type];
};
However, I think the first problem on this issue is still remaining. Many functions(for example, my 54 functions) can not be managed by this plugin with perFunction split strategy.(The second deployment may be fail.) Of course, perFunction split strategy is newest feature, and still under development. I look forward to use this feature smartly, in near future. 😃
Sorry for the redundant issue, and thank you for your nice plugin!
The RateExceeded seems like a fair bug, and we could probably do something insidethe summary to reduce the rate that we call. I will reopen this and take a look next week.
Encountered the error like blow.
I have 54 funcitons which is combination of Lambda and API Gateway, and want to create more functions. So decided to migrate from perType to perFunction strategy. Using perFunction splitting from today. First deployment is successfully done. After that, I modify my code and try to update my stacks by
sls deploy
, but encountered the error.Is this AWS's API limit exceeded? Because this plugin is invoking CF's listStackResources API per nested stack at here. I have 54 nested stack, so doing 54 API request in parallel.
Any ideas how can I fix? or should I not use perFunction yet?
environemnt serverless v1.26.1 serverless-plugin-split-stacks latest master branch other plugin: serverless-webpack v4.2.0