Skip to content

Commit 4dcddeb

Browse files
committed
refactor(cdk): Remove CFN paramater logical ID rename
The `VpcId` parameter was renamed to `GuCdkVpcId` to avoid conflicts with the YAML template. The YAML template has been removed in #1606, so the rename is no longer needed.
1 parent 3d83e01 commit 4dcddeb

2 files changed

Lines changed: 22 additions & 28 deletions

File tree

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ exports[`The Report stack matches the snapshot for CODE 1`] = `
5959
"Description": "SSM parameter containing the S3 bucket name holding distribution artifacts",
6060
"Type": "AWS::SSM::Parameter::Value<String>",
6161
},
62-
"GuCdkVpcId": {
63-
"AllowedValues": [
64-
"/account/vpc/notifications/id",
65-
],
66-
"Default": "/account/vpc/notifications/id",
67-
"Description": "Virtual Private Cloud to run EC2 instances within. Should NOT be the account default VPC.",
68-
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::VPC::Id>",
69-
},
7062
"LoggingStreamName": {
7163
"AllowedValues": [
7264
"/account/services/logging.stream.name.code",
@@ -75,6 +67,14 @@ exports[`The Report stack matches the snapshot for CODE 1`] = `
7567
"Description": "SSM parameter containing the Name (not ARN) on the kinesis stream",
7668
"Type": "AWS::SSM::Parameter::Value<String>",
7769
},
70+
"VpcId": {
71+
"AllowedValues": [
72+
"/account/vpc/notifications/id",
73+
],
74+
"Default": "/account/vpc/notifications/id",
75+
"Description": "Virtual Private Cloud to run EC2 instances within. Should NOT be the account default VPC.",
76+
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::VPC::Id>",
77+
},
7878
"reportPrivateSubnets": {
7979
"AllowedValues": [
8080
"/account/vpc/notifications/subnets/private",
@@ -383,7 +383,7 @@ exports[`The Report stack matches the snapshot for CODE 1`] = `
383383
},
384384
],
385385
"VpcId": {
386-
"Ref": "GuCdkVpcId",
386+
"Ref": "VpcId",
387387
},
388388
},
389389
"Type": "AWS::EC2::SecurityGroup",
@@ -616,7 +616,7 @@ exports[`The Report stack matches the snapshot for CODE 1`] = `
616616
},
617617
],
618618
"VpcId": {
619-
"Ref": "GuCdkVpcId",
619+
"Ref": "VpcId",
620620
},
621621
},
622622
"Type": "AWS::EC2::SecurityGroup",
@@ -773,7 +773,7 @@ exports[`The Report stack matches the snapshot for CODE 1`] = `
773773
"TargetType": "instance",
774774
"UnhealthyThresholdCount": 10,
775775
"VpcId": {
776-
"Ref": "GuCdkVpcId",
776+
"Ref": "VpcId",
777777
},
778778
},
779779
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
@@ -997,14 +997,6 @@ exports[`The Report stack matches the snapshot for PROD 1`] = `
997997
"Description": "SSM parameter containing the S3 bucket name holding distribution artifacts",
998998
"Type": "AWS::SSM::Parameter::Value<String>",
999999
},
1000-
"GuCdkVpcId": {
1001-
"AllowedValues": [
1002-
"/account/vpc/notifications/id",
1003-
],
1004-
"Default": "/account/vpc/notifications/id",
1005-
"Description": "Virtual Private Cloud to run EC2 instances within. Should NOT be the account default VPC.",
1006-
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::VPC::Id>",
1007-
},
10081000
"LoggingStreamName": {
10091001
"AllowedValues": [
10101002
"/account/services/logging.stream.name",
@@ -1013,6 +1005,14 @@ exports[`The Report stack matches the snapshot for PROD 1`] = `
10131005
"Description": "SSM parameter containing the Name (not ARN) on the kinesis stream",
10141006
"Type": "AWS::SSM::Parameter::Value<String>",
10151007
},
1008+
"VpcId": {
1009+
"AllowedValues": [
1010+
"/account/vpc/notifications/id",
1011+
],
1012+
"Default": "/account/vpc/notifications/id",
1013+
"Description": "Virtual Private Cloud to run EC2 instances within. Should NOT be the account default VPC.",
1014+
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::VPC::Id>",
1015+
},
10161016
"reportPrivateSubnets": {
10171017
"AllowedValues": [
10181018
"/account/vpc/notifications/subnets/private",
@@ -1321,7 +1321,7 @@ exports[`The Report stack matches the snapshot for PROD 1`] = `
13211321
},
13221322
],
13231323
"VpcId": {
1324-
"Ref": "GuCdkVpcId",
1324+
"Ref": "VpcId",
13251325
},
13261326
},
13271327
"Type": "AWS::EC2::SecurityGroup",
@@ -1554,7 +1554,7 @@ exports[`The Report stack matches the snapshot for PROD 1`] = `
15541554
},
15551555
],
15561556
"VpcId": {
1557-
"Ref": "GuCdkVpcId",
1557+
"Ref": "VpcId",
15581558
},
15591559
},
15601560
"Type": "AWS::EC2::SecurityGroup",
@@ -1711,7 +1711,7 @@ exports[`The Report stack matches the snapshot for PROD 1`] = `
17111711
"TargetType": "instance",
17121712
"UnhealthyThresholdCount": 10,
17131713
"VpcId": {
1714-
"Ref": "GuCdkVpcId",
1714+
"Ref": "VpcId",
17151715
},
17161716
},
17171717
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",

cdk/lib/report.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { GuPlayApp } from '@guardian/cdk';
22
import { AccessScope } from '@guardian/cdk/lib/constants';
33
import type { GuStackProps } from '@guardian/cdk/lib/constructs/core';
4-
import { GuVpcParameter } from '@guardian/cdk/lib/constructs/core';
54
import { GuStack } from '@guardian/cdk/lib/constructs/core';
65
import { GuCname } from '@guardian/cdk/lib/constructs/dns';
76
import { GuAllowPolicy } from '@guardian/cdk/lib/constructs/iam';
@@ -85,11 +84,6 @@ export class Report extends GuStack {
8584
`/opt/aws-kinesis-agent/configure-aws-kinesis-agent ${this.region} mobile-log-aggregation-${this.stage} /var/log/${app}/application.log`,
8685
);
8786

88-
const vpcParameter = GuVpcParameter.getInstance(this);
89-
// This is necessary whilst dual-stacking because there is already a parameter called VpcId in the YAML template
90-
// Once the YAML template has been removed we should be able to drop this override
91-
vpcParameter.overrideLogicalId('GuCdkVpcId');
92-
9387
adjustCloudformationParameters(this);
9488

9589
new GuCname(this, 'DnsRecordForReport', {

0 commit comments

Comments
 (0)