@@ -12,59 +12,57 @@ Parameters:
12
12
postgreswebDBName :
13
13
Type : String
14
14
Description : The name of the initial database to be created in the Aurora Serverless v2 cluster.
15
- Default : django
15
+ Default : postgres
16
16
# Cannot have special characters
17
17
# Naming constraints: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.Constraints
18
18
Mappings :
19
19
postgreswebEnvScalingConfigurationMap :
20
20
dev :
21
21
" DBMinCapacity " : 0.5 # AllowedValues: from 0.5 through 128
22
- " DBMaxCapacity " : 8 # AllowedValues: from 0.5 through 128
22
+ " DBMaxCapacity " : 8 # AllowedValues: from 0.5 through 128
23
23
24
24
All :
25
25
" DBMinCapacity " : 0.5 # AllowedValues: from 0.5 through 128
26
- " DBMaxCapacity " : 8 # AllowedValues: from 0.5 through 128
26
+ " DBMaxCapacity " : 8 # AllowedValues: from 0.5 through 128
27
27
28
28
Resources :
29
29
postgreswebDBSubnetGroup :
30
- Type : ' AWS::RDS::DBSubnetGroup'
30
+ Type : " AWS::RDS::DBSubnetGroup"
31
31
Properties :
32
32
DBSubnetGroupDescription : Group of Copilot private subnets for Aurora Serverless v2 cluster.
33
33
SubnetIds :
34
- !Split [',' , { ' Fn::ImportValue' : !Sub ' ${App}-${Env}-PrivateSubnets' }]
34
+ !Split ["," , { " Fn::ImportValue" : !Sub " ${App}-${Env}-PrivateSubnets" }]
35
35
postgreswebSecurityGroup :
36
36
Metadata :
37
- ' aws:copilot:description ' : ' A security group for your workload to access the Aurora Serverless v2 cluster postgresweb'
38
- Type : ' AWS::EC2::SecurityGroup'
37
+ " aws:copilot:description " : " A security group for your workload to access the Aurora Serverless v2 cluster postgresweb"
38
+ Type : " AWS::EC2::SecurityGroup"
39
39
Properties :
40
- GroupDescription : !Sub ' The Security Group for ${Name} to access Aurora Serverless v2 cluster postgresweb.'
40
+ GroupDescription : !Sub " The Security Group for ${Name} to access Aurora Serverless v2 cluster postgresweb."
41
41
VpcId :
42
- Fn::ImportValue :
43
- !Sub '${App}-${Env}-VpcId'
42
+ Fn::ImportValue : !Sub "${App}-${Env}-VpcId"
44
43
Tags :
45
44
- Key : Name
46
- Value : !Sub ' copilot-${App}-${Env}-${Name}-Aurora'
45
+ Value : !Sub " copilot-${App}-${Env}-${Name}-Aurora"
47
46
postgreswebDBClusterSecurityGroup :
48
47
Metadata :
49
- ' aws:copilot:description ' : ' A security group for your Aurora Serverless v2 cluster postgresweb'
48
+ " aws:copilot:description " : " A security group for your Aurora Serverless v2 cluster postgresweb"
50
49
Type : AWS::EC2::SecurityGroup
51
50
Properties :
52
51
GroupDescription : The Security Group for the Aurora Serverless v2 cluster.
53
52
SecurityGroupIngress :
54
53
- ToPort : 5432
55
54
FromPort : 5432
56
55
IpProtocol : tcp
57
- Description : !Sub ' From the Aurora Security Group of the workload ${Name}.'
56
+ Description : !Sub " From the Aurora Security Group of the workload ${Name}."
58
57
SourceSecurityGroupId : !Ref postgreswebSecurityGroup
59
58
VpcId :
60
- Fn::ImportValue :
61
- !Sub '${App}-${Env}-VpcId'
59
+ Fn::ImportValue : !Sub "${App}-${Env}-VpcId"
62
60
Tags :
63
61
- Key : Name
64
- Value : !Sub ' copilot-${App}-${Env}-${Name}-Aurora'
62
+ Value : !Sub " copilot-${App}-${Env}-${Name}-Aurora"
65
63
postgreswebAuroraSecret :
66
64
Metadata :
67
- ' aws:copilot:description ' : ' A Secrets Manager secret to store your DB credentials'
65
+ " aws:copilot:description " : " A Secrets Manager secret to store your DB credentials"
68
66
Type : AWS::SecretsManager::Secret
69
67
Properties :
70
68
Description : !Sub Aurora main user secret for ${AWS::StackName}
@@ -76,42 +74,59 @@ Resources:
76
74
PasswordLength : 16
77
75
postgreswebDBClusterParameterGroup :
78
76
Metadata :
79
- ' aws:copilot:description ' : ' A DB parameter group for engine configuration values'
80
- Type : ' AWS::RDS::DBClusterParameterGroup'
77
+ " aws:copilot:description " : " A DB parameter group for engine configuration values"
78
+ Type : " AWS::RDS::DBClusterParameterGroup"
81
79
Properties :
82
- Description : !Ref ' AWS::StackName'
83
- Family : ' aurora-postgresql16'
80
+ Description : !Ref " AWS::StackName"
81
+ Family : " aurora-postgresql16"
84
82
Parameters :
85
- client_encoding : ' UTF8'
83
+ client_encoding : " UTF8"
86
84
postgreswebDBCluster :
87
85
Metadata :
88
- ' aws:copilot:description ' : ' The postgresweb Aurora Serverless v2 database cluster'
89
- Type : ' AWS::RDS::DBCluster'
86
+ " aws:copilot:description " : " The postgresweb Aurora Serverless v2 database cluster"
87
+ Type : " AWS::RDS::DBCluster"
90
88
Properties :
91
89
MasterUsername :
92
- !Join [ "", [ '{{resolve:secretsmanager:', !Ref postgreswebAuroraSecret, ":SecretString:username}}" ]]
90
+ !Join [
91
+ " " ,
92
+ [
93
+ " {{resolve:secretsmanager:" ,
94
+ !Ref postgreswebAuroraSecret,
95
+ " :SecretString:username}}" ,
96
+ ],
97
+ ]
93
98
MasterUserPassword :
94
- !Join [ "", [ '{{resolve:secretsmanager:', !Ref postgreswebAuroraSecret, ":SecretString:password}}" ]]
99
+ !Join [
100
+ " " ,
101
+ [
102
+ " {{resolve:secretsmanager:" ,
103
+ !Ref postgreswebAuroraSecret,
104
+ " :SecretString:password}}" ,
105
+ ],
106
+ ]
95
107
DatabaseName : !Ref postgreswebDBName
96
- Engine : ' aurora-postgresql'
97
- EngineVersion : ' 16.2'
108
+ Engine : " aurora-postgresql"
109
+ EngineVersion : " 16.2"
110
+ EnableHttpEndpoint : true # enable the Data API feature
98
111
DBClusterParameterGroupName : !Ref postgreswebDBClusterParameterGroup
99
112
DBSubnetGroupName : !Ref postgreswebDBSubnetGroup
100
113
Port : 5432
101
114
VpcSecurityGroupIds :
102
115
- !Ref postgreswebDBClusterSecurityGroup
103
116
ServerlessV2ScalingConfiguration :
104
117
# Replace "All" below with "!Ref Env" to set different autoscaling limits per environment.
105
- MinCapacity : !FindInMap [postgreswebEnvScalingConfigurationMap, All, DBMinCapacity]
106
- MaxCapacity : !FindInMap [postgreswebEnvScalingConfigurationMap, All, DBMaxCapacity]
118
+ MinCapacity :
119
+ !FindInMap [postgreswebEnvScalingConfigurationMap, All, DBMinCapacity]
120
+ MaxCapacity :
121
+ !FindInMap [postgreswebEnvScalingConfigurationMap, All, DBMaxCapacity]
107
122
postgreswebDBWriterInstance :
108
123
Metadata :
109
- ' aws:copilot:description ' : ' The postgresweb Aurora Serverless v2 writer instance'
110
- Type : ' AWS::RDS::DBInstance'
124
+ " aws:copilot:description " : " The postgresweb Aurora Serverless v2 writer instance"
125
+ Type : " AWS::RDS::DBInstance"
111
126
Properties :
112
127
DBClusterIdentifier : !Ref postgreswebDBCluster
113
128
DBInstanceClass : db.serverless
114
- Engine : ' aurora-postgresql'
129
+ Engine : " aurora-postgresql"
115
130
PromotionTier : 1
116
131
AvailabilityZone : !Select
117
132
- 0
0 commit comments