Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,14 @@ jobs:
manage-frontend:
- ./manage-frontend.zip



- name: Upload help centre domain to Riff-Raff
uses: guardian/actions-riff-raff@v4
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
app: help-centre
configPath: ./help-centre/riff-raff.yaml
contentDirectories: |
cfn:
- ./cdk/cdk.out/HelpCentre-CODE.template.json
- ./cdk/cdk.out/HelpCentre-PROD.template.json
5 changes: 5 additions & 0 deletions cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'source-map-support/register';
import { App } from 'aws-cdk-lib';
import { HelpCentre } from '../lib/help-centre';
import { ManageFrontend } from '../lib/manage-frontend';

const app = new App();
Expand All @@ -22,3 +23,7 @@ new ManageFrontend(app, 'ManageFrontend-PROD', {
domain: 'manage.theguardian.com.origin.membership.guardianapis.com',
cloudFormationStackName: 'support-PROD-manage-frontend',
});

new HelpCentre(app, 'HelpCentre-CODE', 'CODE');

new HelpCentre(app, 'HelpCentre-PROD', 'PROD');
29 changes: 29 additions & 0 deletions cdk/lib/help-centre.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { GuStack } from '@guardian/cdk/lib/constructs/core';
import { GuCname } from '@guardian/cdk/lib/constructs/dns/dns-records';
import type { App } from 'aws-cdk-lib';
import { Duration } from 'aws-cdk-lib';

export class HelpCentre extends GuStack {
constructor(scope: App, id: string, stage: 'CODE' | 'PROD') {
super(scope, id, { stack: 'support', stage });

const app = 'help-centre';
const mappings = {
CODE: {
domainName: 'help.code.dev-theguardian.com',
resourceRecord: 'guardian.map.fastly.net.',
},
PROD: {
domainName: 'help.theguardian.com',
resourceRecord: 'guardian.map.fastly.net.',
},
};
const { domainName, resourceRecord } = mappings[stage];
new GuCname(this, 'NS1Domain', {
app,
domainName,
resourceRecord,
ttl: Duration.hours(1),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what a reasonable value is - I'm sure up to a week would also make sense given it's just a CNAME?

});
}
}
15 changes: 15 additions & 0 deletions help-centre/riff-raff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
regions:
- eu-west-1
stacks:
- support
allowedStages:
- CODE
- PROD
deployments:
cfn:
type: cloud-formation
app: help-centre
parameters:
templateStagePaths:
CODE: HelpCentre-CODE.template.json
PROD: HelpCentre-PROD.template.json
Loading