-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.json
86 lines (85 loc) · 2.66 KB
/
app.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
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description": "VPC cloudformation template",
"Outputs": {
"LoadBalancerDNSName": {
"Description" : "ELB DNS Name",
"Value": { "Fn::GetAtt" : [ "MyAppServerELB", "DNSName" ] }
}
},
"Parameters": {
"Stage": {
"Type": "String",
"AllowedValues" : [ "CODE", "PROD" ],
"Default" : "CODE"
},
"CidrA": {
"Type": "String"
},
"CidrB": {
"Type": "String"
},
"CidrC": {
"Type": "String"
},
"SubnetA": {
"Type": "String"
},
"SubnetB": {
"Type": "String"
},
"SubnetC": {
"Type": "String"
},
"DefaultSecGroup": {
"Type": "String"
},
"AppPort": {
"Type": "Number"
},
"InstanceType": {
"Type": "String",
"Default": "m1.small"
},
},
"Resources": {
"MyAppServerELB" : {
"Type": "AWS::ElasticLoadBalancing::LoadBalancer",
"Properties": {
"AvailabilityZones" : { "Fn::GetAZs" : ""},
}
},
"MyAppServerSecurityGroup" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "Monkey",
"SecurityGroupIngress" : [
{
"IpProtocol" : "tcp",
"FromPort" : { "Ref": "AppPort" },
"ToPort" : { "Ref": "AppPort" },
"SourceSecurityGroupOwnerId" : {"Fn::GetAtt" : ["MyAppServerELB", "SourceSecurityGroup.OwnerAlias"]},
"SourceSecurityGroupName" : {"Fn::GetAtt" : ["MyAppServerELB", "SourceSecurityGroup.GroupName"]}
} ]
}
},
"MyAppServerLaunchConfig" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Properties" : {
"ImageId" : "ami-6411e20d",
"SecurityGroups" : [ { "Ref" : "MyAppServerSecurityGroup" }, { "Ref": "DefaultSecGroup" } ],
"InstanceType" : { "Ref": "InstanceType" }
}
},
"MyAppServerGroup" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"AvailabilityZones" : { "Fn::GetAZs" : ""},
"LaunchConfigurationName" : { "Ref" : "MyAppServerLaunchConfig" },
"MinSize" : "1",
"MaxSize" : "3",
"LoadBalancerNames" : [ { "Ref" : "MyAppServerELB" } ]
}
}
}
}