Skip to content

Commit f286f55

Browse files
feat: Update registrations to use new database access security group
Co-authored-by: Julia <JuliaBrigitte@users.noreply.github.com>
1 parent 77b3655 commit f286f55

File tree

3 files changed

+27
-14
lines changed

3 files changed

+27
-14
lines changed

cdk/lib/__snapshots__/registration.test.ts.snap

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
6464
"Description": "ACM Certificate for app use",
6565
"Type": "String",
6666
},
67+
"DatabaseAccessSecurityGroup": {
68+
"AllowedValues": [
69+
"/CODE/mobile-notifications/registrations-db/postgres-access-security-group",
70+
"/PROD/mobile-notifications/registrations-db/postgres-access-security-group",
71+
],
72+
"Description": "The security group that allows access to the database",
73+
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::SecurityGroup::Id>",
74+
},
6775
"DistBucket": {
6876
"Description": "The name of the s3 bucket containing the server artifact",
6977
"Type": "String",
@@ -112,10 +120,6 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
112120
"Description": "Environment name",
113121
"Type": "String",
114122
},
115-
"VPCSecurityGroup": {
116-
"Description": "The default security group of the VPC",
117-
"Type": "AWS::EC2::SecurityGroup::Id",
118-
},
119123
"VpcId": {
120124
"Description": "The VPC",
121125
"Type": "AWS::EC2::VPC::Id",
@@ -795,7 +799,7 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
795799
"Ref": "InstanceSecurityGroup",
796800
},
797801
{
798-
"Ref": "VPCSecurityGroup",
802+
"Ref": "DatabaseAccessSecurityGroup",
799803
},
800804
],
801805
"UserData": {
@@ -917,6 +921,14 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
917921
"Description": "ACM Certificate for app use",
918922
"Type": "String",
919923
},
924+
"DatabaseAccessSecurityGroup": {
925+
"AllowedValues": [
926+
"/CODE/mobile-notifications/registrations-db/postgres-access-security-group",
927+
"/PROD/mobile-notifications/registrations-db/postgres-access-security-group",
928+
],
929+
"Description": "The security group that allows access to the database",
930+
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::SecurityGroup::Id>",
931+
},
920932
"DistBucket": {
921933
"Description": "The name of the s3 bucket containing the server artifact",
922934
"Type": "String",
@@ -965,10 +977,6 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
965977
"Description": "Environment name",
966978
"Type": "String",
967979
},
968-
"VPCSecurityGroup": {
969-
"Description": "The default security group of the VPC",
970-
"Type": "AWS::EC2::SecurityGroup::Id",
971-
},
972980
"VpcId": {
973981
"Description": "The VPC",
974982
"Type": "AWS::EC2::VPC::Id",
@@ -1648,7 +1656,7 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
16481656
"Ref": "InstanceSecurityGroup",
16491657
},
16501658
{
1651-
"Ref": "VPCSecurityGroup",
1659+
"Ref": "DatabaseAccessSecurityGroup",
16521660
},
16531661
],
16541662
"UserData": {

registration/conf/registration.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ Parameters:
3838
- CODE
3939
- PROD
4040
Description: Environment name
41-
VPCSecurityGroup:
42-
Type: AWS::EC2::SecurityGroup::Id
43-
Description: The default security group of the VPC
41+
DatabaseAccessSecurityGroup:
42+
Type: AWS::SSM::Parameter::Value<AWS::EC2::SecurityGroup::Id>
43+
Description: The security group that allows access to the database
44+
AllowedValues:
45+
- /CODE/mobile-notifications/registrations-db/postgres-access-security-group
46+
- /PROD/mobile-notifications/registrations-db/postgres-access-security-group
4447
AlarmTopic:
4548
Type: String
4649
Description: The ARN of the SNS topic to send all the cloudwatch alarms to
@@ -291,7 +294,7 @@ Resources:
291294
InstanceType: !FindInMap [StageVariables, !Ref Stage, InstanceType]
292295
SecurityGroups:
293296
- !Ref InstanceSecurityGroup
294-
- !Ref VPCSecurityGroup
297+
- !Ref DatabaseAccessSecurityGroup
295298
MetadataOptions:
296299
HttpTokens: required
297300
UserData:

registration/conf/riff-raff.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ deployments:
1616
templateStageParameters:
1717
CODE:
1818
LoggingStreamName: /account/services/logging.stream.name.code
19+
DatabaseAccessSecurityGroup: /CODE/mobile-notifications/registrations-db/postgres-access-security-group
1920
PROD:
2021
LoggingStreamName: /account/services/logging.stream.name
22+
DatabaseAccessSecurityGroup: /PROD/mobile-notifications/registrations-db/postgres-access-security-group
2123
registration:
2224
type: autoscaling
2325
parameters:

0 commit comments

Comments
 (0)