From 6c74202f74950e00f99901d4dc5260537fab0739 Mon Sep 17 00:00:00 2001 From: Robert Kenny Date: Fri, 15 Sep 2023 15:11:03 +0100 Subject: [PATCH] run prettier --- src/aspects/cfn-include-reporter.test.ts | 2 +- src/aspects/cfn-include-reporter.ts | 2 +- src/aspects/cfn-parameter-reporter.test.ts | 2 +- src/aspects/cfn-parameter-reporter.ts | 2 +- src/bin/aws-credential-provider.ts | 2 +- src/bin/commands/account-readiness/index.ts | 2 +- src/bin/commands/account-readiness/ssm.ts | 6 +++--- src/bin/commands/new-project/index.ts | 2 +- src/bin/commands/new-project/utils/app.ts | 2 +- src/bin/commands/new-project/utils/snapshot.ts | 2 +- src/bin/commands/new-project/utils/utils.ts | 2 +- src/bin/index.ts | 8 ++++---- src/constants/ssm-parameter-paths.ts | 2 +- src/constructs/autoscaling/asg.ts | 4 ++-- src/constructs/cloudwatch/alarm.test.ts | 2 +- src/constructs/core/stack.test.ts | 4 ++-- src/constructs/core/stack.ts | 2 +- src/constructs/dns/dns-records.test.ts | 2 +- src/constructs/dns/dns-records.ts | 2 +- src/constructs/ec2/vpc.ts | 2 +- src/constructs/ecs/ecs-task.ts | 4 ++-- src/constructs/iam/policies/base-policy.test.ts | 8 ++++---- src/constructs/iam/policies/base-policy.ts | 4 ++-- src/constructs/iam/roles/github-actions.ts | 4 ++-- .../alb/application-listener.test.ts | 4 ++-- .../alb/application-load-balancer.test.ts | 2 +- .../alb/application-target-group.test.ts | 2 +- src/constructs/ses/index.test.ts | 2 +- src/constructs/stack-set/stack-set.test.ts | 2 +- src/constructs/vpc/vpc.ts | 2 +- .../constructs/iam/roles/fastly-kinesis-log.ts | 2 +- src/experimental/patterns/kinesis-lambda.ts | 4 ++-- src/experimental/patterns/sns-lambda.ts | 2 +- .../deployments/autoscaling.ts | 2 +- .../deployments/cloudformation.ts | 6 +++--- .../riff-raff-yaml-file/deployments/lambda.ts | 2 +- src/experimental/riff-raff-yaml-file/group-by.ts | 6 +++--- src/experimental/riff-raff-yaml-file/index.ts | 2 +- src/patterns/api-multiple-lambdas.test.ts | 2 +- src/patterns/api-multiple-lambdas.ts | 2 +- src/patterns/ec2-app/base.ts | 16 ++++++++-------- src/types/access.test.ts | 4 ++-- src/types/access.ts | 4 ++-- src/utils/cli/vpc.ts | 4 ++-- src/utils/security-groups/helpers.ts | 2 +- 45 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/aspects/cfn-include-reporter.test.ts b/src/aspects/cfn-include-reporter.test.ts index 8074c3e577..96a9c7e503 100644 --- a/src/aspects/cfn-include-reporter.test.ts +++ b/src/aspects/cfn-include-reporter.test.ts @@ -22,7 +22,7 @@ describe("CfnIncludeReporter aspect", () => { app.synth(); expect(warning).toHaveBeenCalledWith( - `As you're migrating a YAML/JSON template to ${LibraryInfo.NAME}, be sure to check for any stateful resources! See https://github.com/guardian/cdk/blob/main/docs/stateful-resources.md.`, + `As you're migrating a YAML/JSON template to ${LibraryInfo.NAME}, be sure to check for any stateful resources! See https://github.com/guardian/cdk/blob/main/docs/stateful-resources.md.` ); }); diff --git a/src/aspects/cfn-include-reporter.ts b/src/aspects/cfn-include-reporter.ts index 9ace1ee134..87e9f19fbf 100644 --- a/src/aspects/cfn-include-reporter.ts +++ b/src/aspects/cfn-include-reporter.ts @@ -11,7 +11,7 @@ export class CfnIncludeReporter implements IAspect { public visit(node: IConstruct) { if (node instanceof CfnInclude) { Annotations.of(node).addWarning( - `As you're migrating a YAML/JSON template to ${LibraryInfo.NAME}, be sure to check for any stateful resources! See https://github.com/guardian/cdk/blob/main/docs/stateful-resources.md.`, + `As you're migrating a YAML/JSON template to ${LibraryInfo.NAME}, be sure to check for any stateful resources! See https://github.com/guardian/cdk/blob/main/docs/stateful-resources.md.` ); } } diff --git a/src/aspects/cfn-parameter-reporter.test.ts b/src/aspects/cfn-parameter-reporter.test.ts index 8530d3c51b..760166e69a 100644 --- a/src/aspects/cfn-parameter-reporter.test.ts +++ b/src/aspects/cfn-parameter-reporter.test.ts @@ -19,7 +19,7 @@ describe("CfnParameterReporter aspect", () => { app.synth(); expect(info).toHaveBeenCalledWith( - "Stack reads the SSM Parameter '/TEST/test/my-app/database-password'. Ensure it exists prior to deployment.", + "Stack reads the SSM Parameter '/TEST/test/my-app/database-password'. Ensure it exists prior to deployment." ); }); }); diff --git a/src/aspects/cfn-parameter-reporter.ts b/src/aspects/cfn-parameter-reporter.ts index 45c9cc5455..928c4bf87c 100644 --- a/src/aspects/cfn-parameter-reporter.ts +++ b/src/aspects/cfn-parameter-reporter.ts @@ -14,7 +14,7 @@ export class CfnParameterReporter implements IAspect { if (isSsmParameter && hasDefault) { Annotations.of(node.stack).addInfo( - `Stack reads the SSM Parameter '${defaultValue}'. Ensure it exists prior to deployment.`, + `Stack reads the SSM Parameter '${defaultValue}'. Ensure it exists prior to deployment.` ); } } diff --git a/src/bin/aws-credential-provider.ts b/src/bin/aws-credential-provider.ts index 1479c62ae5..e59f3b0f4e 100644 --- a/src/bin/aws-credential-provider.ts +++ b/src/bin/aws-credential-provider.ts @@ -2,7 +2,7 @@ import type { CredentialProviderChain } from "aws-sdk"; import AWS from "aws-sdk"; export const awsCredentialProviderChain: (profile: string | undefined) => CredentialProviderChain = ( - profile: string | undefined, + profile: string | undefined ) => { const envCredentials = () => new AWS.EnvironmentCredentials("AWS"); diff --git a/src/bin/commands/account-readiness/index.ts b/src/bin/commands/account-readiness/index.ts index fc494ddfad..3543a5dc03 100644 --- a/src/bin/commands/account-readiness/index.ts +++ b/src/bin/commands/account-readiness/index.ts @@ -18,7 +18,7 @@ export const accountReadinessCommand = async (props: AwsConfig): CliCommandRespo if (report.parametersFound === 0) { console.log( - `It looks like this account has not been set up for @guardian/cdk yet. See https://github.com/guardian/aws-account-setup`, + `It looks like this account has not been set up for @guardian/cdk yet. See https://github.com/guardian/aws-account-setup` ); return 1; diff --git a/src/bin/commands/account-readiness/ssm.ts b/src/bin/commands/account-readiness/ssm.ts index e6b6f8f95b..070d0791cc 100644 --- a/src/bin/commands/account-readiness/ssm.ts +++ b/src/bin/commands/account-readiness/ssm.ts @@ -42,7 +42,7 @@ const ssmParamReadiness = async ({ credentialProvider, region }: AwsConfig): Pro }); const ssmParametersMatchingDefaultVpc = ssmParamsFromAccount.filter( - ({ Value }) => Value && defaultVpcs.includes(Value), + ({ Value }) => Value && defaultVpcs.includes(Value) ); const defaultVPCReferencePaths = ssmParametersMatchingDefaultVpc @@ -77,8 +77,8 @@ export const report = async (props: AwsConfig): Promise => { errs.set( "Default VPC referenced in VPC parameters", `you should use a custom VPC instead. Default VPC is referenced in paths: ${output.defaultVPCReferences.join( - ", ", - )}.`, + ", " + )}.` ); } diff --git a/src/bin/commands/new-project/index.ts b/src/bin/commands/new-project/index.ts index 55179ff0fd..df4638123e 100644 --- a/src/bin/commands/new-project/index.ts +++ b/src/bin/commands/new-project/index.ts @@ -147,7 +147,7 @@ export const newCdkProject = async (props: NewProjectProps): CliCommandResponse ["lib/** bin/**", "--ext .ts", "--no-error-on-unmatched-pattern", "--fix"], { cwd: config.cdkDir, - }, + } ); ux.action.start(chalk.yellow("Running lint check...")); diff --git a/src/bin/commands/new-project/utils/app.ts b/src/bin/commands/new-project/utils/app.ts index 2cd05e8a4b..95ae18f9cd 100644 --- a/src/bin/commands/new-project/utils/app.ts +++ b/src/bin/commands/new-project/utils/app.ts @@ -40,7 +40,7 @@ export class AppBuilder { stages.forEach((stage) => { this.code.line( - `new ${appName.pascal}(app, "${appName.pascal}-${stage}", { stack: "${stack.kebab}", stage: "${stage}" });`, + `new ${appName.pascal}(app, "${appName.pascal}-${stage}", { stack: "${stack.kebab}", stage: "${stage}" });` ); }); diff --git a/src/bin/commands/new-project/utils/snapshot.ts b/src/bin/commands/new-project/utils/snapshot.ts index 0056092365..e47180500a 100644 --- a/src/bin/commands/new-project/utils/snapshot.ts +++ b/src/bin/commands/new-project/utils/snapshot.ts @@ -48,7 +48,7 @@ export class TestBuilder { this.code.line("const app = new App();"); this.code.line( - `const stack = new ${appName.pascal}(app, "${appName.pascal}", { stack: "${stackName.kebab}", stage: "TEST" });`, + `const stack = new ${appName.pascal}(app, "${appName.pascal}", { stack: "${stackName.kebab}", stage: "TEST" });` ); this.code.line(`const template = Template.fromStack(stack);`); diff --git a/src/bin/commands/new-project/utils/utils.ts b/src/bin/commands/new-project/utils/utils.ts index afe46d90fe..63099d7f11 100644 --- a/src/bin/commands/new-project/utils/utils.ts +++ b/src/bin/commands/new-project/utils/utils.ts @@ -18,7 +18,7 @@ async function runTask(packageManager: PackageManager, cwd: string, task: string export function getCommands( packageManager: PackageManager, - cwd: string, + cwd: string ): { installDependencies: () => Promise; lint: () => Promise; diff --git a/src/bin/index.ts b/src/bin/index.ts index 17b6f9fb3b..97cb700a6a 100755 --- a/src/bin/index.ts +++ b/src/bin/index.ts @@ -29,7 +29,7 @@ const parseCommandLineArguments = () => { .command(Commands.AccountReadiness, "Perform checks on an AWS account to see if it is GuCDK ready", (yargs) => yargs .option("profile", { type: "string", description: "AWS profile" }) - .option("region", { type: "string", description: "AWS region", default: "eu-west-1" }), + .option("region", { type: "string", description: "AWS region", default: "eu-west-1" }) ) .command( Commands.New, @@ -67,14 +67,14 @@ const parseCommandLineArguments = () => { "The Node package manager to use. Match this to the repository (package-lock.json = npm, yarn.lock = yarn). If the repository has neither file, and there is no strong convention in your team, we recommend npm.", choices: ["npm", "yarn"], demandOption: true, - }), + }) ) .version( - `${LibraryInfo.VERSION} (using aws-cdk-lib ${LibraryInfo.AWS_CDK_VERSION}, constructs ${LibraryInfo.CONSTRUCTS_VERSION})`, + `${LibraryInfo.VERSION} (using aws-cdk-lib ${LibraryInfo.AWS_CDK_VERSION}, constructs ${LibraryInfo.CONSTRUCTS_VERSION})` ) .demandCommand(1, "") // just print help .help() - .alias("h", "help").argv, + .alias("h", "help").argv ); }; diff --git a/src/constants/ssm-parameter-paths.ts b/src/constants/ssm-parameter-paths.ts index 0658047fe5..255ad61b7c 100644 --- a/src/constants/ssm-parameter-paths.ts +++ b/src/constants/ssm-parameter-paths.ts @@ -77,5 +77,5 @@ export const NAMED_SSM_PARAMETER_PATHS: NamedSsmParameterPaths = { }; export const ALL_SSM_PARAMETER_PATHS: SsmParameterPath[] = Object.values( - NAMED_SSM_PARAMETER_PATHS, + NAMED_SSM_PARAMETER_PATHS ) as SsmParameterPath[]; diff --git a/src/constructs/autoscaling/asg.ts b/src/constructs/autoscaling/asg.ts index 98cd036a54..01b7eea2fd 100644 --- a/src/constructs/autoscaling/asg.ts +++ b/src/constructs/autoscaling/asg.ts @@ -98,7 +98,7 @@ export class GuAutoScalingGroup extends GuAppAwareConstruct(AutoScalingGroup) { // Ensure min and max are defined in the same way. Throwing an `Error` when necessary. For example when min is defined via a Mapping, but max is not. if (Token.isUnresolved(minimumInstances) && !Token.isUnresolved(maximumInstances)) { throw new Error( - "minimumInstances is defined via a Mapping, but maximumInstances is not. Create maximumInstances via a Mapping too.", + "minimumInstances is defined via a Mapping, but maximumInstances is not. Create maximumInstances via a Mapping too." ); } @@ -131,7 +131,7 @@ export class GuAutoScalingGroup extends GuAppAwareConstruct(AutoScalingGroup) { // Note: Launch templates via CDK allow specifying only one SG, so use connections // https://github.com/aws/aws-cdk/issues/18712 [GuWazuhAccess.getInstance(scope, vpc), ...additionalSecurityGroups].forEach((sg) => - launchTemplate.connections.addSecurityGroup(sg), + launchTemplate.connections.addSecurityGroup(sg) ); const asgProps = { diff --git a/src/constructs/cloudwatch/alarm.test.ts b/src/constructs/cloudwatch/alarm.test.ts index 6f07309179..0f46582404 100644 --- a/src/constructs/cloudwatch/alarm.test.ts +++ b/src/constructs/cloudwatch/alarm.test.ts @@ -71,7 +71,7 @@ describe("The GuAlarm class", () => { { OkActions: snsActionsCFN, }, - 0, + 0 ); }); diff --git a/src/constructs/core/stack.test.ts b/src/constructs/core/stack.test.ts index 21a20364e4..b3d629a718 100644 --- a/src/constructs/core/stack.test.ts +++ b/src/constructs/core/stack.test.ts @@ -37,7 +37,7 @@ describe("The GuStack construct", () => { { stack: "test", stage: "TEST", - }, + } ); new Role(stack, "MyRole", { @@ -61,7 +61,7 @@ describe("The GuStack construct", () => { { stack: "test", stage: "TEST", - }, + } ); expect(stack.repositoryName).toEqual("guardian/my-repository"); diff --git a/src/constructs/core/stack.ts b/src/constructs/core/stack.ts index 120115e995..1361904d05 100644 --- a/src/constructs/core/stack.ts +++ b/src/constructs/core/stack.ts @@ -179,7 +179,7 @@ export class GuStack extends Stack implements StackStageIdentity { return gitUrlParse(repositoryUrl).full_name; } catch { console.info( - `Unable to find git repository name. Set the ${ContextKeys.REPOSITORY_URL} context value or configure a git remote`, + `Unable to find git repository name. Set the ${ContextKeys.REPOSITORY_URL} context value or configure a git remote` ); return undefined; } diff --git a/src/constructs/dns/dns-records.test.ts b/src/constructs/dns/dns-records.test.ts index f90d7ca3e6..580d924f04 100644 --- a/src/constructs/dns/dns-records.test.ts +++ b/src/constructs/dns/dns-records.test.ts @@ -36,7 +36,7 @@ describe("The GuDnsRecordSet construct", () => { ttl: Duration.hours(1), }); }).toThrowError( - "According to RFC, a CNAME record should not return multiple answers. Doing so may cause problems during resolution.", + "According to RFC, a CNAME record should not return multiple answers. Doing so may cause problems during resolution." ); }); }); diff --git a/src/constructs/dns/dns-records.ts b/src/constructs/dns/dns-records.ts index 6f8cf6e633..a5d86ba43e 100644 --- a/src/constructs/dns/dns-records.ts +++ b/src/constructs/dns/dns-records.ts @@ -49,7 +49,7 @@ export class GuDnsRecordSet extends Construct { */ if (resourceRecords.length !== 1) { throw new Error( - "According to RFC, a CNAME record should not return multiple answers. Doing so may cause problems during resolution.", + "According to RFC, a CNAME record should not return multiple answers. Doing so may cause problems during resolution." ); } } diff --git a/src/constructs/ec2/vpc.ts b/src/constructs/ec2/vpc.ts index 6e9fac3ec8..618a95bce3 100644 --- a/src/constructs/ec2/vpc.ts +++ b/src/constructs/ec2/vpc.ts @@ -42,7 +42,7 @@ export class GuVpc { * TODO: Understand VPCs and Subnets better and develop a better solution to this problem */ return subnets.map((subnetId) => - Subnet.fromSubnetAttributes(scope, `subnet-${subnetId}`, { subnetId, routeTableId: " " }), + Subnet.fromSubnetAttributes(scope, `subnet-${subnetId}`, { subnetId, routeTableId: " " }) ); } diff --git a/src/constructs/ecs/ecs-task.ts b/src/constructs/ecs/ecs-task.ts index 02c0eb2331..fa13fbdee8 100644 --- a/src/constructs/ecs/ecs-task.ts +++ b/src/constructs/ecs/ecs-task.ts @@ -164,7 +164,7 @@ export class GuEcsTask extends Construct { if (storage && storage < 21) { throw new Error( - "Storage must be at least 21. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-ephemeralstorage.html", + "Storage must be at least 21. See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-ephemeralstorage.html" ); } @@ -228,7 +228,7 @@ export class GuEcsTask extends Construct { const alarmTopic = Topic.fromTopicArn( scope, AppIdentity.suffixText(props, "AlarmTopic"), - monitoringConfiguration.snsTopicArn, + monitoringConfiguration.snsTopicArn ); const alarms = [ { diff --git a/src/constructs/iam/policies/base-policy.test.ts b/src/constructs/iam/policies/base-policy.test.ts index b44ea3f307..e61f72e582 100644 --- a/src/constructs/iam/policies/base-policy.test.ts +++ b/src/constructs/iam/policies/base-policy.test.ts @@ -10,7 +10,7 @@ describe("GuAllowPolicy", () => { new GuAllowPolicy(stack, "AllowS3GetObject", { actions: ["s3:GetObject"], resources: ["*"], - }), + }) ); Template.fromStack(stack).hasResourceProperties("AWS::IAM::Policy", { @@ -34,7 +34,7 @@ describe("GuAllowPolicy", () => { new GuAllowPolicy(stack, "AllowS3GetObject", { actions: ["s3:GetObject", "s3:ListBucket"], resources: ["*"], - }), + }) ); Template.fromStack(stack).hasResourceProperties("AWS::IAM::Policy", { @@ -60,7 +60,7 @@ describe("GuDenyPolicy", () => { new GuDenyPolicy(stack, "DenyS3GetObject", { actions: ["s3:GetObject"], resources: ["*"], - }), + }) ); Template.fromStack(stack).hasResourceProperties("AWS::IAM::Policy", { @@ -84,7 +84,7 @@ describe("GuDenyPolicy", () => { new GuDenyPolicy(stack, "DenyS3GetObject", { actions: ["s3:GetObject", "s3:ListBucket"], resources: ["*"], - }), + }) ); Template.fromStack(stack).hasResourceProperties("AWS::IAM::Policy", { diff --git a/src/constructs/iam/policies/base-policy.ts b/src/constructs/iam/policies/base-policy.ts index 6ed90f19d3..283aaaaf60 100644 --- a/src/constructs/iam/policies/base-policy.ts +++ b/src/constructs/iam/policies/base-policy.ts @@ -27,7 +27,7 @@ export class GuAllowPolicy extends GuPolicy { effect: Effect.ALLOW, resources: props.resources, actions: props.actions, - }), + }) ); } } @@ -41,7 +41,7 @@ export class GuDenyPolicy extends GuPolicy { effect: Effect.DENY, resources: props.resources, actions: props.actions, - }), + }) ); } } diff --git a/src/constructs/iam/roles/github-actions.ts b/src/constructs/iam/roles/github-actions.ts index 64fb8ff723..4a67f27db5 100644 --- a/src/constructs/iam/roles/github-actions.ts +++ b/src/constructs/iam/roles/github-actions.ts @@ -93,11 +93,11 @@ export class GuGithubActionsRole extends GuRole { { StringLike: { [`${GITHUB_ACTIONS_ID_TOKEN_REQUEST_DOMAIN}:sub`]: GuGithubActionsRepositoryCondition.toString( - props.condition ?? ALL_GUARDIAN_REPOSITORIES, + props.condition ?? ALL_GUARDIAN_REPOSITORIES ), }, }, - "sts:AssumeRoleWithWebIdentity", + "sts:AssumeRoleWithWebIdentity" ), }); diff --git a/src/constructs/loadbalancing/alb/application-listener.test.ts b/src/constructs/loadbalancing/alb/application-listener.test.ts index 40a304b5f2..524589de9a 100644 --- a/src/constructs/loadbalancing/alb/application-listener.test.ts +++ b/src/constructs/loadbalancing/alb/application-listener.test.ts @@ -49,7 +49,7 @@ describe("The GuApplicationListener class", () => { GuTemplate.fromStack(stack).hasResourceWithLogicalId( "AWS::ElasticLoadBalancingV2::Listener", - /ApplicationListenerTesting.+/, + /ApplicationListenerTesting.+/ ); }); @@ -115,7 +115,7 @@ describe("The GuHttpsApplicationListener class", () => { GuTemplate.fromStack(stack).hasResourceWithLogicalId( "AWS::ElasticLoadBalancingV2::Listener", - /^HttpsApplicationListenerTesting.+/, + /^HttpsApplicationListenerTesting.+/ ); }); diff --git a/src/constructs/loadbalancing/alb/application-load-balancer.test.ts b/src/constructs/loadbalancing/alb/application-load-balancer.test.ts index bf6a5c519b..209b248008 100644 --- a/src/constructs/loadbalancing/alb/application-load-balancer.test.ts +++ b/src/constructs/loadbalancing/alb/application-load-balancer.test.ts @@ -22,7 +22,7 @@ describe("The GuApplicationLoadBalancer class", () => { GuTemplate.fromStack(stack).hasResourceWithLogicalId( "AWS::ElasticLoadBalancingV2::LoadBalancer", - /^ApplicationLoadBalancerTesting.+/, + /^ApplicationLoadBalancerTesting.+/ ); }); diff --git a/src/constructs/loadbalancing/alb/application-target-group.test.ts b/src/constructs/loadbalancing/alb/application-target-group.test.ts index 5240016e17..fb7e174f26 100644 --- a/src/constructs/loadbalancing/alb/application-target-group.test.ts +++ b/src/constructs/loadbalancing/alb/application-target-group.test.ts @@ -23,7 +23,7 @@ describe("The GuApplicationTargetGroup class", () => { GuTemplate.fromStack(stack).hasResourceWithLogicalId( "AWS::ElasticLoadBalancingV2::TargetGroup", - /^ApplicationTargetGroupTesting.+/, + /^ApplicationTargetGroupTesting.+/ ); }); diff --git a/src/constructs/ses/index.test.ts b/src/constructs/ses/index.test.ts index b7d03370a0..30dae5cf51 100644 --- a/src/constructs/ses/index.test.ts +++ b/src/constructs/ses/index.test.ts @@ -34,7 +34,7 @@ describe("The GuEmailIdentity construct", () => { app: "test", }); }).toThrowError( - "Auto verification is only supported for certain domains. my-service.theguardian.com is not supported.", + "Auto verification is only supported for certain domains. my-service.theguardian.com is not supported." ); }); diff --git a/src/constructs/stack-set/stack-set.test.ts b/src/constructs/stack-set/stack-set.test.ts index 90610b5a9f..70ca32992d 100644 --- a/src/constructs/stack-set/stack-set.test.ts +++ b/src/constructs/stack-set/stack-set.test.ts @@ -30,7 +30,7 @@ describe("The GuStackSet construct", () => { theStackSetInstance, "central-topic", new GuStringParameter(theStackSetInstance, "CentralSnsTopicArn", { allowedPattern: RegexPattern.ARN }) - .valueAsString, + .valueAsString ); const awsOrgId = "o-12345abcde"; diff --git a/src/constructs/vpc/vpc.ts b/src/constructs/vpc/vpc.ts index 0884339086..f8a1cb9808 100644 --- a/src/constructs/vpc/vpc.ts +++ b/src/constructs/vpc/vpc.ts @@ -57,7 +57,7 @@ export class GuVpc extends Vpc { private static setAvailabilityZoneContext({ account, node }: GuStack) { if (Token.isUnresolved(account)) { throw new Error( - `Account ID not set - the resulting VPC might not be shaped how you'd expect. See https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.StackProps.html#env`, + `Account ID not set - the resulting VPC might not be shaped how you'd expect. See https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.StackProps.html#env` ); } diff --git a/src/experimental/constructs/iam/roles/fastly-kinesis-log.ts b/src/experimental/constructs/iam/roles/fastly-kinesis-log.ts index 8e95503e21..7892627e09 100644 --- a/src/experimental/constructs/iam/roles/fastly-kinesis-log.ts +++ b/src/experimental/constructs/iam/roles/fastly-kinesis-log.ts @@ -46,7 +46,7 @@ export class GuFastlyKinesisLogRoleExperimental extends GuRole { policyName ?? "GuKinesisPutRecordsPolicyExperimental", { stream, - }, + } ); policy.attachToRole(this); diff --git a/src/experimental/patterns/kinesis-lambda.ts b/src/experimental/patterns/kinesis-lambda.ts index d2b0a6bfbf..d20d89edf1 100644 --- a/src/experimental/patterns/kinesis-lambda.ts +++ b/src/experimental/patterns/kinesis-lambda.ts @@ -94,11 +94,11 @@ export class GuKinesisLambdaExperimental extends GuLambdaFunction { ? Stream.fromStreamArn( scope, existingKinesisStream.externalKinesisStreamName, - `arn:aws:kinesis:${region}:${account}:stream/${existingKinesisStream.externalKinesisStreamName}`, + `arn:aws:kinesis:${region}:${account}:stream/${existingKinesisStream.externalKinesisStreamName}` ) : AppIdentity.taggedConstruct( props, - new GuKinesisStream(scope, "KinesisStream", { encryption: StreamEncryption.MANAGED, ...kinesisStreamProps }), + new GuKinesisStream(scope, "KinesisStream", { encryption: StreamEncryption.MANAGED, ...kinesisStreamProps }) ); const errorHandlingPropsToAwsProps = toAwsErrorHandlingProps(props.errorHandlingConfiguration); diff --git a/src/experimental/patterns/sns-lambda.ts b/src/experimental/patterns/sns-lambda.ts index 00e0143e16..cb24e3e6b9 100644 --- a/src/experimental/patterns/sns-lambda.ts +++ b/src/experimental/patterns/sns-lambda.ts @@ -78,7 +78,7 @@ export class GuSnsLambdaExperimental extends GuLambdaFunction { ? Topic.fromTopicArn( scope, `${id}-SnsExistingIncomingEventsTopic`, - `arn:aws:sns:${region}:${account}:${existingSnsTopic.externalTopicName}`, + `arn:aws:sns:${region}:${account}:${existingSnsTopic.externalTopicName}` ) : AppIdentity.taggedConstruct(props, new Topic(scope, "SnsIncomingEventsTopic")); diff --git a/src/experimental/riff-raff-yaml-file/deployments/autoscaling.ts b/src/experimental/riff-raff-yaml-file/deployments/autoscaling.ts index a085e2d397..c2249613ae 100644 --- a/src/experimental/riff-raff-yaml-file/deployments/autoscaling.ts +++ b/src/experimental/riff-raff-yaml-file/deployments/autoscaling.ts @@ -25,7 +25,7 @@ export function uploadAutoscalingArtifact(asg: GuAutoScalingGroup): RiffRaffDepl export function autoscalingDeployment( asg: GuAutoScalingGroup, - { name: cfnDeployName }: RiffRaffDeployment, + { name: cfnDeployName }: RiffRaffDeployment ): RiffRaffDeployment { const { app } = asg; const { stack, region } = asg.stack as GuStack; diff --git a/src/experimental/riff-raff-yaml-file/deployments/cloudformation.ts b/src/experimental/riff-raff-yaml-file/deployments/cloudformation.ts index 0ea1c2e3f0..68139c01e1 100644 --- a/src/experimental/riff-raff-yaml-file/deployments/cloudformation.ts +++ b/src/experimental/riff-raff-yaml-file/deployments/cloudformation.ts @@ -4,7 +4,7 @@ import type { CdkStacksDifferingOnlyByStage, RiffRaffDeployment, RiffRaffDeploym export function cloudFormationDeployment( cdkStacks: CdkStacksDifferingOnlyByStage, dependencies: RiffRaffDeployment[], - contentDirectory: string, + contentDirectory: string ): RiffRaffDeployment { if (cdkStacks.length === 0) { throw new Error("Unable to produce a working riff-raff.yaml file; there are no stacks!"); @@ -27,7 +27,7 @@ export function cloudFormationDeployment( ...acc, [stage]: templateFile, }), - {}, + {} ); return { @@ -49,7 +49,7 @@ export function cloudFormationDeployment( export function addAmiParametersToCloudFormationDeployment( cfnDeployment: RiffRaffDeployment, - autoScalingGroups: GuAutoScalingGroup[], + autoScalingGroups: GuAutoScalingGroup[] ): RiffRaffDeploymentProps { const amiParametersToTags = autoScalingGroups.reduce((acc, asg) => { const { imageRecipe, app, amiParameter } = asg; diff --git a/src/experimental/riff-raff-yaml-file/deployments/lambda.ts b/src/experimental/riff-raff-yaml-file/deployments/lambda.ts index 356fb7607d..d9aa4279de 100644 --- a/src/experimental/riff-raff-yaml-file/deployments/lambda.ts +++ b/src/experimental/riff-raff-yaml-file/deployments/lambda.ts @@ -63,7 +63,7 @@ export function uploadLambdaArtifact(lambda: GuLambdaFunction): RiffRaffDeployme export function updateLambdaDeployment( lambda: GuLambdaFunction, - { name: cfnDeployName }: RiffRaffDeployment, + { name: cfnDeployName }: RiffRaffDeployment ): RiffRaffDeployment { const { app, fileName } = lambda; const { stack, region } = lambda.stack as GuStack; diff --git a/src/experimental/riff-raff-yaml-file/group-by.ts b/src/experimental/riff-raff-yaml-file/group-by.ts index 193e896286..b94c730133 100644 --- a/src/experimental/riff-raff-yaml-file/group-by.ts +++ b/src/experimental/riff-raff-yaml-file/group-by.ts @@ -30,12 +30,12 @@ export function groupByClassNameStackRegionStage(cdkStacks: GuStack[]): GroupedC ...accRegion, [region]: groupByStageTag(stacksGroupedByRegion), }), - {}, + {} ), }), - {}, + {} ), }), - {}, + {} ); } diff --git a/src/experimental/riff-raff-yaml-file/index.ts b/src/experimental/riff-raff-yaml-file/index.ts index eab0cfc68a..df7af69212 100644 --- a/src/experimental/riff-raff-yaml-file/index.ts +++ b/src/experimental/riff-raff-yaml-file/index.ts @@ -242,7 +242,7 @@ export class RiffRaffYamlFileExperimental { deployments.set( cfnDeployment.name, - addAmiParametersToCloudFormationDeployment(cfnDeployment, autoscalingGroups), + addAmiParametersToCloudFormationDeployment(cfnDeployment, autoscalingGroups) ); }); }); diff --git a/src/patterns/api-multiple-lambdas.test.ts b/src/patterns/api-multiple-lambdas.test.ts index 32ce7f8d15..8f43657a80 100644 --- a/src/patterns/api-multiple-lambdas.test.ts +++ b/src/patterns/api-multiple-lambdas.test.ts @@ -86,7 +86,7 @@ describe("The GuApiGatewayWithLambdaByPath pattern", () => { //The shape of this alarm is tested at construct level GuTemplate.fromStack(stack).hasResourceWithLogicalId( "AWS::CloudWatch::Alarm", - /^ApiGatewayHigh5xxPercentageAlarm.+/, + /^ApiGatewayHigh5xxPercentageAlarm.+/ ); }); diff --git a/src/patterns/api-multiple-lambdas.ts b/src/patterns/api-multiple-lambdas.ts index bf233b3704..a83fe84dfc 100644 --- a/src/patterns/api-multiple-lambdas.ts +++ b/src/patterns/api-multiple-lambdas.ts @@ -68,7 +68,7 @@ export interface GuApiGatewayWithLambdaByPathProps extends RestApiProps, AppIden } function isNoMonitoring( - monitoringConfiguration: NoMonitoring | ApiGatewayAlarms, + monitoringConfiguration: NoMonitoring | ApiGatewayAlarms ): monitoringConfiguration is NoMonitoring { return (monitoringConfiguration).noMonitoring; } diff --git a/src/patterns/ec2-app/base.ts b/src/patterns/ec2-app/base.ts index 8117480ac4..1db0789e57 100644 --- a/src/patterns/ec2-app/base.ts +++ b/src/patterns/ec2-app/base.ts @@ -344,7 +344,7 @@ export class GuEc2App extends Construct { if (applicationLogging.enabled && roleConfiguration.withoutLogShipping) { throw new Error( "Application logging has been enabled (via the `applicationLogging` prop) but your `roleConfiguration` sets " + - "`withoutLogShipping` to true. Please turn off application logging or remove `withoutLogShipping`", + "`withoutLogShipping` to true. Please turn off application logging or remove `withoutLogShipping`" ); } @@ -389,7 +389,7 @@ export class GuEc2App extends Construct { // `cdk-base` Amigo role on your AMI. Tags.of(autoScalingGroup).add( MetadataKeys.LOG_KINESIS_STREAM_NAME, - GuLoggingStreamNameParameter.getInstance(scope).valueAsString, + GuLoggingStreamNameParameter.getInstance(scope).valueAsString ); if (applicationLogging.enabled) { @@ -397,7 +397,7 @@ export class GuEc2App extends Construct { // `cdk-base` Amigo role on your AMI. Tags.of(autoScalingGroup).add( MetadataKeys.SYSTEMD_UNIT, - applicationLogging.systemdUnitName ? `${applicationLogging.systemdUnitName}.service` : `${app}.service`, + applicationLogging.systemdUnitName ? `${applicationLogging.systemdUnitName}.service` : `${app}.service` ); } @@ -422,9 +422,9 @@ export class GuEc2App extends Construct { Bucket.fromBucketName( scope, AppIdentity.suffixText(props, "AccessLoggingBucket"), - accessLoggingBucket.valueAsString, + accessLoggingBucket.valueAsString ), - accessLogging.prefix, + accessLogging.prefix ); } @@ -455,7 +455,7 @@ export class GuEc2App extends Construct { description: "Allow restricted ingress from CIDR ranges", allowAllOutbound: false, ingresses: restrictedCidrRanges(access.cidrRanges), - }), + }) ); } @@ -503,7 +503,7 @@ export class GuEc2App extends Construct { const deployToolsAccountId = StringParameter.fromStringParameterName( scope, "deploy-tools-account-id-parameter", - NAMED_SSM_PARAMETER_PATHS.DeployToolsAccountId.path, + NAMED_SSM_PARAMETER_PATHS.DeployToolsAccountId.path ); // See https://github.com/guardian/cognito-auth-lambdas for the source @@ -534,7 +534,7 @@ export class GuEc2App extends Construct { effect: Effect.ALLOW, actions: ["lambda:InvokeFunction"], resources: [gatekeeperFunctionArn], - }), + }) ); // Cognito user pool. We require both lambdas: pre-sign-up runs the first diff --git a/src/types/access.test.ts b/src/types/access.test.ts index 80c7042dee..b621fa7f33 100644 --- a/src/types/access.test.ts +++ b/src/types/access.test.ts @@ -19,7 +19,7 @@ describe("AppAccess.validate", () => { cidrRanges: [Peer.ipv4("1.2.3.4/21"), Peer.anyIpv4()], }); }).toThrowError( - `Restricted apps cannot be globally accessible. Adjust CIDR ranges (1.2.3.4/21, 0.0.0.0/0) or use Public.`, + `Restricted apps cannot be globally accessible. Adjust CIDR ranges (1.2.3.4/21, 0.0.0.0/0) or use Public.` ); }); @@ -39,7 +39,7 @@ describe("AppAccess.validate", () => { cidrRanges: [Peer.ipv4("10.0.0.0/0"), Peer.ipv4("1.2.3.4/21")], }); }).toThrowError( - `Internal apps should only be accessible on 10. ranges. Adjust CIDR ranges (10.0.0.0/0, 1.2.3.4/21) or use Restricted.`, + `Internal apps should only be accessible on 10. ranges. Adjust CIDR ranges (10.0.0.0/0, 1.2.3.4/21) or use Restricted.` ); }); }); diff --git a/src/types/access.ts b/src/types/access.ts index ee5da7566c..4d54a467f1 100644 --- a/src/types/access.ts +++ b/src/types/access.ts @@ -76,7 +76,7 @@ export const AppAccess = { if (ranges.includes(Peer.anyIpv4().uniqueId) || ranges.includes(Peer.anyIpv6().uniqueId)) { throw new Error( - `${AccessScope.RESTRICTED} apps cannot be globally accessible. Adjust CIDR ranges (${rangesString}) or use ${AccessScope.PUBLIC}.`, + `${AccessScope.RESTRICTED} apps cannot be globally accessible. Adjust CIDR ranges (${rangesString}) or use ${AccessScope.PUBLIC}.` ); } break; @@ -88,7 +88,7 @@ export const AppAccess = { if (ranges.some((range) => !range.startsWith("10."))) { throw new Error( - `${AccessScope.INTERNAL} apps should only be accessible on 10. ranges. Adjust CIDR ranges (${rangesString}) or use ${AccessScope.RESTRICTED}.`, + `${AccessScope.INTERNAL} apps should only be accessible on 10. ranges. Adjust CIDR ranges (${rangesString}) or use ${AccessScope.RESTRICTED}.` ); } break; diff --git a/src/utils/cli/vpc.ts b/src/utils/cli/vpc.ts index e7d7b58e33..d2897c8e70 100644 --- a/src/utils/cli/vpc.ts +++ b/src/utils/cli/vpc.ts @@ -6,7 +6,7 @@ import type { VpcInDetail } from "../../types/cli"; import { sum } from "../math"; export const primaryVpcSsmParameterPaths: string[] = ALL_SSM_PARAMETER_PATHS.map((_) => _.path).filter((_) => - _.startsWith(VPC_SSM_PARAMETER_PREFIX), + _.startsWith(VPC_SSM_PARAMETER_PREFIX) ); export const vpcSsmParameterPaths: RegExp[] = primaryVpcSsmParameterPaths.map((primaryPath) => { @@ -92,6 +92,6 @@ export const getVpcsInDetail = async (ec2Client: AWS.EC2): Promise, - port: Port | number, + port: Port | number ): SecurityGroupAccessRule[] => { return cidrBlocks.map(([key, value]) => { return {