Skip to content

Commit

Permalink
Initial migration to CDK (#2808)
Browse files Browse the repository at this point in the history
* Add cdk package which uses the Gateway cloudformation yaml

* Update riffraff to use synthesized Cloudformation JSON

* Exclude CDK from root jest, prettier, and eslint

* Synth CDK in CI

* Update CDK test snapshot
  • Loading branch information
AshCorr authored Aug 1, 2024
1 parent b663520 commit bcd7186
Show file tree
Hide file tree
Showing 17 changed files with 7,115 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@
"react": {
"version": "detect"
}
}
},
"ignorePatterns": ["cdk/"]
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
identity-gateway:
- identity-gateway.zip
gateway-cloudformation:
- cloudformation.yaml
- cdk/cdk.out
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ build
.ratelimit.schema.json
scripts/okta/okta-login.js
pnpm-lock.yaml

# TODO: Shared prettier config between Gateway and CDK? Monorepo?
cdk/
11 changes: 11 additions & 0 deletions cdk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*.js
!jest.config.js
!jest.setup.js
!.eslintrc.js
*.d.ts
node_modules
dist

# CDK asset staging directory
.cdk.staging
cdk.out
5 changes: 5 additions & 0 deletions cdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Infrastructure

This directory defines the components to be deployed to AWS.

See [`package.json`](./package.json) for a list of available scripts.
15 changes: 15 additions & 0 deletions cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'source-map-support/register';
import { GuRoot } from '@guardian/cdk/lib/constructs/root';
import { IdentityGateway } from '../lib/identity-gateway';

const app = new GuRoot();
new IdentityGateway(app, 'IdentityGateway-euwest-1-PROD', {
stack: 'identity',
stage: 'PROD',
env: { region: 'eu-west-1' },
});
new IdentityGateway(app, 'IdentityGateway-euwest-1-CODE', {
stack: 'identity',
stage: 'CODE',
env: { region: 'eu-west-1' },
});
7 changes: 7 additions & 0 deletions cdk/cdk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"app": "npx ts-node bin/cdk.ts",
"context": {
"aws-cdk:enableDiffNoFail": "true",
"@aws-cdk/core:stackRelativeExports": "true"
}
}
1 change: 1 addition & 0 deletions cdk/jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest.mock("@guardian/cdk/lib/constants/tracking-tag");
Loading

0 comments on commit bcd7186

Please sign in to comment.