Skip to content

Commit

Permalink
Add script to clean-up unused AWS EC2 Instances and VPCs
Browse files Browse the repository at this point in the history
Signed-off-by: shiva kumar <[email protected]>
  • Loading branch information
shivakunv committed Dec 20, 2024
1 parent aa1d57e commit d306460
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/awscleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand All @@ -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"

Expand Down

0 comments on commit d306460

Please sign in to comment.