Similar to creating resources at scale using automation, we can destroy these resources once we decide we don’t need them. We use the same Ansible modules that we used to create the resources in GCP in order to destroy these resources.
Decommissioning GCP resources using Ansible
Getting ready
The Ansible control machine must be connected to the internet and be able to reach GCP public API endpoints, and the GCP account should be configured as outlined in the previous recipes.
How to do it...
- Create a new pb_gcp_env_destroy.yml playbook and add the following task...