Before You Begin

Before you can use Cloud Optimization, you must enable it for your project.

Set up your project

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Cloud Optimization API.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

  7. Enable the Cloud Optimization API.

    Enable the API

  8. Install the gcloud command line tool.
  9. Follow the instructions to create a service account and download a key file for that account.
  10. Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path to the service account key file that you downloaded when you created the service account.
    export GOOGLE_APPLICATION_CREDENTIALS=KEY_FILE
  11. Set the PROJECT_ID environment variable to your Project ID.
    export PROJECT_ID=PROJECT_ID
  12. If you are an owner for your project, add your service account to the Cloud Optimization AI Editor IAM role, replacing SERVICE_ACCOUNT_NAME with the name of your new service account. For example, service-account1@myproject.iam.gserviceaccount.com.
    gcloud auth login
    gcloud projects add-iam-policy-binding $PROJECT_ID \
       --member="serviceAccount:SERVICE_ACCOUNT_NAME" \
       --role="roles/cloudoptimization.editor"
    
  13. Otherwise (if you are not a project owner), ask a project owner to add both your user ID and your service account to the Cloud Optimization AI Editor IAM role.