-
Notifications
You must be signed in to change notification settings - Fork 39
/
gcp_deployment_manager.yaml
52 lines (50 loc) · 1.44 KB
/
gcp_deployment_manager.yaml
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
#
# Author: Hari Sekhon
# Date: 2020-02-03 13:15:48 +0000 (Mon, 03 Feb 2020)
#
# vim:ts=2:sts=2:sw=2:et
#
# https://github.com/HariSekhon/Templates
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn
# and optionally send me feedback to help improve or steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
---
imports:
- path: gcp_deployment_manager_instance_template.yaml.j2
resources:
# auto-mode network
- name: mynetwork
type: compute.v1.network
properties:
autoCreateSubnetworks: true
# 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
# mynet-us-vm instance
- name: mynet-us-vm
type: gcp_deployment_manager_instance_template.yaml.j2
properties:
zone: us-central1-a
machineType: n1-standard-1
network: $(ref.mynetwork.selfLink)
subnetwork: regions/us-central1/subnetworks/mynetwork
# mynet-eu-vm instance
- name: mynet-eu-vm
type: gcp_deployment_manager_instance_template.yaml.j2
properties:
zone: europe-west1-d
machineType: n1-standard-1
network: $(ref.mynetwork.selfLink)
subnetwork: regions/europe-west1/subnetworks/mynetwork