Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active January 27, 2019 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/23b81d5d9c8c945ea43b04ecaf7eb3e2 to your computer and use it in GitHub Desktop.
Save garystafford/23b81d5d9c8c945ea43b04ecaf7eb3e2 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# author: Gary A. Stafford
# site: https://programmaticponderings.com
# license: MIT License
# purpose: Delete GCP VM instance, IP address, and firewall rule
# usage: sh ./part2_clean_up.sh
# Constants - CHANGE ME!
readonly PROJECT='ansible-gce-demo'
readonly ZONE='us-east1-b'
time yes | gcloud compute instances delete web-1 \
--project $PROJECT --zone $ZONE
time yes | gcloud compute firewall-rules delete default-allow-http \
--project $PROJECT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment