Skip to content

Manage GCP using Automation Toolkit with CLI


High Level Steps to use toolkit with CLI

  1. Login to the CD3 Container.

  2. Check out CD3 Workflows document for workflows supported by the toolkit and choose the required workflow.

  3. Use GCP excel template from Excel Templates based on your requirement.

  4. Review setUpGCP.properties file: /cd3user/gcp/<prefix>/<prefix>_setUpGCP.properties.

setUpGCP.properties

[Default]

#Input variables required to run setUpGCP script

#path to output directory where terraform file will be generated. eg /cd3user/gcp/<prefix>/terraform_files
outdir=

#prefix for output terraform files eg demo
prefix=

# Auth Params
auth_mechanism=

#input credentials file for service account eg /cd3user/gcp/<prefix>/gcp_api_private.json
config_file=

#path to cd3 excel eg /cd3user/gcp/<prefix>\CD3-Customer.xlsx
cd3file=

#specify create_resources to create new resources in GCP(greenfield workflow)
#specify export_resources to export resources from GCP(non-greenfield workflow)
workflow_type=create_resources

Parameter Description <
Variable Description Example
outdir Path to output directory where terraform files will be generated /cd3user/gcp/demo/terraform_files
prefix Prefix for output terraform files demo
auth_mechanismAuthentication mechanism for GCP APIs api_key
config_file Path to the GCP service-account JSON credentials file; required for export /cd3user/credentials/gcp-service-account.json
cd3file Path to the Excel input file /cd3user/gcp/demo/CD3demo.xlsx
workflow_type Create Resources in GCP or Export Resources from GCP create_resources or export_resources

Copy CD3 Excel File

  • While using the container launched using RM Stack, local path /cd3user/mount_path on the VM is mapped to /cd3user/ inside the container. So the Excel template can be copied at /cd3user/mount_path/gcp/<prefix>/ on the VM. Below is the sample command to copy the Excel template from local system to container:

    scp -i <private key pushed to VM while creating stack> <path to excel file on local> cd3user@<Public/Private IP of the VM>:/cd3user/mount_path/gcp/<prefix>
    

  • Note that the user cd3user can be used to connect to the VM because same key is pushed for opc as well as cd3user.