Created
May 10, 2018 19:50
-
-
Save teekaay/e3274c31efd3d0a5c5a6f3ade6afbb71 to your computer and use it in GitHub Desktop.
Shell script to package and deploy a serverless app using AWS::Serverless transform
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -e | |
| STACK_TAGS="team=team environment=prod" | |
| aws cloudformation deploy \ | |
| --template-file cf-templates/resources.yaml \ | |
| --stack-name mystack-prod-resources \ | |
| --capabilities CAPABILITY_IAM \ | |
| --tags "$STACK_TAGS" \ | |
| --no-fail-on-empty-changeset | |
| LAMBDA_BUCKET=$(aws cloudformation list-exports --query "Exports[?Name==\`mystack-prod-resources-lambda-bucket-name\`].Value" --output text) | |
| aws cloudformation package \ | |
| --template-file cf-templates/sam.yaml \ | |
| --s3-bucket $LAMBDA_BUCKET \ | |
| --output-template-file sam-new.yaml | |
| aws cloudformation deploy \ | |
| --template-file sam-new.yaml \ | |
| --stack-name mystack-prod-service \ | |
| --s3-bucket $LAMBDA_BUCKET \ | |
| --capabilities CAPABILITY_IAM \ | |
| --tags "$STACK_TAGS" \ | |
| --no-fail-on-empty-changeset \ | |
| --parameter-overrides "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment