forked from msangui/aws-cloudformation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-instance-with-parameters.template.json
67 lines (67 loc) · 1.56 KB
/
single-instance-with-parameters.template.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
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Launch single EC2 Instance",
"Resources": {
"MyInstance": {
"Type": "AWS::EC2::Instance",
"Properties": {
"AvailabilityZone": "us-east-1a",
"InstanceType": {"Ref": "InstanceType"},
"ImageId": "ami-0baf67670ca0f3719",
"SecurityGroups": [
{
"Ref": "MySG"
}
],
"KeyName": {"Ref": "KeyName"},
"Tags": [
{
"Key": "Name",
"Value": "Test Instance"
}
]
}
},
"MySG": {
"Type": "AWS::EC2::SecurityGroup",
"Properties": {
"GroupDescription": "Enable HTTP & SSH access",
"SecurityGroupIngress": [
{
"IpProtocol": "tcp",
"FromPort": "22",
"ToPort": "22",
"CidrIp": "0.0.0.0/0"
},
{
"IpProtocol": "tcp",
"FromPort": "80",
"ToPort": "80",
"CidrIp": "0.0.0.0/0"
}
]
}
}
},
"Parameters": {
"KeyName": {
"Description": "Existing KeyPair",
"Type": "AWS::EC2::KeyPair::KeyName",
"ConstraintDescription": "Must be an existing key pair"
},
"InstanceType": {
"Description": "Instance Type",
"Type": "String",
"Default": "t2.micro",
"AllowedValues": [
"t1.micro",
"t2.nano",
"t2.micro",
"t2.small",
"t2.medium",
"t2.large"
],
"ConstraintDescription": "valid instance type"
}
}
}