This tutorial goes through Deployment Manager using the gcloud
command-line tool. Follow the setup steps to prepare your local environment to
use Deployment Manager.
Create a project
Deployment Manager requires a Google Cloud project. If you already have a project, you can use your existing project.
If you are new to Google Cloud, you can create a new project and take advantage of Google Cloud's free trial package, which gives you $300 to spend on all Google Cloud products over 90 days. To sign up for the free trial:
- Open the Google Cloud 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.
Enable the APIs for the Google Cloud resources that you want to manage
Deployment Manager uses the APIs of other Google Cloud 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:
Enable the Deployment Manager API
Install Google Cloud CLI
The Google Cloud CLI offers a command-line tool, gcloud
, that makes interacting
with Deployment Manager easy.
To install gcloud CLI:
Download and authenticate
gcloud
.Alternatively, use Cloud Shell, which comes with
gcloud
already installed.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
myproject
with your own project ID.gcloud config set project myproject
Set your default zone and region. Some Google Cloud 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, useus-central1
as the region andus-central1-f
as 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.