SlideShare a Scribd company logo
Using GCP Deployment Manager to deploy resources
Requirement: Deploy VM instances along with firewall rules, to servers in US and EU using Google Cloud Shell
Environment: GCP Console, GCP Shell, Deployment Manager, YAML and JINJA files
Key results: Login using your GCP subscription, create or reuse earlier VM instances and follow the below
From Shell, create a folder dminfra using mkdir command, change dir to dminfra and open Shell Editor. Using the editor
create 2 new files in the dminfra directory called config.yaml and instance-template.jinja
Copy the file contents as below (see that your Editor does not show YAML syntax errors):
CONFIG.YAML
imports:
- path: instance-template.jinja
resources:
# Create the auto-mode network
- name: mynetwork
type: compute.v1.network
properties:
autoCreateSubnetworks: true
# Create the firewall rule
- name: mynetwork-allow-http-ssh-rdp-icmp
type: compute.v1.firewall
properties:
network: $(ref.mynetwork.selfLink)
sourceRanges: ["0.0.0.0/0"]
allowed:
- IPProtocol: TCP
ports: [22, 80, 3389]
- IPProtocol: ICMP
# Create the mynet-us-vm instance
- name: mynet-us-vm
type: instance-template.jinja
properties:
zone: us-central1-a
machineType: n1-standard-1
network: $(ref.mynetwork.selfLink)
subnetwork: regions/us-central1/subnetworks/mynetwork
# Create the mynet-eu-vm instance
- name: mynet-eu-vm
type: instance-template.jinja
properties:
zone: europe-west1-d
machineType: n1-standard-1
network: $(ref.mynetwork.selfLink)
subnetwork: regions/europe-west1/subnetworks/mynetwork
//
INSTANCE-TEMPLATE.JINJA
resources:
- name: {{ env["name"] }}
type: compute.v1.instance
properties:
machineType: zones/{{ properties["zone"] }}/machineTypes/{{ properties["machineType"] }}
zone: {{ properties["zone"] }}
networkInterfaces:
- network: {{ properties["network"] }}
subnetwork: {{ properties["subnetwork"] }}
accessConfigs:
- name: External NAT
type: ONE_TO_ONE_NAT
disks:
- deviceName: {{ env["name"] }}
type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
sourceImage: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/family/debian-9
//
Exit Shell Editor and from the Shell prompt enter the command
gcloud deployment-manager deployments create dminfra --config=config.yaml --preview
If all is well, you should get the above results, if not there might be issue in syntax or some properties/ resources is missing;
use below command to delete any earlier deployment and redeploy. Correct syntax errors in any like TAB SPACES in YAML file
gcloud deployment-manager deployments delete dminfra - Please delete earlier failed deployment for new deployment
Once errors are gone in PREVIEW, now do actual deployment using update command:
gcloud deployment-manager deployments update dminfra
For your reference below are the screenshots of the two files:
GCP Deployment Manager Demo
Hope you will be able to launch various resources using templates, instead of manually creating them from Google Console
GUI.
Disclaimer: All the above content is part of the Google Cloud Platform and used here for study and demonstration purpose
only. Prepared and executed by Bhadale IT Pvt Ltd in GCP

More Related Content

PDF
Terraform for GCP resources deployment demo
DOCX
Volume migration from one aggregate to other without impacting the applicatio...
PPTX
How to shutdown and power up of the netapp cluster mode storage system
PDF
Configuration of BIND DNS Server On CentOS 8
TXT
Powershell direct
DOCX
Different type of shells In Netapp Cluster mode 8.X and how to access them t...
PDF
Aws amazon ec2
DOCX
How to assign unowned disk in the netapp cluster 8.3
Terraform for GCP resources deployment demo
Volume migration from one aggregate to other without impacting the applicatio...
How to shutdown and power up of the netapp cluster mode storage system
Configuration of BIND DNS Server On CentOS 8
Powershell direct
Different type of shells In Netapp Cluster mode 8.X and how to access them t...
Aws amazon ec2
How to assign unowned disk in the netapp cluster 8.3

