Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit a674126

Browse files
YujiOshimaDavid Chung
authored andcommitted
add aws scale-group playbook (#535)
Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>
1 parent 319152e commit a674126

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

docs/playbooks/intro/aws/index.ikb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11

22
# Create a single instance
33
provision-instance : provision-instance.ikt
4+
5+
# Manage a scale group
6+
scale-group : provision-group.yml
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{/* Input to create a group using the AWS instance plugin and manager */}}
2+
{{/* =% managerCommit true false %= */}}
3+
4+
{{ $size := flag "size" "int" "Size of the group" | prompt "How many nodes?" "int" 2 }}
5+
{{ $groupName := flag "group-name" "string" "Name of group" | prompt "Name of the group?" "string" "mygroup" }}
6+
{{ $az := flag "availability-zone" "string" "Availability zone" | prompt "AvailabilityZone?" "string" "us-west-1a" }}
7+
{{ $image := flag "image-id" "string" "Image ID" | prompt "Image to boot?" "string" "ami-4926fd29" }}
8+
{{ $instanceType := flag "instance-type" "string" "Instance type" | prompt "Instance type?" "string" "t2.micro"}}
9+
{{ $sshKey := flag "ssh-key" "string" "SSH key name" | prompt "SSH key?" "string" "" }}
10+
{{ $SecurityGroupId := flag "security-group-id" "string" "Security group ID" | prompt "Names of security group ID?" "string" "" }}
11+
{{ $project := var "/project" | flag "project" "string" "Project name" | prompt "Project?" "string" "myproject" }}
12+
13+
- Plugin: group
14+
Properties:
15+
ID: {{ $groupName }}
16+
Properties:
17+
Allocation:
18+
Size: {{ $size }}
19+
Flavor:
20+
Plugin: flavor-vanilla
21+
Properties:
22+
Init:
23+
- apt-get update -y
24+
- apt-get install wget curl
25+
- wget -qO- https://get.docker.com | sh
26+
Tags:
27+
project: {{ $project }}
28+
29+
Instance:
30+
Plugin: instance-aws/ec2-instance
31+
Properties:
32+
RunInstancesInput:
33+
Placement:
34+
AvailabilityZone: {{ $az }}
35+
ImageId: {{ $image }}
36+
InstanceType: {{ $instanceType }}
37+
KeyName: {{ $sshKey }}
38+
SecurityGroupIds:
39+
- {{ $SecurityGroupId }}
40+
Tags:
41+
Name: {{ $groupName }}

0 commit comments

Comments
 (0)