Skip to content

Commit 1e04edc

Browse files
authored
Merge pull request #20 from cfln123/feature/global-db
Add global db support
2 parents 3d185cd + 7ff022b commit 1e04edc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

aurora-postgres.cfhighlander.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
ComponentParam 'VPCId', type: 'AWS::EC2::VPC::Id'
1313
ComponentParam 'SubnetIds', type: 'CommaDelimitedList'
1414
ComponentParam 'KmsKeyId' if (defined? kms) && (kms)
15+
ComponentParam 'GlobalClusterIdentifier', ''
1516

1617
if defined?(engine_mode) && engine_mode == 'serverless'
1718
ComponentParam 'MaxCapacity', '2'

aurora-postgres.cfndsl.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
CloudFormation do
22

3-
Condition("UseUsernameAndPassword", FnEquals(Ref(:SnapshotID), ''))
43
Condition("UseSnapshotID", FnNot(FnEquals(Ref(:SnapshotID), '')))
54
Condition("CreateHostRecord", FnNot(FnEquals(Ref(:DnsDomain), '')))
5+
Condition("UseGlobalClusterIdentifier", FnNot(FnEquals(Ref(:GlobalClusterIdentifier), '')))
6+
Condition("UseUsernameAndPassword", FnAnd([FnEquals(Ref(:SnapshotID), ''), FnEquals(Ref(:GlobalClusterIdentifier), '')]))
67

78
aurora_tags = []
89
tags = external_parameters.fetch(:tags, {})
@@ -195,6 +196,7 @@
195196
Port external_parameters[:cluster_port]
196197
Tags aurora_tags
197198
AssociatedRoles cluster_roles if cluster_roles.any?
199+
GlobalClusterIdentifier FnIf('UseGlobalClusterIdentifier', Ref('GlobalClusterIdentifier'), Ref('AWS::NoValue'))
198200

199201
if engine_mode == 'serverless'
200202
EnableHttpEndpoint Ref(:EnableHttpEndpoint)

0 commit comments

Comments
 (0)