What's hot (19)

PDF
Drupal Development with Docker
PDF
Building images from dockerfiles
PDF
New Ways to Find Latency in Linux Using Tracing
PDF
Server-410_RatanMohapatra
PPTX
08 2020 - vm scale set dns
DOC
Step by step enabling automatic dhcp server backup
PPTX
Feb 2010 Intro To Remoteing Part1
PPTX
Presentation Linux Server setup Advance Networking
PDF
mail server
TXT
Query to find permspace to all databases
DOC
Devry gsp 215 week 7 homework networking commands new
PPTX
Streaming Replication Made Easy in v9.3
PDF
Half a year with contrail at production
PPTX
April 2010-intro-to-remoting-part2
PDF
PDF
Introduction to ns2
DOCX
Setup ip address manually using nmcli command
DOC
Devry gsp 215 week 7 homework networking commands new
PPT
Linux kernel memory allocators
Drupal Development with Docker
Building images from dockerfiles
New Ways to Find Latency in Linux Using Tracing
Server-410_RatanMohapatra
08 2020 - vm scale set dns
Step by step enabling automatic dhcp server backup
Feb 2010 Intro To Remoteing Part1
Presentation Linux Server setup Advance Networking
mail server
Query to find permspace to all databases
Devry gsp 215 week 7 homework networking commands new
Streaming Replication Made Easy in v9.3
Half a year with contrail at production
April 2010-intro-to-remoting-part2
Introduction to ns2
Setup ip address manually using nmcli command
Devry gsp 215 week 7 homework networking commands new
Linux kernel memory allocators
Ad

Similar to GCP Deployment Manager Demo (20)

PDF
Infrastructure Management in GCP
ODP
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
PDF
Ci/CD - Stop wasting time, Automate your deployments
PPTX
Deploy a compute instance with a remote startup script
PPTX
Cloud Meetup - Automation in the Cloud
PPTX
TIAD : Automate everything with Google Cloud
PPTX
Deploying Kubernetes on GCP with Kubespray
PDF
Introduction to Kubernetes with demo
PPTX
Deploying Cloud Native Red Team Infrastructure with Kubernetes, Istio and Envoy
PDF
Terraforming your Infrastructure on GCP
PDF
gcp-for-aws-professionals-presentation.pdf
PDF
Kubernetes Boulder - Kit Merker - Cloud Native Deployment
PDF
Infrastructure as Code using Deployment Manager and Kubernetes
PPTX
Google cloud essential skills challenge lab
PDF
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
PDF
Google Cloud Platform Special Training
PPTX
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
PDF
Infrastructure as Code: Manage your Architecture with Git
PPTX
Intro to Cloudify
PDF
Microservices DevOps on Google Cloud Platform
Infrastructure Management in GCP
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Ci/CD - Stop wasting time, Automate your deployments
Deploy a compute instance with a remote startup script
Cloud Meetup - Automation in the Cloud
TIAD : Automate everything with Google Cloud
Deploying Kubernetes on GCP with Kubespray
Introduction to Kubernetes with demo
Deploying Cloud Native Red Team Infrastructure with Kubernetes, Istio and Envoy
Terraforming your Infrastructure on GCP
gcp-for-aws-professionals-presentation.pdf
Kubernetes Boulder - Kit Merker - Cloud Native Deployment
Infrastructure as Code using Deployment Manager and Kubernetes
Google cloud essential skills challenge lab
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
Google Cloud Platform Special Training
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
Infrastructure as Code: Manage your Architecture with Git
Intro to Cloudify
Microservices DevOps on Google Cloud Platform
Ad

More from Vijayananda Mohire (20)

