#!/bin/bash set -eo pipefail ARTIFACT_BUCKET=$(cat bucket-name.txt) STACK_ID=$(dd if=/dev/random bs=8 count=1 2>/dev/null | od -An -tx1 | tr -d ' \t\n') echo aurora-monitoring-grafana-pi-$STACK_ID > stack-name.txt STACK=$(cat stack-name.txt) aws cloudformation package --template-file template.yml --s3-bucket $ARTIFACT_BUCKET --output-template-file out.yml aws cloudformation deploy --template-file out.yml --stack-name $STACK --capabilities CAPABILITY_NAMED_IAM