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

What's hot (19)

PDF
Drupal Development with Docker
Promet Source
 
PDF
Building images from dockerfiles
dotCloud
 
PDF
New Ways to Find Latency in Linux Using Tracing
ScyllaDB
 
PDF
Server-410_RatanMohapatra
Ratan Mohapatra
 
PPTX
08 2020 - vm scale set dns
James Dumont le Douarec
 
DOC
Step by step enabling automatic dhcp server backup
laonap166
 
PPTX
Feb 2010 Intro To Remoteing Part1
Southeast Michigan PowerShell Script Club
 
PPTX
Presentation Linux Server setup Advance Networking
Tariqul Islam Shohag
 
PDF
mail server
chacheng oo
 
TXT
Query to find permspace to all databases
Naresh Chandra Kumar
 
DOC
Devry gsp 215 week 7 homework networking commands new
uopassignment
 
PPTX
Streaming Replication Made Easy in v9.3
Sameer Kumar
 
PDF
Half a year with contrail at production
Krzysztof Kowalik
 
PPTX
April 2010-intro-to-remoting-part2
Southeast Michigan PowerShell Script Club
 
PDF
Docker
Geng-Dian Huang
 
PDF
Introduction to ns2
ProfDrSharadSharma
 
DOCX
Setup ip address manually using nmcli command
Ganesh Bhosale
 
DOC
Devry gsp 215 week 7 homework networking commands new
shyaminfopvtltd
 
PPT
Linux kernel memory allocators
Hao-Ran Liu
 
Drupal Development with Docker
Promet Source
 
Building images from dockerfiles
dotCloud
 
New Ways to Find Latency in Linux Using Tracing
ScyllaDB
 
Server-410_RatanMohapatra
Ratan Mohapatra
 
08 2020 - vm scale set dns
James Dumont le Douarec
 
Step by step enabling automatic dhcp server backup
laonap166
 
Feb 2010 Intro To Remoteing Part1
Southeast Michigan PowerShell Script Club
 
Presentation Linux Server setup Advance Networking
Tariqul Islam Shohag
 
mail server
chacheng oo
 
Query to find permspace to all databases
Naresh Chandra Kumar
 
Devry gsp 215 week 7 homework networking commands new
uopassignment
 
Streaming Replication Made Easy in v9.3
Sameer Kumar
 
Half a year with contrail at production
Krzysztof Kowalik
 
April 2010-intro-to-remoting-part2
Southeast Michigan PowerShell Script Club
 
Introduction to ns2
ProfDrSharadSharma
 
Setup ip address manually using nmcli command
Ganesh Bhosale
 
Devry gsp 215 week 7 homework networking commands new
shyaminfopvtltd
 
Linux kernel memory allocators
Hao-Ran Liu
 

Similar to GCP Deployment Manager Demo (20)

PDF
Infrastructure Management in GCP
Dana Hoffman
 
ODP
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
javier ramirez
 
PDF
Ci/CD - Stop wasting time, Automate your deployments
Jerry Jalava
 
PPTX
Deploy a compute instance with a remote startup script
Mahmmoud Mahdi
 
PPTX
Cloud Meetup - Automation in the Cloud
petriojala123
 
PPTX
TIAD : Automate everything with Google Cloud
The Incredible Automation Day
 
PPTX
Deploying Kubernetes on GCP with Kubespray
Altoros
 
PDF
Introduction to Kubernetes with demo
Opsta
 
PPTX
Deploying Cloud Native Red Team Infrastructure with Kubernetes, Istio and Envoy
Jeffrey Holden
 
PDF
Terraforming your Infrastructure on GCP
Samuel Chow
 
PDF
gcp-for-aws-professionals-presentation.pdf
gobeli2850
 
PDF
Kubernetes Boulder - Kit Merker - Cloud Native Deployment
Kit Merker
 
PDF
Infrastructure as Code using Deployment Manager and Kubernetes
David Schweikert
 
PPTX
Google cloud essential skills challenge lab
Mahmmoud Mahdi
 
PDF
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
SaltStack
 
PDF
Google Cloud Platform Special Training
Simon Su
 
PPTX
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
Oleg Shalygin
 
PDF
Infrastructure as Code: Manage your Architecture with Git
Danilo Poccia
 
PPTX
Intro to Cloudify
Ron Zavner
 
PDF
Microservices DevOps on Google Cloud Platform
Sunnyvale
 
Infrastructure Management in GCP
Dana Hoffman
 
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
javier ramirez
 
Ci/CD - Stop wasting time, Automate your deployments
Jerry Jalava
 
Deploy a compute instance with a remote startup script
Mahmmoud Mahdi
 
Cloud Meetup - Automation in the Cloud
petriojala123
 
TIAD : Automate everything with Google Cloud
The Incredible Automation Day
 
Deploying Kubernetes on GCP with Kubespray
Altoros
 
Introduction to Kubernetes with demo
Opsta
 
