Skip to content

Commit a679a95

Browse files
committed
[harvester] Use dedicated security group for accessing Postgres
1 parent bbd09cc commit a679a95

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

notificationworkerlambda/harvester-cfn.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ Parameters:
3232
VpcSubnets:
3333
Description: Subnets to use in the VPC
3434
Type: List<AWS::EC2::Subnet::Id>
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
AlarmTopic:
3642
Type: String
3743
Description: The ARN of the SNS topic to send all the cloudwatch alarms to
@@ -166,7 +172,7 @@ Resources:
166172
ReservedConcurrentExecutions: 200
167173
VpcConfig:
168174
SecurityGroupIds:
169-
- !ImportValue NotificationsDefaultSecurityGroup-NotificationsMainSecurityGroup
175+
!Ref DbAccessSecurityGroup
170176
SubnetIds: !Ref VpcSubnets
171177
Tags:
172178
- Key: Stage

notificationworkerlambda/riff-raff.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ deployments:
1010
- mobile-notifications-workers-cfn
1111
parameters:
1212
templatePath: harvester-cfn.yaml
13+
templateStageParameters:
14+
CODE:
15+
DbAccessSecurityGroup: /CODE/mobile-notifications/registrations-db/postgres-access-security-group
16+
PROD:
17+
DbAccessSecurityGroup: /PROD/mobile-notifications/registrations-db/postgres-access-security-group
1318
mobile-notifications-workers-cfn:
1419
type: cloud-formation
1520
app: n10n-workers

0 commit comments

Comments
 (0)