This tutorial goes through Deployment Manager using the
tool. Follow the setup steps to prepare your local environment to use Deployment
Create a project
Deployment Manager requires a Google Cloud Platform (GCP) project. If you already have a project, you can use your existing project.
If you are new to GCP, you can create a new project and take advantage of GCP's free trial package, which gives you $300 to spend on all GCP products over 12 months. To sign up for the free trial:
- Open the GCP Console.
- Follow the instructions to sign up for the free trial.
- When prompted to create a project, enter a name and a project ID that will be used to identify your project, or accept the defaults, and click Create. ...see naming guidelines
Enable the APIs for the GCP resources that you want to manage
Deployment Manager uses the APIs of other GCP services to create and manage your resources. To create these resources, you must first enable the services' APIs for your project.
For this walkthrough, you deploy Compute Engine resources, so you need to enable the Compute Engine API.
Next, enable Deployment Manager:
Install Cloud SDK
The Cloud SDK offers a command-line tool,
gcloud, that makes interacting with
Deployment Manager easy.
To install Cloud SDK:
Alternatively, use Cloud Shell, which comes with
Set your project ID.
Every command requires a project ID. Set a default project ID so you do not need to provide it every time. Remember to replace
myprojectwith your own project ID.
gcloud config set project myproject
Set your default zone and region. Some GCP resources require a zone or a region and you can set a default zone or region, similar to a default project. To set a default zone or region, use
gcloud config set. In this case, use
us-central1as the region and
us-central1-fas the zone:
gcloud config set compute/region us-central1 gcloud config set compute/zone us-central1-f
Clone the Deployment Manager GitHub repository
The Deployment Manager GitHub repository contains samples created by Google and the Deployment Manager community, including the samples used in this walkthrough.
git clone https://github.com/GoogleCloudPlatform/deploymentmanager-samples # open the samples folder cd deploymentmanager-samples/examples/v2/step_by_step_guide
Now that you have set up your environment, you can start creating your deployment.