Deploying Cloud Native Red Team Infrastructure with Kubernetes, Istio and Envoy
Jeffrey Holden
 
Terraforming your Infrastructure on GCP
Samuel Chow
 
gcp-for-aws-professionals-presentation.pdf
gobeli2850
 
Kubernetes Boulder - Kit Merker - Cloud Native Deployment
Kit Merker
 
Infrastructure as Code using Deployment Manager and Kubernetes
David Schweikert
 
Google cloud essential skills challenge lab
Mahmmoud Mahdi
 
SaltConf14 - Eric johnson, Google - Orchestrating Google Compute Engine with ...
SaltStack
 
Google Cloud Platform Special Training
Simon Su
 
GCP - Continuous Integration and Delivery into Kubernetes with GitHub, Travis...
Oleg Shalygin
 
Infrastructure as Code: Manage your Architecture with Git
Danilo Poccia
 
Intro to Cloudify
Ron Zavner
 
Microservices DevOps on Google Cloud Platform
Sunnyvale
 
Ad

More from Vijayananda Mohire (20)

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

Recently uploaded (20)

PDF
SSO ID RAJASTHAN, LOGIN AND REGISTRATION
SSO-ID. net
 
PPTX
Ensuring Pest-Free Homes Through Integrated Control Techniques.pptx
goodlifepestcontrols
 
PDF
Ayush License Registration In India.pdf
Registration Guru
 
PDF
The Science of Sales Funnels How to Guide Visitors to Buy from You.pdf
FOME Agency
 
PPTX
Expert digital marketing agency for online growth
webcooks Digital Academy
 
PDF
Vacant property Security OpalstoneYour Protection Partner.pdf
Opalstone Group Ltd
 
PDF
GetOnCRM Salesforce identity resolution tech stack for education.pdf
GetOnCRM Solutions
 
PPTX
E2-Visa-powerpoint describe the details about E-2
boringmccarthy
 
PDF
💰 Inzofin – Finance & Tax WordPress Theme
zozothemes
 
PDF
Building a Culture of Data Security in Your Organization
VRS Technologies
 
PDF
Your Office Deserves Delhi NCR’s Best Cleaners.pdf
oneserviceprovider01
 
PDF
What Are Liquidity Pools in DeFi- A Complete Guide to Understanding Liquidity...
michaeltaylorarmswap
 
PDF
Dance Photography Southern California USA
Bashe + Still Photography
 
PDF
SARomics Biostructures Company Presentation - 2025
Salam Al-Karadaghi
 
PPTX
the Circulatory and lymphatic systems.pptx
TinaDadkhah1
 
PPTX
North Vancouver News - www.northshoredailypost.com
North Shore Daily Post
 
PDF
Top 10 Medical Coding Courses in Noida With Placements
ca99579957
 
PPTX
Cybersecurity Solutions in Abu Dhabi | Bluechip Gulf
Bluechip Gulf
 
PDF
Digital marketing company in Punjab for ROI driven results
webcooks Digital Academy
 
PDF
WP - BI MV GAN - Order of Materialsxxxxx
vanessabeumont1
 
SSO ID RAJASTHAN, LOGIN AND REGISTRATION
SSO-ID. net
 
Ensuring Pest-Free Homes Through Integrated Control Techniques.pptx
goodlifepestcontrols
 
Ayush License Registration In India.pdf
Registration Guru
 
The Science of Sales Funnels How to Guide Visitors to Buy from You.pdf
FOME Agency
 
Expert digital marketing agency for online growth
webcooks Digital Academy
 
Vacant property Security OpalstoneYour Protection Partner.pdf
Opalstone Group Ltd
 
GetOnCRM Salesforce identity resolution tech stack for education.pdf
GetOnCRM Solutions
 
E2-Visa-powerpoint describe the details about E-2
boringmccarthy
 
💰 Inzofin – Finance & Tax WordPress Theme
zozothemes
 
Building a Culture of Data Security in Your Organization
VRS Technologies
 
Your Office Deserves Delhi NCR’s Best Cleaners.pdf
oneserviceprovider01
 
What Are Liquidity Pools in DeFi- A Complete Guide to Understanding Liquidity...
michaeltaylorarmswap
 
Dance Photography Southern California USA
Bashe + Still Photography
 
SARomics Biostructures Company Presentation - 2025
Salam Al-Karadaghi
 
the Circulatory and lymphatic systems.pptx
TinaDadkhah1
 
North Vancouver News - www.northshoredailypost.com
North Shore Daily Post
 
Top 10 Medical Coding Courses in Noida With Placements
ca99579957
 
Cybersecurity Solutions in Abu Dhabi | Bluechip Gulf
Bluechip Gulf
 
Digital marketing company in Punjab for ROI driven results
webcooks Digital Academy
 
WP - BI MV GAN - Order of Materialsxxxxx
vanessabeumont1
 

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