Register a GCP credential in CDP

Once you have created a service account and generated a JSON access key in GCP, register the access key as a credential in GCP.

Before you begin

Prior to registering a GCP credential in CDP, you should create a service account in Google Cloud and assign the required permissions to it. Next, you should generate a JSON access key for the service account. See Service account for the provisioning credential. Once done, you can register the Google Cloud credential in CDP using the steps below.

Required role: EnvironmentCreator

Steps

  1. Log in to the CDP web interface.

  2. Navigate to the Management Console.
  3. Select Shared Resources > Credentials from the navigation pane.

  4. Click Create Credential.

  5. Under Select Cloud Provider, select Google to access credential options for Google Cloud Platform.

  6. Provide the following information:

    Parameter Description
    Name Enter a name for your credential.
    Description (Optional) Enter a description.
    Key Type JSON is pre-selected. Do not change this. P12 key type is only included for backward compatibility, not for new deployments.
    Service Account Private Key (JSON format) Upload the JSON access key generated for your pre-created service account. You should have saved it on your computer in an earlier step.
  7. Click Create Credential.

Once you’ve created a service account and generated an access key, you can provide the access key to CDP by creating a credential.

Use the following CDP CLI command to create a credential:
cdp environments create-gcp-credential \
--credential-name YOUR-CREDENTIAL-NAME \
--credential-key file:///PATH/TO/FILE.json 

The --credential-key parameter to point to the location of the JSON access key file on your computer.

For example:

cdp environments create-gcp-credential \
--credential-name test-gcp-cred \
--credential-key file:///Users/jsmith/Downloads/test-gcp-181d5f172bf1.json

Use the following command to verify that the credential has been created:

cdp environments list-credentials

After you finish

Now that you have created the credential, you can register it as part of a CDP environment.