Manage GCP using Automation Toolkit with CLI
High Level Steps to use toolkit with CLI
-
Login to the CD3 Container.
-
Check out CD3 Workflows document for workflows supported by the toolkit and choose the required workflow.
-
Use GCP excel template from Excel Templates based on your requirement.
-
Review
setUpGCP.propertiesfile:/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_mechanism | <Authentication 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_pathon 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: -
Note that the user
cd3usercan be used to connect to the VM because same key is pushed foropcas well ascd3user.