Google Cloud: Deploying Networks using Deployment Manager

Share At:

Google Cloud Deployment Manager is a service that allows you to define and deploy resources in your GCP environment, as well as create templates and configurations. Google Cloud Deployment Manager also gives you the possibility to use Jinja or Python to define the resources you desire.

Google Cloud Deployment Manager vs. Terraform

So which infrastructure-as-code tool is right for your Google Cloud deployments? The choice ultimately varies based on your workload.

If you’re only deploying workloads to GCP, Deployment Manager should meet all of your deployment needs. And because it’s a built-in Google Cloud tool, it’s also easier to use from an authentication perspective.

On the other hand, Terraform is a better option when deploying to multiple cloud providers or vendors.

Lab Details:

  1. This lab walks you through GCP VPC Network creation using Cloud Deployment Manager.
  2. The main agenda of this lab is to work on the automation of creating Infrastructure.
  3. This lab will use Deployment Manager to create a VPC using a Custom subnet.

Lab Tasks:

  1. Starting Cloud Shell.
  2. Creating the Deployment.

Creating a VPC Network:

  1. Open Cloud Shell.
  2. Enter the command mkdir vpc-deploy to create a directory for the configuration file.
  3. Enter the command cd vpc-deploy to move to the vpc_deploy directory.

4. Enter the command nano vpc-deploy.yaml to create a file to initiate the infrastructure code.

5. Enter the below given code which will create a VPC Network, a custom subnet of range 10.0.2.0/29.

6. After writing the code, press CTRL o + O to save then press Enter. Press CTRL + X to exit the editor.

7. Enter the command to create a deployment from the template

gcloud deployment-manager deployments create vpc-deployment — config vpc-deploy.yaml

8. If prompted, click on Authorize.

9. You can see the deployment completed successfully and you have created a custom subnet and a VPC Network.

10. Click on the hamburger icon on the top left corner

11. Click on the VPC network under the networking section.

12. You will see the newly created VPC network and subnet there.

Completion and Conclusion:

  1. In this lab, you have created a VPC Network using Cloud Deployment Manager.

Happy Learning !!!


Share At:
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Back To Top

Contact Us