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
-
In the Google Cloud console, go to the project selector page.
-
Select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
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
gcloudalready 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
myprojectwith your own project ID.gcloud config set project myprojectSet 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-central1as the region andus-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.