Serverless multi-account deployments with CodePipeline & CodeBuild
Clone/fork repo
Create a Slack webhook (only required for the monitor-service)
Use the ssm.sh template to create the two required ssm params.
Note: the demo code uses String
type params, in production code you may want to use SecuredString
Create a new stack in CloudFormation using pipeline.yml
Create a new stack in CloudFormation using deployer-role.yml
From the monitor-service directory:
Install node dependencies:
npm i
Using the Serverless Framework deploy the monitor-service
$(npm bin)/sls deploy
Push new commit or force a release in the CodePipeline console.
If all is successful there will be two Slack message sent to the channel: One from CodeBuild (success status) and one from CodePipeline (approval stage notification).
Note: For ease of demo code, most IAM policies are not least privilege.