PDF
Bhadale QAI Hub - for multicloud, multitechnology platform
PDF
Practical_Introduction_to_Quantum_Safe_Cryptography
PDF
Progress Report- MIT Course 8.371.3x - VD-Mohire
PDF
Quantum Communications Q&A with Gemini LLM
PDF
Peer Review Certificate for Journal of Engg
PDF
Quantum Algorithms for Electronics - IEEE Certificate
PDF
NexGen Solutions for cloud platforms, powered by GenQAI
PDF
Certificate- Peer Review of Book Chapter on ML
PDF
Key projects Data Science and Engineering
PDF
Key projects Data Science and Engineering
PDF
Bhadale IT Hub-Multi Cloud and Multi QAI
PDF
My key hands-on projects in Quantum, and QAI
PDF
Azure Quantum Workspace for developing Q# based quantum circuits
PDF
Key projects in AI, ML and Generative AI
PDF
My Journey towards Artificial Intelligence
PDF
Bhadale IT Cloud Solutions for Agriculture
PDF
Bhadale IT Cloud Solutions for Agriculture
PDF
Bhadale IT Intel and Azure Cloud Offerings
PDF
GitHub Copilot-vijaymohire
PDF
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications
Bhadale QAI Hub - for multicloud, multitechnology platform
Practical_Introduction_to_Quantum_Safe_Cryptography
Progress Report- MIT Course 8.371.3x - VD-Mohire
Quantum Communications Q&A with Gemini LLM
Peer Review Certificate for Journal of Engg
Quantum Algorithms for Electronics - IEEE Certificate
NexGen Solutions for cloud platforms, powered by GenQAI
Certificate- Peer Review of Book Chapter on ML
Key projects Data Science and Engineering
Key projects Data Science and Engineering
Bhadale IT Hub-Multi Cloud and Multi QAI
My key hands-on projects in Quantum, and QAI
Azure Quantum Workspace for developing Q# based quantum circuits
Key projects in AI, ML and Generative AI
My Journey towards Artificial Intelligence
Bhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for Agriculture
Bhadale IT Intel and Azure Cloud Offerings
GitHub Copilot-vijaymohire
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications

Recently uploaded (20)

PPTX
CCC-Ancillary-Slidesk powerpoint present.pptx
PDF
Digital marketing strategy slides .pdf
PDF
Why Infotrench Stands Out as the Best SEO Agency in Noida.pdf
PPT
8.1 Protein energy malnutrition paedatric.ppt
PDF
Engine Volvo EC200B Excavator Repair Manual.pdf
PDF
The Cost of Neglect How Skipping Fire Safety Maintenance Can Lead to Disaster...
PDF
Best IPTV Reseller Program & Best IPTV Reseller Panel 2025
PDF
Best Platforms to Buy Verified Cash App Accounts in 2026.pdf
PDF
Income Tax Return Filing (ITR Filing) by Sharkbite Legal
PDF
cost of gds integrationcomparingwith.pdf
PPTX
ENG102 Presenation skjdcjkdwjfdwjkcjwejkfjkw.pptx
PDF
Investhill_Report OCD (2007-2024)_2025-1.pdf
PPTX
Day Care Centre Proposal.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PPTX
Methane-Fermented Microbial Protein.pptx
PPTX
Al Tamayoz Company Profile asd asd asdasd
PPTX
Ealeba Youth Structure Five Core Programs & Projects Executives
PDF
Why Hauz Khas is a Perfect Location for Digital Marketing Training.pdf
PPTX
AI-Powered-Mobile-App-Development-The-Future-of-Intelligent-Applications.pptx
PDF
How Do IT Infrastructure Solutions Support Innovation?
PDF
Robert Hume San Diego_ How Firefighting Tools and Technology Have Transformed...
CCC-Ancillary-Slidesk powerpoint present.pptx
Digital marketing strategy slides .pdf
Why Infotrench Stands Out as the Best SEO Agency in Noida.pdf
8.1 Protein energy malnutrition paedatric.ppt
Engine Volvo EC200B Excavator Repair Manual.pdf
The Cost of Neglect How Skipping Fire Safety Maintenance Can Lead to Disaster...
Best IPTV Reseller Program & Best IPTV Reseller Panel 2025
Best Platforms to Buy Verified Cash App Accounts in 2026.pdf
Income Tax Return Filing (ITR Filing) by Sharkbite Legal
cost of gds integrationcomparingwith.pdf
ENG102 Presenation skjdcjkdwjfdwjkcjwejkfjkw.pptx
Investhill_Report OCD (2007-2024)_2025-1.pdf
Day Care Centre Proposal.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Methane-Fermented Microbial Protein.pptx
Al Tamayoz Company Profile asd asd asdasd
Ealeba Youth Structure Five Core Programs & Projects Executives
Why Hauz Khas is a Perfect Location for Digital Marketing Training.pdf
AI-Powered-Mobile-App-Development-The-Future-of-Intelligent-Applications.pptx
How Do IT Infrastructure Solutions Support Innovation?
Robert Hume San Diego_ How Firefighting Tools and Technology Have Transformed...

