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. See Create a service account and generate access key. Next, you should generate a JSON access key for the service account. Once done, you can register the Google Cloud credential in CDP using the steps below.

Steps - CDP web interface

  1. Log in to the CDP web interface.

  2. Navigate to Management Console > Environments > Shared Resources > Credentials.

  3. Click Create Credential.

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

  5. 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 in Create a service account and generate access key.
  6. Click Create Credential.

Steps - CDP CLI

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.