Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save leonaugusto16/1127d8277d909f817bc78264e5df1688 to your computer and use it in GitHub Desktop.
Save leonaugusto16/1127d8277d909f817bc78264e5df1688 to your computer and use it in GitHub Desktop.
#!/bin/sh
STACK_NAME=$1
FILE=$2
(aws cloudformation deploy \
--template-file "$FILE" \
--capabilities CAPABILITY_IAM \
--stack-name "$STACK_NAME" > /dev/null & \
) && watch -n 0.5 "aws cloudformation describe-stack-events \
--stack-name $STACK_NAME | \
jq -r '.StackEvents[] |
\"\\(.Timestamp | sub(\"\\\\.[0-9]+Z$\"; \"Z\") | fromdate | strftime(\"%H:%M:%S\") ) \\(.LogicalResourceId) \\(.ResourceType) \\(.ResourceStatus)\"' |
column -t"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment