Skip to content

Commit 146259b

Browse files
committed
[registration-cleaning-worker] Use dedicated security group for accessing Postgres
1 parent 0e9f053 commit 146259b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

notificationworkerlambda/registration-cleaning-worker-cfn.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ Parameters:
3232
FullyQualifiedHandler:
3333
Description: The full name of the handler, including path, class name and method
3434
Type: String
35+
DbAccessSecurityGroup:
36+
Description: Security group which grants access to Postgres (the stage-specific parameter store name is injected by Riff-Raff)
37+
Type: AWS::SSM::Parameter::Value<AWS::EC2::SecurityGroup::Id>
38+
AllowedValues:
39+
- /CODE/mobile-notifications/registrations-db/postgres-access-security-group
40+
- /PROD/mobile-notifications/registrations-db/postgres-access-security-group
3541

3642
Resources:
3743

@@ -150,7 +156,7 @@ Resources:
150156
VpcConfig:
151157
SecurityGroupIds:
152158
- !GetAtt LambdaSecurityGroup.GroupId
153-
- !ImportValue NotificationsDefaultSecurityGroup-NotificationsMainSecurityGroup
159+
- !Ref DbAccessSecurityGroup
154160
SubnetIds: !Ref VpcSubnets
155161
Tags:
156162
- Key: Stage

notificationworkerlambda/riff-raff.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ deployments:
3737
prependStackToCloudFormationStackName: false
3838
cloudFormationStackName: registration-cleaning-worker-cfn
3939
templatePath: registration-cleaning-worker-cfn.yaml
40+
templateStageParameters:
41+
CODE:
42+
DbAccessSecurityGroup: /CODE/mobile-notifications/registrations-db/postgres-access-security-group
43+
PROD:
44+
DbAccessSecurityGroup: /PROD/mobile-notifications/registrations-db/postgres-access-security-group
4045
mobile-notifications-expired-registration-cleaner-cfn:
4146
type: cloud-formation
4247
app: expired-registration-cleaner

0 commit comments

Comments
 (0)