Professional Documents
Culture Documents
mkdir deployment_manager
cd deployment_manager
gsutil cp gs://spls/gsp302/* . (this might based on lab account ur logging
in), its available in the lab page ..
Search as below :
Repeat the same for Compute Engine API
Now , edit deployment manager scripts to spin a instance, set firewall rules:
After the first 3 commands executed, you can find following files:
resources:
- name: my-default-allow-http
type: compute.v1.firewall
properties:
targetTags: ["http"]
sourceRanges: ["0.0.0.0/0"]
allowed:
- IPProtocol: TCP
ports: ["80"]
- type: compute.v1.instance
name: vm-test
properties:
zone: {{ properties["zone"] }}
tags:
items: ["http"]
# https://cloud.google.com/compute/docs/startupscript
disks:
- deviceName: boot
type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
sourceImage: https://www.googleapis.com/compute/v1/projects/debian-
cloud/global/images/family/debian-9
networkInterfaces:
accessConfigs:
type: ONE_TO_ONE_NAT
metadata:
items:
- key: startup-script
value: |
#!/bin/bash
Following VM is created: