Skip to content

Instantly share code, notes, and snippets.

@rcarrata
Last active April 27, 2022 10:33
Show Gist options
  • Save rcarrata/a9ccd3b072022afe9e0c1f1d3f2f335a to your computer and use it in GitHub Desktop.
Save rcarrata/a9ccd3b072022afe9e0c1f1d3f2f335a to your computer and use it in GitHub Desktop.
Enable APIs in GCP for OpenShift Dedicated installation
# Enable APIs OSD in GCP
# based in https://docs.openshift.com/dedicated/osd_planning/gcp-ccs.html#ccs-gcp-customer-procedure_gcp-ccs
# Set your GCP project
PROJECT_ID="mygcp-project"
echo "# Setting your $PROJECT_ID GCP project"
gcloud config set project $PROJECT_ID
# Enable required APIs in GCP
apis=("deploymentmanager.googleapis.com" "compute.googleapis.com" "cloudapis.googleapis.com" \
"cloudresourcemanager.googleapis.com" "dns.googleapis.com" "networksecurity.googleapis.com" \
"iamcredentials.googleapis.com" "iam.googleapis.com" "servicemanagement.googleapis.com" "storage-api.googleapis.com" "storage-component.googleapis.com" "serviceusage.googleapis.com")
for api in "${apis[@]}"; do echo "# Enabling -> $api"; gcloud services enable "$api"; done
echo "## All GCP APIs are enabled properly!"
@rcarrata
Copy link
Author

Script Output -

rcarrata@cloudshell:~ (osd-demo)$ bash enable_osd_gcp_apis.sh
# Setting your osd-demo GCP project
Updated property [core/project].
# Enabling -> deploymentmanager.googleapis.com
# Enabling -> compute.googleapis.com
# Enabling -> cloudapis.googleapis.com
# Enabling -> cloudresourcemanager.googleapis.com
# Enabling -> dns.googleapis.com
# Enabling -> networksecurity.googleapis.com
# Enabling -> iamcredentials.googleapis.com
# Enabling -> iam.googleapis.com
# Enabling -> servicemanagement.googleapis.com
# Enabling -> storage-api.googleapis.com
# Enabling -> storage-component.googleapis.com
# Enabling -> serviceusage.googleapis.com
## All GCP APIs are enabled properly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment