Last active
March 28, 2021 03:12
-
-
Save KyMidd/329974e7794c2ca1c04b3e2062c8076c to your computer and use it in GitHub Desktop.
This file contains 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
if [[ $line == *"will be destroyed"* ]]; then | |
# If destroyed resource is always unsafe, trigger approval | |
if [[ ${ResourceTypesAlwaysUnsafe[@]} =~ ${resource_type} ]]; then | |
# Mark this path unsafe, require approval | |
echo "This resource is planned to be deleted, and is always unsafe to destroy without approval:" $resource_path | |
approvalRequired="yes" | |
# If destroyed resource is always safe, then don't trigger approval | |
elif [[ ${ResourceTypesAlwaysSafe[@]} =~ ${resource_type} ]]; then | |
echo "This resource is planned to be deleted, but is marked safe to destroy without approval:" $resource_path | |
approvalRequired="no" | |
# If destroyed resource isn't handled already, then | |
else | |
echo "Approval required on" $resource_path | |
approvalRequired="yes" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment