1
1
# Input to create instance using the GCP instance plugin
2
2
{{/* =% sh %= */}}
3
3
4
- {{ $user := flag "user" "string" "owner" | prompt "Owner?" "string" }}
5
- {{ $prefix := flag "prefix" "string" "Prefix to use" | prompt "Prefix for hostname:" "string" }}
6
- {{ $diskSize := flag "disk-size" "int" "Disk size in mb" | prompt "Disk size in MB [60]?" "int"}}
7
- {{ $machineType := flag "machine-type" "string" "Machine type" | prompt "Machine type [n1-standard-1]?" "string"}}
4
+ {{ $user := flag "user" "string" "owner" | prompt "Owner?" "string" (env "USER") nil }}
5
+ {{ $prefix := flag "prefix" "string" "Prefix to use" | prompt "Prefix for hostname:" "string" (env "USER") }}
6
+ {{ $diskSize := flag "disk-size" "int" "Disk size in mb" | prompt "Disk size in MB?" "int" 100 }}
7
+ {{ $machineType := flag "machine-type" "string" "Machine type" | prompt "Machine type?" "string" "n1-standard-1"}}
8
+ {{ $privateIP := flag "private-ip" "string" "Private IP" | prompt "Private IP address (IPv4)?" "string" "10.128.0.10" nil }}
9
+ {{ $image := flag "image" "string" "Image" | prompt "Image to boot?" "string" "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20161205" }}
10
+
11
+ echo "===> Running with {{$user}}, {{$image}}, {{$privateIP}}:"
8
12
9
13
infrakit --log 3 --log-stack --name instance-gcp instance provision -y - <<EOF
10
14
15
+ LogicalID : {{ $privateIP }}
11
16
Tags:
12
17
infrakit-user: {{ $user }}
13
18
infrakit-created: {{ now | htmlDate }}
@@ -20,11 +25,12 @@ Init: |
20
25
21
26
Properties:
22
27
NamePrefix: {{ $prefix }}
28
+ PrivateIP: {{ $privateIP }}
23
29
Description: Some description
24
30
Network: default
25
31
MachineType: {{ $machineType }}
26
32
DiskSizeMb: {{ $diskSize }}
27
- DiskImage: https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20161205
33
+ DiskImage: {{ $image }}
28
34
Scopes:
29
35
- https://www.googleapis.com/auth/cloudruntimeconfig
30
36
- https://www.googleapis.com/auth/logging.write
0 commit comments