Skip to content

Commit e9f2f08

Browse files
authored
Merge branch 'theonestack:master' into master
2 parents 76de3bb + 1ee1607 commit e9f2f08

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

aurora-postgres.cfndsl.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Condition("EnableReader", FnEquals(Ref("EnableReader"), 'true'))
44
Condition("UseUsernameAndPassword", FnEquals(Ref(:SnapshotID), ''))
55
Condition("UseSnapshotID", FnNot(FnEquals(Ref(:SnapshotID), '')))
6+
Condition("CreateHostRecord", FnNot(FnEquals(Ref(:DnsDomain), '')))
7+
Condition("CreateReaderRecord", FnAnd([FnEquals(Ref("EnableReader"), 'true'), Condition('CreateHostRecord')]))
68

79
aurora_tags = []
810
aurora_tags << { Key: 'Name', Value: FnSub("${EnvironmentName}-#{component_name}") }
@@ -90,6 +92,8 @@
9092
DBClusterIdentifier Ref(:DBCluster)
9193
Engine 'aurora-postgresql'
9294
EngineVersion engine_version if defined? engine_version
95+
AutoMinorVersionUpgrade minor_upgrade if defined? minor_upgrade
96+
PreferredMaintenanceWindow maint_window if defined? maint_window
9397
PubliclyAccessible 'false'
9498
DBInstanceClass Ref(:WriterInstanceType)
9599
Tags aurora_tags
@@ -108,7 +112,7 @@
108112
}
109113

110114
Route53_RecordSet(:DBClusterReaderRecord) {
111-
Condition(:EnableReader)
115+
Condition(:CreateReaderRecord)
112116
HostedZoneName FnJoin('', [ Ref('EnvironmentName'), '.', Ref('DnsDomain'), '.'])
113117
Name FnJoin('', [ hostname_read_endpoint, '.', Ref('EnvironmentName'), '.', Ref('DnsDomain'), '.' ])
114118
Type 'CNAME'
@@ -117,6 +121,7 @@
117121
}
118122

119123
Route53_RecordSet(:DBHostRecord) {
124+
Condition(:CreateHostRecord)
120125
HostedZoneName FnJoin('', [ Ref('EnvironmentName'), '.', Ref('DnsDomain'), '.'])
121126
Name FnJoin('', [ hostname, '.', Ref('EnvironmentName'), '.', Ref('DnsDomain'), '.' ])
122127
Type 'CNAME'

0 commit comments

Comments
 (0)