Clean-up Scripts Based on Recommendations
The script deletes all recommended resources (based on the downloadable JSON file) and ignores errors. After completion, a summary lists deleted resources, non-existent or already deleted resources, and resources that couldn't be deleted due to other reasons.
Amazon Web Services (AWS)
Prerequisites
jq - The package allows executing JSON scripts with bash. See Download jq.
Implementation
Install the requirements on a machine running Linux OS.
Configure the AWS Command Line Interface. (Run the aws configure command. For information, see the AWS User Guide).
Download the script from the corresponding subsection on the Recommendations page.
From the same page, download the JSON file containing a list of all resources recommended for deletion.
Run the script as follows:
bash <script_name> <path to json file>.
Microsoft Azure
Prerequisites
jq - The package allows executing JSON scripts with bash. See Download jq.
Implementation
Azure Azure CLI
Install the requirements on a machine running Linux OS.
Sign in with the Azure CLI.
Download the script from the corresponding subsection of the Recommendations page.
From the same page, download the JSON file containing a list of all resources that are recommended for deletion.
Run the script as follows:
bash <script_name> <path to json file>
.
Azure Shell
Open Azure Cloud Shell.
Download the script and the JSON file from the corresponding subsection of the Recommendations page.
Copy these files using the Upload/Download files button. The files will be placed in
/usr/csuser/clouddrive
.Run the script as follows:
bash <script_name> <path to json file>
using absolute paths or navigate to the necessary folder before executing.
Google Cloud Platform
Prerequisites
jq - The package allows executing JSON scripts with bash. See Download jq.
Implementation
Install on a machine running Linux OS.
Configure gcloud: run gcloud init. See Initializing the gcloud CLI for more information.
Run script bash
<script_name> <path to recommendation json file>
.
Last updated
Was this helpful?