-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathchallenge_3_Lab.jinja
39 lines (38 loc) · 1.28 KB
/
challenge_3_Lab.jinja
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
resources:
- type: compute.v1.instance
name: vm-test
properties:
zone: {{ properties["zone"] }}
machineType: https://www.googleapis.com/compute/v1/projects/{{ env["project"] }}/zones/{{ properties["zone"] }}/machineTypes/f1-micro
# For examples on how to use startup scripts on an instance, see:
# https://cloud.google.com/compute/docs/startupscript
disks:
- deviceName: boot
type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
diskName: disk-{{ env["deployment"] }}
sourceImage: https://www.googleapis.com/compute/v1/projects/debian-cloud/global/images/family/debian-9
tags:
items: ["http"]
networkInterfaces:
- network: https://www.googleapis.com/compute/v1/projects/{{ env["project"] }}/global/networks/default
# Access Config required to give the instance a public IP address
accessConfigs:
- name: External NAT
type: ONE_TO_ONE_NAT
metadata:
items:
- key: startup-script
value: "apt-get update \n apt-get install -y apache2"
- type: compute.v1.firewall
name: allow-http
properties:
sourceTags: ["http"]
targetTags: ["http"]
sourceRanges: ["0.0.0.0/0"]
direction: INGRESS
allowed:
- IPProtocol: TCP
ports: ["80", "8080"]