The Google Compute Engine and deployment manager API's lets you to create and manage virtual machine instances and resources for a project.
-
Select or create a Cloud Platform project in https://console.cloud.google.com/project
-
Enable the Google Compute Engine API in https://console.cloud.google.com/flows/enableapi?apiid=compute.googleapis.com
-
Set up OAuth 2.0 client Id for Web Application and authorized redirect URIs for you project - https://developers.google.com/identity/protocols/OAuth2UserAgent Set the authorized redirect URI as 'http://localhost:3000/oauth2callback'
1. Install node modules:
> $ npm install
2. Setup the PROJECT_ID, CLIENT_ID and CLIENT_SECRET:
You can find these pieces of information by going to the Developer Console https://console.cloud.google.com
- Project --> API Credentials --> Credentials.
1. In the file 'src/auth/oauth2.keys.json', replace the [CLIENT-ID] and [CLIENT-SECRET] with the values you have set in the OAuth 2.0 page of your project.
2. In the file 'src/config/config.js', src/config/two-vms.yaml and in 'src/auth/oauth2.keys.json' replace the [PROJECT-ID] with the actual value
3. If you are running the deployment manager API, make sure you have the unique deployment name.
You can find the existing deployments for a project by going to the developer console https://console.cloud.google.com/deployments
- Select the project from the drop down.
4. Run the sample:
> $ npm start