-
Notifications
You must be signed in to change notification settings - Fork 45
/
bbb-on-aws-cachedb.template.yaml
98 lines (83 loc) · 2.98 KB
/
bbb-on-aws-cachedb.template.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Amazon ElastiCache template'
Parameters:
BBBNotificationTopic:
Description: Topic to be used for alarm notifications
Type: String
BBBCACHEDBInstanceType:
Description: Instance type for Amazon ElastiCache
Type: String
Default: cache.t4g.micro
AllowedPattern: ^(cache\.(t3|t4g|m6g|m7g|r6g|r7g)\.(micro|small|medium|large|xlarge|2xlarge|4xlarge|8xlarge|12xlarge|16xlarge))$
BBBDatastoreSubnets:
Description: Comma separated list of the datastore subnets
Type: CommaDelimitedList
BBBCACHEDBSecurityGroup:
Description: Security Group that should be assigned for cache database
Type: String
BBBCacheAZMode:
Description: ElastiCache Cache AZ Mode
Type: String
Default: single-az
AllowedValues:
- single-az
- cross-az
Mappings:
CacheSettings:
ElastiCache:
Engine: valkey
Version: '7.2'
Port: 6379
Family: valkey7
Conditions:
BBBIsCrossAZ: !Equals [!Ref BBBCacheAZMode, "cross-az"]
Resources:
BBBCacheSubnetGroup:
Type: AWS::ElastiCache::SubnetGroup
Properties:
Description: !Sub CacheSubnetGroup-${AWS::StackName}
SubnetIds: !Ref BBBDatastoreSubnets
BBBParametersGroup:
Type: AWS::ElastiCache::ParameterGroup
Properties:
CacheParameterGroupFamily: !FindInMap [CacheSettings, ElastiCache, Family]
Description: "ElastiCache parameter group with performance optimizations"
Properties:
tcp-keepalive: 60
timeout: 900
BBBElasticache:
Type: AWS::ElastiCache::ReplicationGroup
Properties:
ReplicationGroupId: !Sub 'bbb-${AWS::Region}-${AWS::AccountId}'
ReplicationGroupDescription: !Sub ${AWS::StackName} Cache Cluster
NumCacheClusters: 1
CacheNodeType: !Ref BBBCACHEDBInstanceType
CacheParameterGroupName: !Ref BBBParametersGroup
CacheSubnetGroupName: !Ref BBBCacheSubnetGroup
Engine: !FindInMap [CacheSettings, ElastiCache, Engine]
EngineVersion: !FindInMap [CacheSettings, ElastiCache, Version]
Port: !FindInMap [CacheSettings, ElastiCache, Port]
NotificationTopicArn: !Ref BBBNotificationTopic
SecurityGroupIds: [!Ref BBBCACHEDBSecurityGroup]
AutomaticFailoverEnabled: false
TransitEncryptionEnabled: false
MultiAZEnabled: !If
- BBBIsCrossAZ
- true
- false
Outputs:
BBBCacheDBAddress:
Description: The Big Blue Button Cache Database Address
Value: !GetAtt BBBElasticache.PrimaryEndPoint.Address
BBBCacheDBPort:
Description: The Big Blue Button Cache Database Port
Value: !GetAtt BBBElasticache.PrimaryEndPoint.Port
BBBElasticache:
Description: The Big Blue Button Cache ElastiCache Cluster
Value: !Ref BBBElasticache
BBBParametersGroup:
Description: The Big Blue Button Cache ElastiCache Parameter Group
Value: !Ref BBBParametersGroup
BBBCacheSubnetGroup:
Description: The Big Blue Button Cache ElastiCache Subnet Group
Value: !Ref BBBCacheSubnetGroup