Skip to content

Commit

Permalink
Merge pull request #945 from guardian/gucdk-59.5.0
Browse files Browse the repository at this point in the history
chore(deps): Update GuCDK from 57.0.0 to 59.5.1
  • Loading branch information
akash1810 authored Sep 19, 2024
2 parents ab90182 + 519fc51 commit 4f27811
Show file tree
Hide file tree
Showing 19 changed files with 851 additions and 842 deletions.
10 changes: 0 additions & 10 deletions cdk/.editorconfig

This file was deleted.

4 changes: 0 additions & 4 deletions cdk/.eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions cdk/.eslintrc.js

This file was deleted.

3 changes: 0 additions & 3 deletions cdk/.prettierrc

This file was deleted.

24 changes: 2 additions & 22 deletions cdk/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
# Prism Infrastructure

This directory defines the components to be deployed to AWS defined as CDK stacks:
- [Prism](./lib/prism.ts) for the application
- [Prism Access](./lib/prism-access.ts) for the stack set that creates a role for Prism to assume in another account
This directory defines the components to be deployed to AWS.

## Useful commands

We follow the [`script/task`](https://github.com/github/scripts-to-rule-them-all) pattern,
find useful scripts within the [`script`](./script) directory for common tasks.

- `./script/setup` to install dependencies
- `./script/start` to run the Jest unit tests in watch mode
- `./script/lint` to lint the code using ESLint
- `./script/test` to lint, run tests and generate templates of the CDK stacks
- `./script/build` to compile TypeScript to JS and generate templates of the CDK stacks
- `./script/ci` to perform CI tasks: lint, build, test and generate templates

There are also some other commands defined in `package.json`, including:

- `yarn lint --fix` attempt to autofix any linter errors
- `yarn format` format the code using Prettier
- `yarn watch` watch for changes and compile

However, it's advised you configure your IDE to format on save to avoid horrible "correct linting" commits.
See [`package.json`](./package.json) for a list of available scripts.
20 changes: 10 additions & 10 deletions cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import { PrismEc2App } from "../lib/prism-ec2-app";
const app = new App();

new PrismEc2App(app, "Prism-CODE", {
stage: "CODE",
domainName: "prism.code.dev-gutools.co.uk",
minimumInstances: 1,
cloudFormationStackName: "prism-CODE",
env: { region: "eu-west-1" },
stage: "CODE",
domainName: "prism.code.dev-gutools.co.uk",
minimumInstances: 1,
cloudFormationStackName: "prism-CODE",
env: { region: "eu-west-1" },
});

new PrismEc2App(app, "Prism-PROD", {
stage: "PROD",
domainName: "prism.gutools.co.uk",
minimumInstances: 2,
cloudFormationStackName: "prism-PROD",
env: { region: "eu-west-1" },
stage: "PROD",
domainName: "prism.gutools.co.uk",
minimumInstances: 2,
cloudFormationStackName: "prism-PROD",
env: { region: "eu-west-1" },
});

new PrismAccess(app, "PrismAccessStackSet");
7 changes: 0 additions & 7 deletions cdk/jest.config.js

This file was deleted.

27 changes: 26 additions & 1 deletion cdk/lib/__snapshots__/prism-ec2-app.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ exports[`The PrismEc2App stack matches the snapshot 1`] = `
"GuSubnetListParameter",
"GuSubnetListParameter",
"GuPlayApp",
"GuDistributionBucketParameter",
"GuCertificate",
"GuInstanceRole",
"GuSsmSshPolicy",
"GuDescribeEC2Policy",
"GuLoggingStreamNameParameter",
"GuLogShippingPolicy",
"GuDistributionBucketParameter",
"GuGetDistributablePolicy",
"GuParameterStoreReadPolicy",
"GuAmiParameter",
Expand Down Expand Up @@ -93,6 +93,11 @@ exports[`The PrismEc2App stack matches the snapshot 1`] = `
},
},
"MaxSize": "4",
"MetricsCollection": [
{
"Granularity": "1Minute",
},
],
"MinSize": "2",
"Tags": [
{
Expand Down Expand Up @@ -631,6 +636,7 @@ exports[`The PrismEc2App stack matches the snapshot 1`] = `
},
"Port": 443,
"Protocol": "HTTPS",
"SslPolicy": "ELBSecurityPolicy-TLS13-1-2-2021-06",
},
"Type": "AWS::ElasticLoadBalancingV2::Listener",
},
Expand Down Expand Up @@ -1005,6 +1011,24 @@ exports[`The PrismEc2App stack matches the snapshot 1`] = `
"Namespace": "AWS/ApplicationELB",
"Period": 60,
"Statistic": "Maximum",
"Tags": [
{
"Key": "gu:cdk:version",
"Value": "TEST",
},
{
"Key": "gu:repo",
"Value": "guardian/prism",
},
{
"Key": "Stack",
"Value": "deploy",
},
{
"Key": "Stage",
"Value": "PROD",
},
],
"Threshold": 1,
"TreatMissingData": "notBreaching",
},
Expand Down Expand Up @@ -1124,6 +1148,7 @@ exports[`The PrismEc2App stack matches the snapshot 1`] = `
"InstanceType": "t4g.medium",
"MetadataOptions": {
"HttpTokens": "required",
"InstanceMetadataTags": "enabled",
},
"SecurityGroupIds": [
{
Expand Down
Loading

0 comments on commit 4f27811

Please sign in to comment.