Skip to content

Commit

Permalink
check treehouses config has security group and key name
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroTochigi committed Oct 12, 2024
1 parent 747d45e commit 05269ad
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/aws/down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,31 @@ storePortAndDeleteSecurityGroupWithSleepAndRetry() {
done
}

treehousesConfigHas() {
local keyName=$1
local groupName=$2

if [ "$keyName" == "null" ] || [ "$groupName" == "null" ]; then
return 1
fi

return 0
}

function down() {

balloonName=$(setBalloonName "$1")
keyName=$(getValueByAttribute "$balloonName" key)
groupName=$(getValueByAttribute "$balloonName" groupName)

treehousesConfigHas "$keyName" "$groupName"
checkResult=$?

if [ $checkResult -eq 1 ]; then
echo "Treehouses config is corrupted, manual cleanup required"
exit 1
fi

detectIncompleteState "$balloonName" "$groupName" "$keyName"
binaryState=$?

Expand Down

0 comments on commit 05269ad

Please sign in to comment.