GCP Deployment Manager Demo

  • 1. Using GCP Deployment Manager to deploy resources Requirement: Deploy VM instances along with firewall rules, to servers in US and EU using Google Cloud Shell Environment: GCP Console, GCP Shell, Deployment Manager, YAML and JINJA files Key results: Login using your GCP subscription, create or reuse earlier VM instances and follow the below From Shell, create a folder dminfra using mkdir command, change dir to dminfra and open Shell Editor. Using the editor create 2 new files in the dminfra directory called config.yaml and instance-template.jinja Copy the file contents as below (see that your Editor does not show YAML syntax errors): CONFIG.YAML imports: - path: instance-template.jinja resources: # Create the auto-mode network - name: mynetwork type: compute.v1.network properties: autoCreateSubnetworks: true # Create the firewall rule - name: mynetwork-allow-http-ssh-rdp-icmp type: compute.v1.firewall properties: network: $(ref.mynetwork.selfLink) sourceRanges: ["0.0.0.0/0"]
  • 2. allowed: - IPProtocol: TCP ports: [22, 80, 3389] - IPProtocol: ICMP # Create the mynet-us-vm instance - name: mynet-us-vm type: instance-template.jinja properties: zone: us-central1-a machineType: n1-standard-1 network: $(ref.mynetwork.selfLink) subnetwork: regions/us-central1/subnetworks/mynetwork # Create the mynet-eu-vm instance - name: mynet-eu-vm type: instance-template.jinja properties: zone: europe-west1-d machineType: n1-standard-1 network: $(ref.mynetwork.selfLink) subnetwork: regions/europe-west1/subnetworks/mynetwork //
  • 3. INSTANCE-TEMPLATE.JINJA resources: - name: {{ env["name"] }} type: compute.v1.instance properties: machineType: zones/{{ properties["zone"] }}/machineTypes/{{ properties["machineType"] }} zone: {{ properties["zone"] }} networkInterfaces: - network: {{ properties["network"] }} subnetwork: {{ properties["subnetwork"] }} accessConfigs: - name: External NAT type: ONE_TO_ONE_NAT disks: - deviceName: {{ env["name"] }} type: PERSISTENT boot: true autoDelete: true initializeParams: sourceImage: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/family/debian-9 // Exit Shell Editor and from the Shell prompt enter the command gcloud deployment-manager deployments create dminfra --config=config.yaml --preview
  • 4. If all is well, you should get the above results, if not there might be issue in syntax or some properties/ resources is missing; use below command to delete any earlier deployment and redeploy. Correct syntax errors in any like TAB SPACES in YAML file gcloud deployment-manager deployments delete dminfra - Please delete earlier failed deployment for new deployment Once errors are gone in PREVIEW, now do actual deployment using update command: gcloud deployment-manager deployments update dminfra
  • 5. For your reference below are the screenshots of the two files:
  • 7. Hope you will be able to launch various resources using templates, instead of manually creating them from Google Console GUI. Disclaimer: All the above content is part of the Google Cloud Platform and used here for study and demonstration purpose only. Prepared and executed by Bhadale IT Pvt Ltd in GCP