-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdiscourse-resources.template
120 lines (120 loc) · 3.92 KB
/
discourse-resources.template
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
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"discourseNameParam": {
"Type": "String",
"Default": "discourse",
"Description": "Enter a name for this Discourse instance. eg guides, fantheflames"
},
"discourseEnvParam": {
"Type": "String",
"Default": "production",
"AllowedValues": [
"staging",
"production"
],
"Description": "Enter env staging or production"
}
},
"Conditions" : {
"checkEnv" : {"Fn::Equals": ["production", {"Ref": "discourseEnvParam"}]}
},
"Resources": {
"lb" : {
"Type" : "AWS::ElasticLoadBalancing::LoadBalancer",
"Properties" : {
"Subnets": ["subnet-771cff2e", "subnet-8ca2a1a4", "subnet-df27e6a8"],
"SecurityGroups": ["sg-5798df32"],
"LoadBalancerName": {
"Fn::Join": [
"-",
[
"csa",
{
"Ref": "discourseNameParam"
},
{
"Ref": "discourseEnvParam"
}
]
]
},
"Listeners" : [ {
"LoadBalancerPort" : "80",
"InstancePort" : "8081",
"Protocol" : "HTTP"
} ],
"HealthCheck" : {
"Target" : {
"Fn::Join" : [ "", [ "HTTP:", "8080", "/" ] ]
},
"HealthyThreshold" : "2",
"UnhealthyThreshold" : "5",
"Interval" : "30",
"Timeout" : "5"
},
"Tags": [
{
"Key": "app",
"Value": "megadiscourse"
},
{
"Key": "env",
"Value": {
"Ref": "discourseEnvParam"
}
},
{
"Key": "project",
"Value": "communityit"
}
]
}
},
"cache": {
"Type": "AWS::ElastiCache::CacheCluster",
"Properties": {
"ClusterName": {
"Fn::Join": [
"-",
[
"csa",
{
"Ref": "discourseNameParam"
},
{
"Ref": "discourseEnvParam"
}
]
]
},
"AutoMinorVersionUpgrade": "true",
"CacheNodeType": "cache.t1.micro",
"Engine": "redis",
"EngineVersion": "2.8.21",
"NumCacheNodes": "1",
"PreferredAvailabilityZone": "us-east-1d",
"PreferredMaintenanceWindow": "fri:04:00-fri:05:00",
"CacheSubnetGroupName": "csa-discourse-production-cache",
"VpcSecurityGroupIds": [
"sg-c36523a6"
]
}
}
},
"Outputs" : {
"dbHost" : {
"Value" : {"Fn::If" : [
"checkEnv",
"discourse-shared-db.mofoprod.net",
"discourse-shared-db.mofostaging.net"
]},
"Description" : "You need to make the database yourself on this server. Use this value for DISCOURSE_DB_HOST."
},
"lbDNSName" : {
"Value" : {"Fn::GetAtt": ["lb", "DNSName" ] },
"Description" : "This is the DNS name for the load balancer. On your domain name DNS settings, make a CNAME record using this name."
}
},
"Description": "Discourse resources"
}