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
-
Log in to the CDP web interface.
- Navigate to the Management Console.
-
Select Shared Resources > Credentials from the navigation pane.
-
Click Create Credential.
-
Under Select Cloud Provider, select Google to access credential options for Google Cloud Platform.
-
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. -
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.
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.