-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·21 lines (17 loc) · 819 Bytes
/
deploy.sh
File metadata and controls
executable file
·21 lines (17 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
# provide lambda bucket as env variable or script argument
LAMBDA_BUCKET="${LAMBDA_BUCKET:-${1:-}}"
STACK_NAME="node-starter"
if [[ "${LAMBDA_BUCKET}" == "" || "${STACK_NAME}" == "" ]]; then
echo "You must set LAMBDA_BUCKET and STACK_NAME first."
echo "LAMBDA_BUCKET must point to an S3 bucket and will be used for uploading the Lambda function artifacts."
exit 1;
fi
yarn
yarn run build
aws cloudformation package --template-file cfn.yml --s3-bucket ${LAMBDA_BUCKET} --output-template-file cfn.packaged.yml
aws cloudformation deploy --template-file cfn.packaged.yml --stack-name ${STACK_NAME} --capabilities CAPABILITY_IAM
aws cloudformation describe-stacks \
--stack-name ${STACK_NAME} \
--query "Stacks[0].Outputs[?OutputKey == 'TestUrl'].OutputValue" \
--output text