Skip to content

Commit c135b7d

Browse files
committed
Add wizard definitions
1 parent a3d5ee7 commit c135b7d

13 files changed

+794
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"StartStage": "ApiSourceSwitch",
3+
"Stages": [
4+
{
5+
"Name": "ApiSourceSwitch",
6+
"Prompt": "What is the source for the new Api?",
7+
"Retrieval": {
8+
"Type": "Static",
9+
"Resource": [
10+
{ "Option": "Create new Api", "Stage": "CreateApi"},
11+
{ "Option": "Generate new Api from swagger spec file", "Stage": "NewSwaggerApi"}
12+
]
13+
},
14+
"Interaction": { "ScreenType": "SimpleSelect", "Path": "[].Option" },
15+
"Resolution": {
16+
"Path": "Stage",
17+
"Key": "CreationType"
18+
},
19+
"NextStage": { "Type": "Variable", "Name": "CreationType" }
20+
},
21+
{
22+
"Name": "NewSwaggerApi",
23+
"Prompt": "Enter the path to the JSON swagger spec file",
24+
"Interaction": { "ScreenType": "FilePrompt" },
25+
"Resolution": { "Key": "SwaggerBlob" },
26+
"NextStage": { "Type": "Name", "Name": "ImportApiRequest" }
27+
},
28+
{
29+
"Name": "ImportApiRequest",
30+
"Prompt": "Importing Api from swagger spec...",
31+
32+
"Retrieval": {
33+
"Type": "Request",
34+
"Resource": {
35+
"Service": "apigateway",
36+
"Operation": "ImportRestApi",
37+
"Parameters": { "failOnWarnings": true },
38+
"EnvParameters": { "body": "SwaggerBlob" }
39+
}
40+
}
41+
},
42+
{
43+
"Name": "CreateApi",
44+
"Prompt": "Api Name and Description",
45+
"Retrieval": {
46+
"Type": "Static",
47+
"Resource": { "name": "", "description": "" }
48+
},
49+
"Interaction": { "ScreenType": "SimplePrompt" },
50+
"Resolution": { "Key": "Details" },
51+
"NextStage": { "Type": "Name", "Name": "CloneSwitch" }
52+
},
53+
{
54+
"Name": "CloneSwitch",
55+
"Prompt": "Create new empty Api or clone from existing?",
56+
"Retrieval": {
57+
"Type": "Static",
58+
"Resource": [
59+
{ "Option": "Create new Api", "Stage": "CreateApiRequest" },
60+
{ "Option": "Clone existing Api", "Stage": "GetApiList" }
61+
]
62+
},
63+
"Interaction": { "ScreenType": "SimpleSelect", "Path": "[].Option" },
64+
"Resolution": { "Path": "Stage", "Key": "CloneType" },
65+
"NextStage": { "Type": "Variable", "Name": "CloneType" }
66+
},
67+
{
68+
"Name": "GetApiList",
69+
"Prompt": "Select an Api to clone",
70+
71+
"Retrieval": {
72+
"Type": "Request",
73+
"Resource": {
74+
"Service": "apigateway",
75+
"Operation": "GetRestApis"
76+
},
77+
"Path": "items"
78+
},
79+
"Interaction": { "ScreenType": "InfoSelect", "Path": "[].name" },
80+
"Resolution": { "Path": "id", "Key": "ApiId" },
81+
"NextStage": { "Type": "Name", "Name": "CreateApiRequest" }
82+
},
83+
{
84+
"Name": "CreateApiRequest",
85+
"Prompt": "Creating new Api...",
86+
87+
"Retrieval": {
88+
"Type": "Request",
89+
"Resource": {
90+
"Service": "apigateway",
91+
"Operation": "CreateRestApi",
92+
"EnvParameters": {
93+
"cloneFrom": "ApiId",
94+
"name": "Details.name",
95+
"description": "Details.description"
96+
}
97+
}
98+
}
99+
}
100+
]
101+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"StartStage": "NamePrompt",
3+
"Stages": [
4+
{
5+
"Name": "NamePrompt",
6+
"Prompt": "Enter the Instance Profile name",
7+
8+
"Retrieval": {
9+
"Type": "Static",
10+
"Resource": {"Name": ""}
11+
},
12+
13+
"Interaction": { "ScreenType": "SimplePrompt" },
14+
"Resolution": { "Path": "Name", "Key": "ProfileName" },
15+
"NextStage": { "Type": "Name", "Name": "CreateProfile" }
16+
},
17+
{
18+
"Name": "CreateProfile",
19+
"Prompt": "Creating Profile...",
20+
21+
"Retrieval": {
22+
"Type": "Request",
23+
"Resource": {
24+
"Service": "iam",
25+
"Operation": "CreateInstanceProfile",
26+
"EnvParameters": {
27+
"InstanceProfileName": "ProfileName"
28+
}
29+
},
30+
"Path": "InstanceProfile"
31+
},
32+
"Resolution": { "Key": "Profile" },
33+
"NextStage": { "Type": "Name", "Name": "AddRoleSwitch" }
34+
},
35+
{
36+
"Name": "AddRoleSwitch",
37+
"Prompt": "Add a role to this profile?",
38+
"Retrieval": {
39+
"Type": "Static",
40+
"Resource": [
41+
{ "Option": "Yes", "Stage": "SelectRole"},
42+
{ "Option": "No", "Stage": "GetRole"}
43+
]
44+
},
45+
"Interaction": { "ScreenType": "SimpleSelect", "Path": "[].Option" },
46+
"Resolution": { "Path": "Stage", "Key": "RoleSwitch" },
47+
"NextStage": { "Type": "Variable", "Name": "RoleSwitch" }
48+
},
49+
{
50+
"Name": "SelectRole",
51+
"Prompt": "Select Role to add:",
52+
"Retrieval": {
53+
"Type": "Request",
54+
"Resource": {
55+
"Service": "iam",
56+
"Operation": "ListRoles"
57+
},
58+
"Path": "Roles[].RoleName"
59+
},
60+
"Interaction": { "ScreenType": "SimpleSelect" },
61+
"Resolution": { "Key": "RoleName" },
62+
"NextStage": { "Type": "Name", "Name": "AddRole" }
63+
},
64+
{
65+
"Name": "AddRole",
66+
"Prompt": "Adding role...",
67+
"Retrieval": {
68+
"Type": "Request",
69+
"Resource": {
70+
"Service": "iam",
71+
"Operation": "AddRoleToInstanceProfile",
72+
"EnvParameters": {
73+
"RoleName": "RoleName",
74+
"InstanceProfileName": "Profile.InstanceProfileName"
75+
}
76+
}
77+
},
78+
"NextStage": { "Type": "Name", "Name": "GetRole" }
79+
},
80+
{
81+
"Name": "GetRole",
82+
"Prompt": "Getting role...",
83+
"Retrieval": {
84+
"Type": "Request",
85+
"Resource": {
86+
"Service": "iam",
87+
"Operation": "GetInstanceProfile",
88+
"EnvParameters": {
89+
"InstanceProfileName": "Profile.InstanceProfileName"
90+
}
91+
}
92+
}
93+
}
94+
]
95+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"StartStage": "GroupDetails",
3+
"Stages": [
4+
{
5+
"Name": "GroupDetails",
6+
"Prompt": "Please enter the details for this group: ",
7+
8+
"Retrieval": {
9+
"Type": "Static",
10+
"Resource": {"Name": "", "Description": ""}
11+
},
12+
13+
"Interaction": { "ScreenType": "SimplePrompt" },
14+
"Resolution": { "Key": "Details" },
15+
"NextStage": { "Type": "Name", "Name": "SelectVPCSwitch" }
16+
},
17+
{
18+
"Name": "SelectVPCSwitch",
19+
"Prompt": "Would you like to specify a VPC? ",
20+
"Retrieval": {
21+
"Type": "Static",
22+
"Resource": [
23+
{ "Option": "Use Default", "Stage": "CreateGroupRequest" },
24+
{ "Option": "Select a VPC", "Stage": "GetVPC" }
25+
]
26+
},
27+
"Interaction": { "ScreenType": "SimpleSelect", "Path": "[].Option" },
28+
"Resolution": { "Path": "Stage", "Key": "VPCSwitch" },
29+
"NextStage": { "Type": "Variable", "Name": "VPCSwitch" }
30+
},
31+
{
32+
"Name": "GetVPC",
33+
"Prompt": "Getting VPC to use...",
34+
35+
"Retrieval": { "Type": "Wizard", "Resource": "get-vpc" },
36+
"Resolution": { "Path": "VpcId", "Key": "VpcId" },
37+
"NextStage": { "Type": "Name", "Name": "CreateGroupRequest" }
38+
},
39+
{
40+
"Name": "CreateGroupRequest",
41+
"Prompt": "Creating Security Group...",
42+
43+
"Retrieval": {
44+
"Type": "Request",
45+
"Resource": {
46+
"Service": "ec2",
47+
"Operation": "CreateSecurityGroup",
48+
"Parameters": { "DryRun": false },
49+
"EnvParameters": {
50+
"VpcId": "VpcId",
51+
"GroupName": "Details.Name",
52+
"Description": "Details.Description"
53+
}
54+
}
55+
},
56+
"Resolution": { "Path": "GroupId", "Key": "GroupId" },
57+
"NextStage": { "Type": "Name", "Name": "GetGroup" }
58+
},
59+
{
60+
"Name": "GetGroup",
61+
"Prompt": "Getting Security Group...",
62+
63+
"Retrieval": {
64+
"Type": "Request",
65+
"Resource": {
66+
"Service": "ec2",
67+
"Operation": "DescribeSecurityGroups",
68+
"EnvParameters": { "GroupIds": "GroupId | [@]" }
69+
}
70+
},
71+
"Resolution": { "Path": "SecurityGroups[0]", "Key": "Group" }
72+
}
73+
]
74+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"StartStage": "CIDRPrompt",
3+
"Stages": [
4+
{
5+
"Name": "CIDRPrompt",
6+
"Prompt": "Enter subnet IP address block (e.g., 10.0.0.0/24)",
7+
8+
"Retrieval": {
9+
"Type": "Static",
10+
"Resource": {"CIDR": ""}
11+
},
12+
13+
"Interaction": { "ScreenType": "SimplePrompt" },
14+
"Resolution": { "Path": "CIDR", "Key": "CIDR" },
15+
"NextStage": { "Type": "Name", "Name": "ZoneSwitch" }
16+
},
17+
{
18+
"Name": "ZoneSwitch",
19+
"Prompt": "Would you like to specify an availability zone?",
20+
"Retrieval": {
21+
"Type": "Static",
22+
"Resource": [
23+
{ "Option": "No Preference", "Stage": "GetVPC"},
24+
{ "Option": "Select availability zone", "Stage": "SelectZone"}
25+
]
26+
},
27+
"Interaction": { "ScreenType": "SimpleSelect", "Path": "[].Option" },
28+
"Resolution": { "Path": "Stage", "Key": "ZoneSwitch" },
29+
"NextStage": { "Type": "Variable", "Name": "ZoneSwitch" }
30+
},
31+
{
32+
"Name": "SelectZone",
33+
"Prompt": "Select the desired zone: ",
34+
"Retrieval": {
35+
"Type": "Request",
36+
"Resource": {
37+
"Service": "ec2",
38+
"Operation": "DescribeAvailabilityZones"
39+
},
40+
"Path": "AvailabilityZones"
41+
},
42+
"Interaction": { "ScreenType": "SimpleSelect", "Path": "[].ZoneName" },
43+
"Resolution": { "Path": "ZoneName", "Key": "ZoneName" },
44+
"NextStage": { "Type": "Name", "Name": "GetVPC" }
45+
},
46+
{
47+
"Name": "GetVPC",
48+
"Prompt": "Getting VPC to use...",
49+
50+
"Retrieval": { "Type": "Wizard", "Resource": "get-vpc" },
51+
"Resolution": { "Path": "VpcId", "Key": "VpcId" },
52+
"NextStage": { "Type": "Name", "Name": "CreateSubnet" }
53+
},
54+
{
55+
"Name": "CreateSubnet",
56+
"Prompt": "Creating Subnet...",
57+
58+
"Retrieval": {
59+
"Type": "Request",
60+
"Resource": {
61+
"Service": "ec2",
62+
"Operation": "CreateSubnet",
63+
"Parameters": { "DryRun": false },
64+
"EnvParameters": {
65+
"VpcId": "VpcId",
66+
"CidrBlock": "CIDR",
67+
"AvailabilityZone": "ZoneName"
68+
}
69+
}
70+
}
71+
}
72+
]
73+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"StartStage": "CIDRPrompt",
3+
"Stages": [
4+
{
5+
"Name": "CIDRPrompt",
6+
"Prompt": "Enter VPC IP address block (e.g., 10.0.0.0/16)",
7+
8+
"Retrieval": {
9+
"Type": "Static",
10+
"Resource": {"CIDR": ""}
11+
},
12+
13+
"Interaction": { "ScreenType": "SimplePrompt" },
14+
"Resolution": { "Path": "CIDR", "Key": "CIDR" },
15+
"NextStage": { "Type": "Name", "Name": "SelectTenancy" }
16+
},
17+
{
18+
"Name": "SelectTenancy",
19+
"Prompt": "Should this VPC use the default tenancy or force dedicated?",
20+
"Retrieval": {
21+
"Type": "Static",
22+
"Resource": [ "default", "dedicated"]
23+
},
24+
"Interaction": { "ScreenType": "SimpleSelect" },
25+
"Resolution": { "Key": "Tenancy" },
26+
"NextStage": { "Type": "Name", "Name": "CreateVPC" }
27+
},
28+
{
29+
"Name": "CreateVPC",
30+
"Prompt": "Creating VPC...",
31+
32+
"Retrieval": {
33+
"Type": "Request",
34+
"Resource": {
35+
"Service": "ec2",
36+
"Operation": "CreateVpc",
37+
"Parameters": { "DryRun": false },
38+
"EnvParameters": {
39+
"CidrBlock": "CIDR",
40+
"InstanceTenancy": "Tenancy"
41+
}
42+
}
43+
}
44+
}
45+
]
46+
}

0 commit comments

Comments
 (0)