|
3 | 3 | Condition("EnableReader", FnEquals(Ref("EnableReader"), 'true'))
|
4 | 4 | Condition("UseUsernameAndPassword", FnEquals(Ref(:SnapshotID), ''))
|
5 | 5 | Condition("UseSnapshotID", FnNot(FnEquals(Ref(:SnapshotID), '')))
|
| 6 | + Condition("CreateHostRecord", FnNot(FnEquals(Ref(:DnsDomain), ''))) |
| 7 | + Condition("CreateReaderRecord", FnAnd([FnEquals(Ref("EnableReader"), 'true'), Condition('CreateHostRecord')])) |
6 | 8 |
|
7 | 9 | aurora_tags = []
|
8 | 10 | aurora_tags << { Key: 'Name', Value: FnSub("${EnvironmentName}-#{component_name}") }
|
|
90 | 92 | DBClusterIdentifier Ref(:DBCluster)
|
91 | 93 | Engine 'aurora-postgresql'
|
92 | 94 | EngineVersion engine_version if defined? engine_version
|
| 95 | + AutoMinorVersionUpgrade minor_upgrade if defined? minor_upgrade |
| 96 | + PreferredMaintenanceWindow maint_window if defined? maint_window |
93 | 97 | PubliclyAccessible 'false'
|
94 | 98 | DBInstanceClass Ref(:WriterInstanceType)
|
95 | 99 | Tags aurora_tags
|
|
108 | 112 | }
|
109 | 113 |
|
110 | 114 | Route53_RecordSet(:DBClusterReaderRecord) {
|
111 |
| - Condition(:EnableReader) |
| 115 | + Condition(:CreateReaderRecord) |
112 | 116 | HostedZoneName FnJoin('', [ Ref('EnvironmentName'), '.', Ref('DnsDomain'), '.'])
|
113 | 117 | Name FnJoin('', [ hostname_read_endpoint, '.', Ref('EnvironmentName'), '.', Ref('DnsDomain'), '.' ])
|
114 | 118 | Type 'CNAME'
|
|
117 | 121 | }
|
118 | 122 |
|
119 | 123 | Route53_RecordSet(:DBHostRecord) {
|
| 124 | + Condition(:CreateHostRecord) |
120 | 125 | HostedZoneName FnJoin('', [ Ref('EnvironmentName'), '.', Ref('DnsDomain'), '.'])
|
121 | 126 | Name FnJoin('', [ hostname, '.', Ref('EnvironmentName'), '.', Ref('DnsDomain'), '.' ])
|
122 | 127 | Type 'CNAME'
|
|
0 commit comments