-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAutomating the Deployment of Infrastructure Using Deployment Manager
63 lines (55 loc) · 1.67 KB
/
Automating the Deployment of Infrastructure Using Deployment Manager
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
### config.yaml ###
imports:
- path: instance-template.jinja
resources:
# 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
# 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
###### 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