Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 2.83 KB

File metadata and controls

57 lines (38 loc) · 2.83 KB

Clean-up Scripts Based on Recommendations

{% hint style="danger" %} 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. {% endhint %}

Amazon Web Services (AWS)

Prerequisites

Implementation

  1. Install the requirements on a machine running Linux OS.
  2. Configure the AWS Command Line Interface. (Run the aws configure command. For information, see the AWS User Guide).
  3. Download the script from the corresponding subsection on the Recommendations page.
  4. From the same page, download the JSON file containing a list of all resources recommended for deletion.
  5. Run the script as follows: bash <script_name> <path to json file>.

Microsoft Azure

Prerequisites

Implementation

Azure Azure CLI

  1. Install the requirements on a machine running Linux OS.
  2. Sign in with the Azure CLI.
  3. Download the script from the corresponding subsection of the Recommendations page.
  4. From the same page, download the JSON file containing a list of all resources that are recommended for deletion.
  5. Run the script as follows: bash <script_name> <path to json file>.

Azure Shell

  1. Open Azure Cloud Shell.
  2. Download the script and the JSON file from the corresponding subsection of the Recommendations page.
  3. Copy these files using the Upload/Download files button. The files will be placed in /usr/csuser/clouddrive.
  4. 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

Implementation

  1. Install on a machine running Linux OS.
  2. Configure gcloud: run gcloud init. See Initializing the gcloud CLI for more information.
  3. Run script bash <script_name> <path to recommendation json file>.