Skip to content

Commit a6125ab

Browse files
refactor: Rename CFN parameters to avoid GuCDK clash
The GuCDK pattern will add CFN parameters named `LoggingStreamName` and `VpcId`. CFN parameters must have a unique name, so rename the ones in the YAML template to avoid a clash. Co-authored-by: Julia <JuliaBrigitte@users.noreply.github.com>
1 parent 9439cfc commit a6125ab

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,19 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
8484
"Description": "The HostedZone, should contain the trailing dot zone.example.com.",
8585
"Type": "String",
8686
},
87-
"LoggingStreamName": {
87+
"LegacyLoggingStreamName": {
8888
"AllowedValues": [
8989
"/account/services/logging.stream.name.code",
9090
"/account/services/logging.stream.name",
9191
],
9292
"Description": "SSM parameter containing the Name (not ARN) on the kinesis stream",
9393
"Type": "AWS::SSM::Parameter::Value<String>",
9494
},
95+
"LegacyVpcId": {
96+
"Default": "/account/vpc/notifications/id",
97+
"Description": "The VPC",
98+
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::VPC::Id>",
99+
},
95100
"NotEnough200sPerDayThreshold": {
96101
"Description": "Alarm if less than too many 200s. This value was based on just below 2 standard deviations from the mean over 6 weeks of data.",
97102
"Type": "Number",
@@ -120,10 +125,6 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
120125
"Description": "Environment name",
121126
"Type": "String",
122127
},
123-
"VpcId": {
124-
"Description": "The VPC",
125-
"Type": "AWS::EC2::VPC::Id",
126-
},
127128
},
128129
"Resources": {
129130
"DistributionInstanceProfile": {
@@ -413,7 +414,7 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
413414
},
414415
],
415416
"VpcId": {
416-
"Ref": "VpcId",
417+
"Ref": "LegacyVpcId",
417418
},
418419
},
419420
"Type": "AWS::EC2::SecurityGroup",
@@ -460,7 +461,7 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
460461
},
461462
],
462463
"VpcId": {
463-
"Ref": "VpcId",
464+
"Ref": "LegacyVpcId",
464465
},
465466
},
466467
"Type": "AWS::EC2::SecurityGroup",
@@ -774,7 +775,7 @@ exports[`The Registration stack matches the snapshot for CODE 1`] = `
774775
"Key": "LogKinesisStreamName",
775776
"PropagateAtLaunch": true,
776777
"Value": {
777-
"Ref": "LoggingStreamName",
778+
"Ref": "LegacyLoggingStreamName",
778779
},
779780
},
780781
{
@@ -967,14 +968,19 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
967968
"Description": "The HostedZone, should contain the trailing dot zone.example.com.",
968969
"Type": "String",
969970
},
970-
"LoggingStreamName": {
971+
"LegacyLoggingStreamName": {
971972
"AllowedValues": [
972973
"/account/services/logging.stream.name.code",
973974
"/account/services/logging.stream.name",
974975
],
975976
"Description": "SSM parameter containing the Name (not ARN) on the kinesis stream",
976977
"Type": "AWS::SSM::Parameter::Value<String>",
977978
},
979+
"LegacyVpcId": {
980+
"Default": "/account/vpc/notifications/id",
981+
"Description": "The VPC",
982+
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::VPC::Id>",
983+
},
978984
"NotEnough200sPerDayThreshold": {
979985
"Description": "Alarm if less than too many 200s. This value was based on just below 2 standard deviations from the mean over 6 weeks of data.",
980986
"Type": "Number",
@@ -1003,10 +1009,6 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
10031009
"Description": "Environment name",
10041010
"Type": "String",
10051011
},
1006-
"VpcId": {
1007-
"Description": "The VPC",
1008-
"Type": "AWS::EC2::VPC::Id",
1009-
},
10101012
},
10111013
"Resources": {
10121014
"DistributionInstanceProfile": {
@@ -1296,7 +1298,7 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
12961298
},
12971299
],
12981300
"VpcId": {
1299-
"Ref": "VpcId",
1301+
"Ref": "LegacyVpcId",
13001302
},
13011303
},
13021304
"Type": "AWS::EC2::SecurityGroup",
@@ -1343,7 +1345,7 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
13431345
},
13441346
],
13451347
"VpcId": {
1346-
"Ref": "VpcId",
1348+
"Ref": "LegacyVpcId",
13471349
},
13481350
},
13491351
"Type": "AWS::EC2::SecurityGroup",
@@ -1657,7 +1659,7 @@ exports[`The Registration stack matches the snapshot for PROD 1`] = `
16571659
"Key": "LogKinesisStreamName",
16581660
"PropagateAtLaunch": true,
16591661
"Value": {
1660-
"Ref": "LoggingStreamName",
1662+
"Ref": "LegacyLoggingStreamName",
16611663
},
16621664
},
16631665
{

registration/conf/registration.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ Parameters:
4747
AlarmTopic:
4848
Type: String
4949
Description: The ARN of the SNS topic to send all the cloudwatch alarms to
50-
VpcId:
51-
Type: AWS::EC2::VPC::Id
50+
LegacyVpcId:
51+
Type: AWS::SSM::Parameter::Value<AWS::EC2::VPC::Id>
5252
Description: The VPC
53+
Default: /account/vpc/notifications/id
5354
PublicSubnets:
5455
Type: List<AWS::EC2::Subnet::Id>
5556
Description: The public subnets of the VPC for the loadbalancer
@@ -83,7 +84,7 @@ Parameters:
8384
RunbookCopy:
8485
Type: String
8586
Default: <<<Runbook|https://docs.google.com/document/d/1aJMytnPGeWH8YLpD2_66doxqyr8dPvAVonYIOG-zmOA>>>
86-
LoggingStreamName:
87+
LegacyLoggingStreamName:
8788
Type: AWS::SSM::Parameter::Value<String>
8889
Description: SSM parameter containing the Name (not ARN) on the kinesis stream
8990
AllowedValues:
@@ -195,7 +196,7 @@ Resources:
195196
IpProtocol: tcp
196197
SourceSecurityGroupId: !Ref LoadBalancerSecurityGroup
197198
ToPort: 9000
198-
VpcId: !Ref VpcId
199+
VpcId: !Ref LegacyVpcId
199200
LoadBalancerToPrivateASG:
200201
Type: AWS::ElasticLoadBalancing::LoadBalancer
201202
Properties:
@@ -228,7 +229,7 @@ Resources:
228229
FromPort: 443
229230
IpProtocol: tcp
230231
ToPort: 443
231-
VpcId: !Ref VpcId
232+
VpcId: !Ref LegacyVpcId
232233
LowCPUAlarm:
233234
Type: AWS::CloudWatch::Alarm
234235
Properties:
@@ -282,7 +283,7 @@ Resources:
282283
Value: registration.service
283284
PropagateAtLaunch: true
284285
- Key: LogKinesisStreamName
285-
Value: !Ref LoggingStreamName
286+
Value: !Ref LegacyLoggingStreamName
286287
PropagateAtLaunch: true
287288
VPCZoneIdentifier: !Ref PrivateSubnets
288289
RegistrationLaunchConfig:

registration/conf/riff-raff.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ deployments:
1515
PROD: Registration-PROD.template.json
1616
templateStageParameters:
1717
CODE:
18-
LoggingStreamName: /account/services/logging.stream.name.code
18+
LegacyLoggingStreamName: /account/services/logging.stream.name.code
1919
DatabaseAccessSecurityGroup: /CODE/mobile-notifications/registrations-db/postgres-access-security-group
2020
PROD:
21-
LoggingStreamName: /account/services/logging.stream.name
21+
LegacyLoggingStreamName: /account/services/logging.stream.name
2222
DatabaseAccessSecurityGroup: /PROD/mobile-notifications/registrations-db/postgres-access-security-group
2323
registration:
2424
type: autoscaling

0 commit comments

Comments
 (0)