Skip to content

Instantly share code, notes, and snippets.

@emzxcv
Created January 11, 2019 00:37
Show Gist options
  • Save emzxcv/f0253184e87f92fa60b387c311473451 to your computer and use it in GitHub Desktop.
Save emzxcv/f0253184e87f92fa60b387c311473451 to your computer and use it in GitHub Desktop.
#cfn #wrapper #bash #exitcode
STDERR=$(( aws cloudformation deploy \
--template-file cfn-snsteam.yml \
--stack-name sns-team-message \
--tags Owner=${OWNER} \
CostCentre=${COSTCENTRE} \
Application=enc-sqs-slack-bot \
Project=${PROJECT} \
Environment=${ENVIRONMENT} \
Confidentiality=${CONFIDENTIALITY} \
Compliance=${COMPLIANCE} \
LogRetentionPolicy=${LOGRETENTION} \
--capabilities CAPABILITY_NAMED_IAM ) 2>&1)
ERROR_CODE=$?
echo ${STDERR} 1>&2
if [[ "${ERROR_CODE}" -eq "255" && "${STDERR}" =~ "No changes to deploy" ]]; then exit 0; fi
exit ${ERROR_CODE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment