Skip to content

Commit f2a88bd

Browse files
committed
changes to support aurora config
1 parent 4558b10 commit f2a88bd

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

aurora-postgres.cfhighlander.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
ComponentParam "SubnetPersistence#{az}"
2121
end
2222
ComponentParam 'SnapshotID'
23+
ComponentParam 'MasterUsername', 'master'
24+
ComponentParam 'MasterUserPassword', 'pa33w0rd'
25+
2326
ComponentParam 'EnableReader', 'false'
2427
ComponentParam 'VPCId', type: 'AWS::EC2::VPC::Id'
2528
end

aurora-postgres.cfndsl.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
Description "#{component_name} - #{component_version}"
44

55
Condition("EnableReader", FnEquals(Ref("EnableReader"), 'true'))
6+
Condition("UseUsernameAndPassword", FnEquals(Ref(:SnapshotID), ''))
7+
Condition("UseSnapshotID", FnNot(FnEquals(Ref(:SnapshotID), '')))
8+
69
az_conditions_resources('SubnetPersistence', maximum_availability_zones)
710

811
tags = []
@@ -26,7 +29,7 @@
2629

2730
RDS_DBClusterParameterGroup(:DBClusterParameterGroup) {
2831
Description FnJoin(' ', [ Ref(:EnvironmentName), component_name, 'cluster parameter group' ])
29-
Family 'aurora-postgresql'
32+
Family 'aurora-postgresql9.6'
3033
Parameters cluster_parameters if defined? cluster_parameters
3134
Tags tags + [{ Key: 'Name', Value: FnJoin('-', [ Ref(:EnvironmentName), component_name, 'cluster-parameter-group' ])}]
3235
}
@@ -35,8 +38,12 @@
3538
Engine 'aurora-postgresql'
3639
DBClusterParameterGroupName Ref(:DBClusterParameterGroup)
3740
SnapshotIdentifier Ref(:SnapshotID)
41+
SnapshotIdentifier FnIf('UseSnapshotID',Ref(:SnapshotID), Ref('AWS::NoValue'))
42+
MasterUsername FnIf('UseUsernameAndPassword',Ref(:MasterUsername), Ref('AWS::NoValue'))
43+
MasterUserPassword FnIf('UseUsernameAndPassword',Ref(:MasterUserPassword), Ref('AWS::NoValue'))
3844
DBSubnetGroupName Ref(:DBClusterSubnetGroup)
3945
VpcSecurityGroupIds [ Ref(:SecurityGroup) ]
46+
Port cluster_port
4047
Tags tags + [{ Key: 'Name', Value: FnJoin('-', [ Ref(:EnvironmentName), component_name, 'cluster' ])}]
4148
}
4249

aurora-postgres.config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
maximum_availability_zones: 5
22
hostname: aurora2pg
33

4+
cluster_port: 5432
5+
46
# cluster_parameters:
57

68
# instance_parameters:

0 commit comments

Comments
 (0)