diff --git a/scripts/awscleanup.sh b/scripts/awscleanup.sh index 3e0b3bcb..a7a66bb8 100755 --- a/scripts/awscleanup.sh +++ b/scripts/awscleanup.sh @@ -8,6 +8,10 @@ fi export vpcid=$1 get_tag_value(){ + if [[ $# -ne 2 ]]; then + echo " vpcid and key required to get tag value" + exit 1 + fi local vpc=$1 local key=$2 aws ec2 describe-tags --filters "Name=resource-id,Values=$vpcid" "Name=key,Values=$key" \ @@ -19,7 +23,7 @@ delete_vpc_resources() { echo " vpcid required for deletion" exit 1 fi - export vpcid=$1 + local vpcid=$1 echo "Start cleanup of resources in VPC: $vpcid"