11# Input to create instance using the GCP instance plugin
22{{/* =% sh %= */}}
33
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}}:"
812
913infrakit --log 3 --log-stack --name instance-gcp instance provision -y - <<EOF
1014
15+ LogicalID : {{ $privateIP }}
1116Tags:
1217 infrakit-user: {{ $user }}
1318 infrakit-created: {{ now | htmlDate }}
@@ -20,11 +25,12 @@ Init: |
2025
2126Properties:
2227 NamePrefix: {{ $prefix }}
28+ PrivateIP: {{ $privateIP }}
2329 Description: Some description
2430 Network: default
2531 MachineType: {{ $machineType }}
2632 DiskSizeMb: {{ $diskSize }}
27- DiskImage: https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20161205
33+ DiskImage: {{ $image }}
2834 Scopes:
2935 - https://www.googleapis.com/auth/cloudruntimeconfig
3036 - https://www.googleapis.com/auth/logging.write
0 commit comments