From cfb120f9df6d486684147cc78e7d1dc19f3a28c7 Mon Sep 17 00:00:00 2001 From: Michael McNamara Date: Thu, 11 Apr 2024 15:31:53 +0100 Subject: [PATCH 1/3] Add a domain name to be used in Fastly disaster recovery testing - this will be removed once testing is complete --- .../__snapshots__/cdk-playground.test.ts.snap | 18 ++++++++++++++++++ cdk/lib/cdk-playground.ts | 13 +++++++++++++ 2 files changed, 31 insertions(+) diff --git a/cdk/lib/__snapshots__/cdk-playground.test.ts.snap b/cdk/lib/__snapshots__/cdk-playground.test.ts.snap index 90bcf126..e4b9dcae 100644 --- a/cdk/lib/__snapshots__/cdk-playground.test.ts.snap +++ b/cdk/lib/__snapshots__/cdk-playground.test.ts.snap @@ -24,6 +24,7 @@ Object { "GuApplicationTargetGroup", "GuHttpsApplicationListener", "GuCname", + "GuCname", "GuApiLambda", "GuCertificate", "GuCname", @@ -275,6 +276,23 @@ Object { }, "Type": "Guardian::DNS::RecordSet", }, + "FastlyDRTestDNS": Object { + "Properties": Object { + "Name": "cdk-status-resources.guim.co.uk", + "RecordType": "CNAME", + "ResourceRecords": Array [ + Object { + "Fn::GetAtt": Array [ + "LoadBalancerCdkplayground7C6B4D97", + "DNSName", + ], + }, + ], + "Stage": "PROD", + "TTL": 3600, + }, + "Type": "Guardian::DNS::RecordSet", + }, "GetDistributablePolicyCdkplaygroundBFB4D02B": Object { "Properties": Object { "PolicyDocument": Object { diff --git a/cdk/lib/cdk-playground.ts b/cdk/lib/cdk-playground.ts index 1b7c2449..bfad9c7b 100644 --- a/cdk/lib/cdk-playground.ts +++ b/cdk/lib/cdk-playground.ts @@ -24,6 +24,9 @@ export class CdkPlayground extends GuStack { const ec2App = 'cdk-playground'; const ec2AppDomainName = 'cdk-playground.gutools.co.uk'; + //New domain added for Fastly disaster recovery testing. Will be deleted after this testing is complete + //todo - delete fastlyTestDomainName once the Fastly disaster recovery testing is complete. + const fastlyDRTestDomainName = 'cdk-status-resources.guim.co.uk'; const { loadBalancer } = new GuPlayApp(this, { app: ec2App, @@ -50,6 +53,16 @@ export class CdkPlayground extends GuStack { imageRecipe: 'developerPlayground-arm64-java11', }); + // This is a temporary domain name for use in some ongoing Fastly Disaster Recovery testing + // It will be removed after this testing is complete + // todo - remove this Cname after Fastly disaster recovery testing is complete + new GuCname(this, 'FastlyDRTestDNS', { + app: ec2App, + ttl: Duration.hours(1), + domainName: fastlyDRTestDomainName, + resourceRecord: loadBalancer.loadBalancerDnsName, + }); + new GuCname(this, 'EC2AppDNS', { app: ec2App, ttl: Duration.hours(1), From 97535fe2e2a6e0450a085a57395a8212db6e073d Mon Sep 17 00:00:00 2001 From: Michael McNamara Date: Thu, 11 Apr 2024 15:52:05 +0100 Subject: [PATCH 2/3] use guardianapis for the test domain as it better suits the output --- cdk/lib/__snapshots__/cdk-playground.test.ts.snap | 2 +- cdk/lib/cdk-playground.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cdk/lib/__snapshots__/cdk-playground.test.ts.snap b/cdk/lib/__snapshots__/cdk-playground.test.ts.snap index e4b9dcae..25c85e30 100644 --- a/cdk/lib/__snapshots__/cdk-playground.test.ts.snap +++ b/cdk/lib/__snapshots__/cdk-playground.test.ts.snap @@ -278,7 +278,7 @@ Object { }, "FastlyDRTestDNS": Object { "Properties": Object { - "Name": "cdk-status-resources.guim.co.uk", + "Name": "cdk-status-resources.guardianapis.com", "RecordType": "CNAME", "ResourceRecords": Array [ Object { diff --git a/cdk/lib/cdk-playground.ts b/cdk/lib/cdk-playground.ts index bfad9c7b..92d27535 100644 --- a/cdk/lib/cdk-playground.ts +++ b/cdk/lib/cdk-playground.ts @@ -26,7 +26,7 @@ export class CdkPlayground extends GuStack { const ec2AppDomainName = 'cdk-playground.gutools.co.uk'; //New domain added for Fastly disaster recovery testing. Will be deleted after this testing is complete //todo - delete fastlyTestDomainName once the Fastly disaster recovery testing is complete. - const fastlyDRTestDomainName = 'cdk-status-resources.guim.co.uk'; + const fastlyDRTestDomainName = 'cdk-status-resources.guardianapis.com'; const { loadBalancer } = new GuPlayApp(this, { app: ec2App, From ace3c9b088ed031cd400f19f9d40e38cab4b91c5 Mon Sep 17 00:00:00 2001 From: Michael McNamara Date: Thu, 11 Apr 2024 16:00:34 +0100 Subject: [PATCH 3/3] change FastlyDRTestDNS to point at dualstack.guardian.map.fastly.net --- cdk/lib/__snapshots__/cdk-playground.test.ts.snap | 7 +------ cdk/lib/cdk-playground.ts | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/cdk/lib/__snapshots__/cdk-playground.test.ts.snap b/cdk/lib/__snapshots__/cdk-playground.test.ts.snap index 25c85e30..157665cd 100644 --- a/cdk/lib/__snapshots__/cdk-playground.test.ts.snap +++ b/cdk/lib/__snapshots__/cdk-playground.test.ts.snap @@ -281,12 +281,7 @@ Object { "Name": "cdk-status-resources.guardianapis.com", "RecordType": "CNAME", "ResourceRecords": Array [ - Object { - "Fn::GetAtt": Array [ - "LoadBalancerCdkplayground7C6B4D97", - "DNSName", - ], - }, + "dualstack.guardian.map.fastly.net", ], "Stage": "PROD", "TTL": 3600, diff --git a/cdk/lib/cdk-playground.ts b/cdk/lib/cdk-playground.ts index 92d27535..69443570 100644 --- a/cdk/lib/cdk-playground.ts +++ b/cdk/lib/cdk-playground.ts @@ -60,7 +60,7 @@ export class CdkPlayground extends GuStack { app: ec2App, ttl: Duration.hours(1), domainName: fastlyDRTestDomainName, - resourceRecord: loadBalancer.loadBalancerDnsName, + resourceRecord: 'dualstack.guardian.map.fastly.net', }); new GuCname(this, 'EC2AppDNS', {