[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[[["\u003cp\u003eGoogle Cloud APIs can be accessed via a JSON REST interface and client libraries, allowing developers to integrate Google Cloud products and services into their code.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can browse and enable Google Cloud APIs directly within their IDE using Cloud Code, which groups APIs by category and provides details on each API's status and documentation.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code facilitates adding client libraries to projects, supporting both Google Cloud Client Library and Java Spring Google Cloud Library, and managing dependencies using the Google Cloud Java Bill of Materials (BOM).\u003c/p\u003e\n"],["\u003cp\u003eAuthentication setup for applications varies based on the development environment, such as local development with minikube or remote deployment on Google Kubernetes Engine or Cloud Run, often requiring Application Default Credentials (ADC) and sometimes service account configuration.\u003c/p\u003e\n"],["\u003cp\u003eFor remote development with Secret Manager, service accounts must be granted the "Secret Manager Secret Accessor" role to allow access to specific secrets, ensuring secure handling of sensitive information within applications.\u003c/p\u003e\n"]]],[],null,["# Manage Cloud APIs and libraries in Cloud Code for IntelliJ\n\nYou can access Google Cloud products and services from your code using\n[Cloud APIs](/apis/docs/overview). These Cloud APIs expose a simple JSON REST\ninterface that you can call via client libraries.\n\nThis document describes how to browse available APIs, enable Cloud APIs and\nadd Cloud Client Libraries to your project, and set up authentication depending\non your development needs.\n| **Note:** For projects that don't use both Java and Maven, Cloud Code does not add the Cloud Client Libraries to your build automatically, but does support the other features described here and provides build snippets for your build system.\n\nBrowsing Cloud APIs\n-------------------\n\nTo explore all available Google Cloud APIs in your IDE, follow these steps:\n\n1. Select **Tools** \\\u003e **Cloud Code** \\\u003e **Add Cloud Libraries and Manage Cloud APIs**.\n2. Expand the Google Cloud APIs explorer tree to view all available APIs. The explorer groups Cloud APIs by category. You can also look for a specific API using the Search APIs search bar.\n3. Click an API to view more details, such as its status, language-specific installation instructions for its corresponding client libraries, and relevant documentation.\n\n\u003cbr /\u003e\n\nEnabling Cloud APIs\n-------------------\n\nTo quickly enable Cloud APIs for a project using the API details, follow these steps:\n\n1. In the Cloud API details view, choose a Google Cloud project that you'd like to enable the Cloud API for.\n2. Click the **Enable API** button.\n\n\n Once the API has been enabled you'll see a message confirming this change.\n\n\u003cbr /\u003e\n\nAdding the Cloud Client Libraries\n---------------------------------\n\nTo add libraries to your project in IntelliJ, follow these steps: \n\n### For Java Maven projects\n\n1. Select **Tools** \\\u003e **Cloud Code** \\\u003e **Cloud APIs**.\n2. The **Manage Google Cloud APIs** dialog displays the supported libraries.\n3. Select your preferred library type from the choice of Google Cloud Client Library (recommended) or Java Spring Google Cloud Library.\n4. In the **Module** drop-down menu, select the module that you want to add the library to.\n| **Note:** **Google Cloud Java** solves version conflicts between libraries by adding the [Google Cloud Java Bill of Materials (BOM)](https://github.com/googleapis/google-cloud-java#version-management) to the `pom.xml` file of your projects.\n5. Click **Add Maven Dependency** to add BOM and client library to your project.\n\n### For all other projects\n\n1. Select **Tools** \\\u003e **Cloud Code** \\\u003e **Add Cloud Libraries and Manage Cloud APIs**.\n2. The **Add Google Cloud Libraries** dialog displays the supported libraries.\n3. Install the API using the installation instructions listed on the API details page for your preferred language. If you're developing a Java application, you need to also specify your library preference, Google Cloud Client Library (recommended) or Java Spring Google Cloud Library.\n\nSetting up authentication\n-------------------------\n\nAfter you've enabled the required APIs and added the necessary client libraries,\nyou need to configure your application in order for it to be successfully\nauthenticated. Your configuration depends on your type of development and\nthe platform you're running on.\n\nOnce you complete the relevant authentication steps, your application can\nauthenticate and is ready to be deployed.\n\n### Local development\n\n### minikube\n\n\n1. Ensure that you have Application Default Credentials (ADC) set by running `gcloud auth application-default login`. This lets minikube find your ADC to authenticate with.\n\n\u003cbr /\u003e\n\n### minikube\n\n\n1. Ensure that you have Application Default Credentials (ADC) set by running `gcloud auth application-default login`. This lets minikube find your ADC to authenticate with.\n2. Start minikube with `minikube start --addons gcp-auth`. This mounts your ADC in your pods. For a detailed minikube auth guide for Google Cloud, refer to the [minikube gcp-auth docs](https://minikube.sigs.k8s.io/docs/handbook/addons/gcp-auth/).\n\n\u003cbr /\u003e\n\n### Local Kubernetes cluster\n\n\n1. Ensure that you have Application Default Credentials (ADC) set by running `gcloud auth application-default login`.\n2. Mount your local `gcloud` directory in your Kubernetes pods by editing the deployment manifests, so that the Google Cloud client libraries can find your credentials. Kubernetes pod configuration example: \n\n apiVersion: v1\n kind: Pod\n metadata:\n name: my-app\n labels:\n name: my-app\n spec:\n containers:\n - name: my-app\n image: gcr.io/google-containers/busybox\n ports:\n - containerPort: 8080\n volumeMounts:\n - mountPath: /root/.config/gcloud\n name: gcloud-volume\n volumes:\n - name: gcloud-volume\n hostPath:\n path: /path/to/home/.config/gcloud\n\n\u003cbr /\u003e\n\n### Cloud Run\n\n\n1. Ensure that you have Application Default Credentials (ADC) set by running `gcloud auth application-default login`. This lets the Cloud Run local simulated environment find your ADC to authenticate with.\n\n\u003cbr /\u003e\n\n### Remote development\n\n### Google Kubernetes Engine\n\n\n1. [Configure your GKE cluster and application with Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) to authenticate Google Cloud services on GKE. This associates your Kubernetes service account with your Google service account.\n2. If the Google Cloud service you're trying to access requires additional roles, grant them for the Google service account you're using to develop your app. \n For a list of IAM role types and predefined roles you can grant to identities, see the [Understanding roles guide](https://cloud.google.com/iam/docs/understanding-roles). For steps to grant the roles, see [Granting, changing, and revoking access to resources](/iam/docs/granting-changing-revoking-access).\n3. Configure your Kubernetes Deployment to reference the Kubernetes service account by setting the `.spec.serviceAccountName` field in your Kubernetes Deployment YAML file. \n If you're working on an app created from a Cloud Code template, this file is located under the kubernetes-manifests folder.\n\n\u003cbr /\u003e\n\n### Cloud Run\n\n\n1. To create a new unique service account for deploying your Cloud Run application, on the Service Accounts page, select the project that your secret is stored in. [Go to the Service Accounts\n page](https://console.cloud.google.com/iam-admin/serviceaccounts)\n\n2. Click **Create service account**.\n3. In the **Create service account** dialog, enter a descriptive name for the service account.\n4. Change the **Service account ID** to a unique, recognizable value and then click **Create**.\n5. If the Google Cloud service you're trying to access requires additional roles, grant them, click **Continue** , and then click **Done**.\n6. To add your service account to your deploy configuration, navigate to your **Cloud Run: Deploy** run configuration, expand the **Advanced revision settings** section, and then specify your service account in the **Service Account** field. \n\n\u003cbr /\u003e\n\n### Cloud Run\n\n\n1. [Configure your GKE cluster and application with Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) to authenticate Google Cloud services on GKE. This associates your Kubernetes service account with your Google service account.\n2. If the Google Cloud service you're trying to access requires additional roles, grant them for the Google service account you're using to develop your app. \n The [Understanding roles guide](https://cloud.google.com/iam/docs/understanding-roles) describes IAM role types and lists available predefined roles you can grant to identities.\n3. To add your Kubernetes service account to your deploy configuration, navigate to your **Cloud Run: Deploy** run configuration, expand the **Advanced revision settings** section, and then specify your Kubernetes service account in the **Service\n Account** field. \n\n\u003cbr /\u003e\n\n### Remote development with Secret Manager enabled\n\nIf you're developing remotely, using a service account for authentication,\nand your application uses [secrets](/code/docs/intellij/secret-manager-ux), you\nneed to complete a few more steps to assign your Google service account\nthe role required to access a particular Secret Manager secret:\n\n1. Open the Secret Manager panel and select the secret you want to access in your\n code.\n\n2. Switch to the Permissions tab and then configure your secret's permissions\n by clicking edit\n **Edit Permission**. The Secret Manager configuration page for\n the secret opens in your web browser.\n\n3. In Google Cloud console, click **Show Info Panel** and then click **Add principal**.\n\n4. Assign your service account the **Secret Manager Secret Accessor** role.\n\n Your service account has permission to access this secret.\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]