AnyCloud
Search…
Deploy to GCP

Enable programmatic GCP access for AnyCloud

1) Create a service account for your GCP project as described here with the Compute Engine Admin role.
2) Create a service account key for your newly created service account as described here and export it as a JSON file.
3) Take a look at the exported JSON file. Add a new Credentials by taking the privateKey, clientEmail and projectId from step 2.
You will need to pick a name, or alias, for the Credentials. The default value will be gcp. In this example, we will call it mystartup-gcp.
1
$ anycloud credentials new
2
? Pick cloud provider for the new credentials ›
3
AWS
4
❯ GCP
5
Azure
6
? Credentials Name › mystartup-gcp
7
? GCP Project ID › my-gcp-project
8
? GCP Client Email › *******[email protected]
9
? GCP Private Key › -----BEGIN PRIVATE KEY-----\*****\n-----END PRIVATE KEY-----\n
10
Successfully created "mystartup-gcp" credentials
Copied!

Configure your project

Define a new Deploy Config in the anycloud.json project you want to deploy to GCP using the AnyCloud CLI
You will need to pick a name, or alias, for the Deploy Config. The default value will be staging. You will also need to associate Credentials to this Deploy Config.
1
$ anycloud config new
2
Name for new Deploy Config: staging
3
? Pick Credentials to use ›
4
❯ mystartup-gcp
5
Create new Credentials
6
? Do you want to choose a specific region for this Deploy Config? › y
7
? Region name › us-east4-a
8
? Do you want to select which virtual machine type to use for this Deploy Config? › y
9
? Virtual Machine Type › e2-standard-2
10
? Do you want to add another region to this Deploy Config? › n
11
? Minimum number of VMs per region or cloud › 1
12
? Would you like to define a maximum number of VMs? › n
13
Successfully created "staging" Deploy Config.
Copied!
Last modified 5mo ago