-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cdk and create skeleton stack for mobile purchases
- Loading branch information
1 parent
033f002
commit 7181db8
Showing
12 changed files
with
4,572 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import "source-map-support/register"; | ||
import { GuRoot } from "@guardian/cdk/lib/constructs/root"; | ||
import { MobilePurchases } from "../lib/mobile-purchases"; | ||
|
||
const app = new GuRoot(); | ||
new MobilePurchases(app, "MobilePurchases-euwest-1-CODE", { stack: "mobile", stage: "CODE", env: { region: "eu-west-1" } }); | ||
new MobilePurchases(app, "MobilePurchases-euwest-1-PROD", { stack: "mobile", stage: "PROD", env: { region: "eu-west-1" } }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
jest.mock("@guardian/cdk/lib/constants/tracking-tag"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`The MobilePurchases stack matches the snapshot 1`] = ` | ||
{ | ||
"Metadata": { | ||
"gu:cdk:constructs": [], | ||
"gu:cdk:version": "TEST", | ||
}, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { App } from "aws-cdk-lib"; | ||
import { Template } from "aws-cdk-lib/assertions"; | ||
import { MobilePurchases } from "./mobile-purchases"; | ||
|
||
describe("The MobilePurchases stack", () => { | ||
it("matches the snapshot", () => { | ||
const app = new App(); | ||
const stack = new MobilePurchases(app, "MobilePurchases", { stack: "mobile", stage: "TEST" }); | ||
const template = Template.fromStack(stack); | ||
expect(template.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type { GuStackProps } from "@guardian/cdk/lib/constructs/core"; | ||
import { GuStack } from "@guardian/cdk/lib/constructs/core"; | ||
import type { App } from "aws-cdk-lib"; | ||
|
||
export class MobilePurchases extends GuStack { | ||
constructor(scope: App, id: string, props: GuStackProps) { | ||
super(scope, id, props); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ | ||
"name": "cdk", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "jest", | ||
"test-update": "jest -u", | ||
"format": "prettier --write \"{lib,bin}/**/*.ts\"", | ||
"lint": "eslint lib/** bin/** --ext .ts --no-error-on-unmatched-pattern", | ||
"synth": "cdk synth --path-metadata false --version-reporting false", | ||
"diff": "cdk diff --path-metadata false --version-reporting false" | ||
}, | ||
"devDependencies": { | ||
"@guardian/cdk": "54.1.0", | ||
"@guardian/eslint-config-typescript": "8.0.0", | ||
"@guardian/prettier": "5.0.0", | ||
"@guardian/tsconfig": "^0.2.0", | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "20.11.20", | ||
"aws-cdk": "2.127.0", | ||
"aws-cdk-lib": "2.127.0", | ||
"constructs": "10.3.0", | ||
"eslint": "^8.56.0", | ||
"jest": "^29.7.0", | ||
"prettier": "^3.2.5", | ||
"source-map-support": "^0.5.20", | ||
"ts-jest": "^29.1.2", | ||
"ts-node": "^10.9.2", | ||
"typescript": "5.1.6" | ||
}, | ||
"prettier": "@guardian/prettier", | ||
"jest": { | ||
"testMatch": [ | ||
"<rootDir>/lib/**/*.test.ts" | ||
], | ||
"transform": { | ||
"^.+\\.tsx?$": "ts-jest" | ||
}, | ||
"setupFilesAfterEnv": [ | ||
"./jest.setup.js" | ||
] | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"env": { | ||
"node": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"@guardian/eslint-config-typescript" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 2020, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-inferrable-types": 0, | ||
"import/no-namespace": 2 | ||
}, | ||
"ignorePatterns": [ | ||
"**/*.js", | ||
"node_modules", | ||
"cdk.out", | ||
".eslintrc.js", | ||
"jest.config.js" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"extends": "@guardian/tsconfig/tsconfig.json", | ||
"compilerOptions": { | ||
"module": "CommonJS" | ||
}, | ||
"include": ["lib/**/*", "bin/**/*"], | ||
"exclude": [ | ||
"node_modules", | ||
"cdk.out", | ||
"lib/**/__snapshots__/**" | ||
] | ||
} |
Oops, something went wrong.