serverless-plugin-additional-stacks
Advanced tools
Comparing version 0.9.0 to 0.9.1
11
index.js
@@ -196,4 +196,5 @@ 'use strict' | ||
// Generate a full name for an additional stack (used in AWS) | ||
getFullStackName(stackName) { | ||
return this.provider.naming.getStackName() + '-' + stackName | ||
getFullStackName(stackName, stack) { | ||
const defaultName = this.provider.naming.getStackName() + '-' + stackName | ||
return stack.StackName || defaultName | ||
} | ||
@@ -238,3 +239,3 @@ | ||
// Generate full stack name | ||
const fullStackName = this.getFullStackName(stackName) | ||
const fullStackName = this.getFullStackName(stackName, stack) | ||
@@ -365,3 +366,3 @@ return this.describeStack(fullStackName) | ||
// Generate full stack name | ||
const fullStackName = this.getFullStackName(stackName) | ||
const fullStackName = this.getFullStackName(stackName, stack) | ||
this.serverless.cli.log('Removing additional stack ' + stackName + '...') | ||
@@ -384,3 +385,3 @@ return this.provider.request( | ||
// Generate full stack name | ||
const fullStackName = this.getFullStackName(stackName) | ||
const fullStackName = this.getFullStackName(stackName, stack) | ||
return this.describeStack(fullStackName) | ||
@@ -387,0 +388,0 @@ .then(status => { |
{ | ||
"name": "serverless-plugin-additional-stacks", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "repository": {}, |
@@ -66,19 +66,2 @@ # PRE-RELEASE (0.9.0) | ||
If you'd like to place the additional resource definitions at the end of | ||
`serverless.yml` but keep the `custom` section elsewhere, you can use a | ||
Serverless variable to split the configuration like this: | ||
```yml | ||
custom: | ||
additionalStacks: | ||
permanent: ${self:permanentResources} | ||
permanentResources: | ||
Resources: | ||
S3BucketData: | ||
Type: AWS::S3::Bucket | ||
Properties: | ||
Name: ${self:service}-data | ||
``` | ||
The syntax of the Resources section is identical to the normal resources | ||
@@ -91,24 +74,33 @@ in `serverless.yml`, so you can just cut-paste resource definitions around. | ||
### Using Deploy: After stacks | ||
### Customizing additional stacks | ||
By default, additional stacks are deployed *before* any other CloudFormation | ||
resources. This ensures they are immediately available when your Lambda | ||
functions run. | ||
The plugin supports some directives you can use to control how your | ||
additional stacks are deployed. They are described below. | ||
If you need to deploy an additional stack *after* other CloudFormation | ||
resources, you can add `Deploy: After` to its definition. Here's an example: | ||
```yml | ||
custom: | ||
additionalStacks: | ||
secondary: | ||
stackName: | ||
Deploy: After | ||
StackName: CustomName | ||
Resources: | ||
S3BucketData: | ||
Type: AWS::S3::Bucket | ||
Properties: | ||
Name: ${self:service}-data | ||
``` | ||
#### Deploy: Before|After | ||
By default, additional stacks are deployed *before* the main Serverless | ||
CloudFormatio resources. This ensures they are immediately available when your | ||
Lambda functions start running. | ||
If you need to deploy an additional stack *after* other CloudFormation | ||
resources, you can add `Deploy: After` to its definition. | ||
#### StackName: CustomName | ||
By default, additional CloudFormation stacks are named by appending the | ||
specified *stackName* to the Serverless stack name. If you want to customize | ||
the CloudFormation name of the stack, you can specify `StackName: CustomName`. | ||
This is useful for controlling existing stacks. | ||
## Command Line Usage | ||
@@ -115,0 +107,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23346
400
127