
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
serverless-plugin-bind-deployment-id
Advanced tools
Serverless plugin to bind the randomly generated deployment id to custom resources
Bind the serverless deployment to your custom resources like magic! Simply use __deployment__
in place of anywhere you want the deployment to show up.
custom:
myVariable: bar
resources:
Resources:
PathMapping:
Type: AWS::ApiGateway::BasePathMapping
DependsOn: ApiGatewayStage
Properties:
BasePath: basePath
DomainName: ${self:provider.domain}
RestApiId:
Ref: ApiGatewayRestApi
Stage: ${self:provider.stage}
__deployment__:
Properties:
Description: This is my deployment
ApiGatewayStage:
Type: AWS::ApiGateway::Stage
Properties:
DeploymentId:
Ref: __deployment__
RestApiId:
Ref: ApiGatewayRestApi
StageName : ${self:provider.stage}
MethodSettings:
- DataTraceEnabled: true
HttpMethod: "*"
LoggingLevel: INFO
ResourcePath: "/*"
MetricsEnabled: true
ApiGatewayStage2:
Type: AWS::ApiGateway::Stage
Properties:
DeploymentId:
Ref: __deployment__
RestApiId:
Ref: ApiGatewayRestApi
StageName : myOtherStage
Variables: [${self:custom.myVariable}]
plugins:
- serverless-plugin-bind-deployment-id
When built, this will merge the custom properties set above with the default CloudFormation template, allowing you to apply custom properties to your Deployment or Stage. This will even allow you to add multiple Stages!
If you are using Serverless 0.12+, please use the 1.x.x plugin. For previous Serverless versions, use the 0.1.x plugin.
By default __deployment__
is the sentinel value which is replaced by the API Deployment Id. This is configurable. If you'd like to use a different value, you can set:
custom:
deploymentId:
variableSyntax: ApiGatewayDeployment
In this example, any instance of ApiGatewayDeployment in your custom resources will be replaced with the true deployment Id.
Because the deployment id is not stable across CloudFormation stack updates, you cannot make changes to the default stage with the StageDescription property. If you attempt to do so, you will see an error:
An error occurred while provisioning your stack: ApiGatewayDeployment1490846212163
- StageDescription cannot be specified when stage referenced
by StageName already exists.
The easiest way to get around this is to leave the default stage unused, and create a new stage that you actually use. By default, we name this default stage unused_stage, but you could change it to something else by setting:
__deployment__:
Properties:
StageName: myUnusedStage
FAQs
Serverless plugin to bind the randomly generated deployment id to custom resources
The npm package serverless-plugin-bind-deployment-id receives a total of 5,247 weekly downloads. As such, serverless-plugin-bind-deployment-id popularity was classified as popular.
We found that serverless-plugin-bind-deployment-id demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.