If you're working on an app created from a Cloud Code template, this file is located under the kubernetes-manifests folder.
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:
If you're trying to access a secret, follow these Secret Manager-specific steps to set up the required roles on your service account.
For a list of IAM role types and predefined roles you can grant to identities, see the Understanding roles guide.
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.
In the Create service account dialog, enter a descriptive name for the service account.
Change the Service account ID to a unique, recognizable value and then click Create.
If the Google Cloud service you're trying to access requires additional roles, grant them, click Continue, and then click Done.
To add your Kubernetes service account to your deploy configuration, navigate to Run>Edit Configurations, and then specify your service account in the Service Name field.
Cloud Run
Depending on the scope of your project, you can choose how you authenticate Google Cloud services on GKE:
Ensure you're using the service account GKE uses by default, the Compute Engine default service account, and that Access scopes is set at Allow full access to all Cloud APIs (both settings accessible in the Node Pools >Security section). Since the Compute Engine service account is shared by all workloads deployed on your node, this method overprovisions permissions and should only be used for development.
Ensure Workload Identity is not enabled on your cluster (in the Cluster >Security section).
Assign the necessary roles to the Compute Engine default service account:
If you're trying to access a secret, follow these Secret Manager-specific steps to set up the required roles on your service account.
If the Compute Engine default service account is being used, the correct IAM roles may already be applied.
For a list of IAM role types and predefined roles you can grant to identities, see the Understanding roles guide.
To add your Kubernetes service account to your deploy configuration, navigate to Run>Edit Configurations, and then specify your Kubernetes service account in the Service Name field.
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:
If you're trying to access a secret, follow these Secret Manager-specific steps to set up the required roles on your service account.
For a list of IAM role types and predefined roles you can grant to identities, see the Understanding roles guide.
Remote development with Secret Manager permissions enabled
If you're developing remotely, using a service account for authentication, and your application uses secrets, you need to complete a few more steps in addition to the remote development instructions. These steps assign your Google service account the role required to access a particular Secret Manager secret:
To open the Secret Manager tool window, navigate to Tools>Google Cloud Code>Secret Manager.
Select the secret that you want to access in your code.
Click the Permissions tab and then configure your secret's permissions by clicking editEdit Permission.
The Google Cloud console opens in a new window of your web browser, displaying the Secret Manager configuration page of your secret.
In the Google Cloud console, click the Permissions tab and then click Grant Access.
In the New principals field, enter your service account.
In the Select a role dropdown field, select the Secret Manager Secret Accessor role.
When you're finished, click Save.
Your service account has permission to access this secret.
Get support
To submit feedback or report an issue in your IntelliJ IDE, go to Tools >Cloud Code >Help / About >Submit feedback or report an issue to report an issue on GitHub.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-17 UTC."],[[["Google Cloud APIs, accessible via a JSON REST interface and client libraries, can be managed within your IDE via Cloud Code."],["You can enable Cloud APIs for your project directly through the Cloud API details view in the IDE."],["Cloud Client Libraries can be added to your Java Maven projects, as well as other project types, using the Cloud APIs dialog in Cloud Code."],["Cloud Code ensures that Application Default Credentials (ADC) are set when logged into Google Cloud via the IDE, simplifying authentication for local and remote development."],["For remote development on GKE and Cloud Run, you can authenticate using either the default Compute Engine service account with full API access for development or a more secure Workload Identity approach recommended for production."]]],[]]