forked from plus3it/amigen7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathValidationCoordination.tmplt.json
161 lines (161 loc) · 4.78 KB
/
ValidationCoordination.tmplt.json
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "This template coordinates the running of the validation IAM and EC2 templates to fully automate a validation-run.",
"Parameters": {
"AmiId": {
"Description": "ID of the AMI to launch",
"ConstraintDescription": "All ID's must start 'ami-' followed by an 8- to 17-character alphanumeric string.",
"Type": "String",
"AllowedPattern": "^ami-[0-9a-z]{8}$|^ami-[0-9a-z]{17}$"
},
"AmiDistro": {
"Description": "Linux distro of the AMI",
"Type": "String",
"Default": "CentOS",
"AllowedValues": [
"CentOS",
"RedHat"
]
},
"CfnEndpointUrl": {
"Description": "URL to the CloudFormation Endpoint. e.g. https://cloudformation.us-east-1.amazonaws.com",
"Type": "String",
"Default": "",
"AllowedPattern": "^$|^http://.*$|^https://.*$"
},
"InstanceType": {
"Description": "Amazon EC2 instance type",
"Type": "String",
"Default": "m4.large",
"AllowedValues": [
"t2.micro",
"t2.small",
"t2.medium",
"t2.large",
"c4.large",
"m4.large",
"r3.2xlarge"
]
},
"KeyPairName": {
"Description": "Public/private key pairs allow you to securely connect to your instance after it launches",
"Type": "AWS::EC2::KeyPair::KeyName"
},
"PrivIpOnly": {
"Description": "Controls whether to assign the instance a public IP. \"true\" means \"do not assign public IP address\"",
"Type": "String",
"Default": "false",
"AllowedValues": [
"false",
"true"
]
},
"RootVolumeSize": {
"Description": "Size in GB of the EBS volume to create. Ignored if \"AppVolumeDevice\" is blank",
"Type": "Number",
"Default": "25",
"MinValue": "5",
"MaxValue": "16384",
"ConstraintDescription": "Must be between 5GB and 16384GB."
},
"SecurityGroups": {
"Description": "List of security groups to apply to the instance(s)",
"Type": "List<AWS::EC2::SecurityGroup::Id>"
},
"SubnetId": {
"Description": "Subnet to associate to the Instance",
"Type": "AWS::EC2::Subnet::Id"
},
"TemplateUrlEc2": {
"Description": "URL of the child template for the validator EC2 instance.",
"Type": "String",
"AllowedPattern": "^$|^http://.*$|^https://.*$"
},
"TemplateUrlIam": {
"Description": "URL of the child template for the validator IAM objects.",
"Type": "String",
"AllowedPattern": "^$|^http://.*$|^https://.*$"
},
"ValidationBucket": {
"Description": "S3 Bucket to host automated instance-validation artifacts.",
"Type": "String",
"AllowedPattern": "^[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]*$"
}
},
"Metadata": {
"AWS::CloudFormation::Interface": {
"ParameterGroups": [
{
"Label": {
"default": "EC2 Instance Configuration"
},
"Parameters": [
"AmiId",
"AmiDistro",
"CfnEndpointUrl",
"InstanceType",
"KeyPairName",
"PrivIpOnly",
"RootVolumeSize",
"SecurityGroups",
"SubnetId",
"TemplateUrlEc2"
]
}
]
}
},
"Resources": {
"ValidatorIAM": {
"Type": "AWS::CloudFormation::Stack",
"Properties": {
"TemplateURL": { "Ref": "TemplateUrlIam" },
"Parameters": {
"ValidationBucket": { "Ref": "ValidationBucket" }
},
"TimeoutInMinutes": "10"
}
},
"ValidatorEC2": {
"Type": "AWS::CloudFormation::Stack",
"Properties": {
"TemplateURL": { "Ref": "TemplateUrlEc2" },
"Parameters": {
"AmiId": { "Ref": "AmiId" },
"AmiDistro": { "Ref": "AmiDistro" },
"InstanceRole" : {
"Fn::GetAtt" : [
"ValidatorIAM", "Outputs.InstanceRoleProfile"
]
},
"BucketName": { "Ref": "ValidationBucket" },
"CfnEndpointUrl": { "Ref": "CfnEndpointUrl" },
"KeyPairName": { "Ref": "KeyPairName" },
"InstanceType": { "Ref": "InstanceType"},
"NoPublicIp": { "Ref": "PrivIpOnly" },
"NoReboot": "true",
"SecurityGroupIds": {
"Fn::Join": [
",",
{ "Ref": "SecurityGroups" }
]
},
"SubnetIds": { "Ref": "SubnetId" },
"RootEBSsize": { "Ref": "RootVolumeSize" }
},
"TimeoutInMinutes": "10"
},
"DependsOn" : "ValidatorIAM"
}
},
"Outputs": {
"StackRef": {
"Value": {
"Ref": "ValidatorIAM"
}
},
"OutputFromNestedStack": {
"Value": { "Fn::GetAtt": [ "ValidatorIAM", "Outputs.InstanceRole" ] }
}
}
}