From 0629b88591c1b4253c66eec2c709b6043dd62711 Mon Sep 17 00:00:00 2001 From: andrewpatto Date: Tue, 14 Nov 2023 15:26:24 +1100 Subject: [PATCH] Bumped pre-commits and re-ran --- .pre-commit-config.yaml | 4 +-- .../can-write-lambda-step-construct.ts | 4 +-- .../can-write-lambda/can-write-lambda.js | 2 +- .../copy-out-state-machine-construct.ts | 26 +++++++++---------- .../distributed-map-step-construct.ts | 4 +-- .../construct/fargate-run-task-construct.ts | 6 ++--- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9fee943..52dc710 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.5.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -8,7 +8,7 @@ repos: - id: check-added-large-files - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + rev: v3.1.0 hooks: - id: prettier diff --git a/packages/aws-copy-out-sharer/construct/can-write-lambda-step-construct.ts b/packages/aws-copy-out-sharer/construct/can-write-lambda-step-construct.ts index 8368862..a8fd2be 100644 --- a/packages/aws-copy-out-sharer/construct/can-write-lambda-step-construct.ts +++ b/packages/aws-copy-out-sharer/construct/can-write-lambda-step-construct.ts @@ -55,7 +55,7 @@ export class CanWriteLambdaStepConstruct extends Construct { "s3:ResourceAccount": [Stack.of(this).account], }, }, - }) + }), ); this.invocableLambda = new LambdaInvoke( @@ -64,7 +64,7 @@ export class CanWriteLambdaStepConstruct extends Construct { { lambdaFunction: canWriteLambda, resultPath: JsonPath.DISCARD, - } + }, ); } } diff --git a/packages/aws-copy-out-sharer/construct/can-write-lambda/can-write-lambda.js b/packages/aws-copy-out-sharer/construct/can-write-lambda/can-write-lambda.js index 1a8b784..e4646e6 100644 --- a/packages/aws-copy-out-sharer/construct/can-write-lambda/can-write-lambda.js +++ b/packages/aws-copy-out-sharer/construct/can-write-lambda/can-write-lambda.js @@ -31,7 +31,7 @@ export const handler = async (event) => { } catch (e) { if (e.Code === "PermanentRedirect") throw new WrongRegionError( - "S3 Put failed because bucket was in the wrong region" + "S3 Put failed because bucket was in the wrong region", ); if (e.Code === "AccessDenied") diff --git a/packages/aws-copy-out-sharer/construct/copy-out-state-machine-construct.ts b/packages/aws-copy-out-sharer/construct/copy-out-state-machine-construct.ts index def6054..e66ae22 100644 --- a/packages/aws-copy-out-sharer/construct/copy-out-state-machine-construct.ts +++ b/packages/aws-copy-out-sharer/construct/copy-out-state-machine-construct.ts @@ -46,7 +46,7 @@ export class CopyOutStateMachineConstruct extends Construct { vpc: props.vpc, vpcSubnetSelection: props.vpcSubnetSelection, requiredRegion: Stack.of(this).region, - } + }, ); const rcloneRunTask = new FargateRunTaskConstruct( @@ -55,7 +55,7 @@ export class CopyOutStateMachineConstruct extends Construct { { fargateCluster: props.fargateCluster, vpcSubnetSelection: props.vpcSubnetSelection, - } + }, ).ecsRunTask; // our task is an idempotent copy operation so we can retry if we happen to get killed @@ -70,14 +70,14 @@ export class CopyOutStateMachineConstruct extends Construct { "MapStep", { task: rcloneRunTask, - } + }, ).distributedMapStep; const canWriteStep = canWriteLambdaStep.invocableLambda; const waitStep = new Wait(this, "Wait X Minutes", { time: WaitTime.duration( - props.aggressiveTimes ? Duration.seconds(30) : Duration.minutes(10) + props.aggressiveTimes ? Duration.seconds(30) : Duration.minutes(10), ), }); @@ -113,7 +113,7 @@ export class CopyOutStateMachineConstruct extends Construct { .next(applyDefaults) .next(canWriteStep) .next(distributedMapStep) - .next(success) + .next(success), ); // NOTE: we use a technique here to allow optional input parameters to the state machine @@ -138,10 +138,10 @@ export class CopyOutStateMachineConstruct extends Construct { resource: "stateMachine", resourceName: "*", }, - Stack.of(this) + Stack.of(this), ), ], - }) + }), ); // this is needed to support distributed map - once there is a native CDK for this I presume this goes @@ -157,10 +157,10 @@ export class CopyOutStateMachineConstruct extends Construct { resource: "execution", resourceName: "*" + "/*", }, - Stack.of(this) + Stack.of(this), ), ], - }) + }), ); // this is too broad - but once the CFN native Distributed Map is created - it will handle this for us @@ -170,7 +170,7 @@ export class CopyOutStateMachineConstruct extends Construct { effect: Effect.ALLOW, actions: ["lambda:InvokeFunction"], resources: ["*"], - }) + }), ); this.stateMachine.addToRolePolicy( @@ -178,16 +178,16 @@ export class CopyOutStateMachineConstruct extends Construct { effect: Effect.ALLOW, actions: ["ecs:*", "iam:PassRole"], resources: ["*"], - }) + }), ); // TODO tighten this this.stateMachine.role.addManagedPolicy( - ManagedPolicy.fromAwsManagedPolicyName("AmazonS3FullAccess") + ManagedPolicy.fromAwsManagedPolicyName("AmazonS3FullAccess"), ); this.stateMachine.role.addManagedPolicy( - ManagedPolicy.fromAwsManagedPolicyName("CloudWatchEventsFullAccess") + ManagedPolicy.fromAwsManagedPolicyName("CloudWatchEventsFullAccess"), ); props.namespaceService.registerNonIpInstance("StateMachine", { diff --git a/packages/aws-copy-out-sharer/construct/distributed-map-step-construct.ts b/packages/aws-copy-out-sharer/construct/distributed-map-step-construct.ts index 543a2cf..0e6e2d0 100644 --- a/packages/aws-copy-out-sharer/construct/distributed-map-step-construct.ts +++ b/packages/aws-copy-out-sharer/construct/distributed-map-step-construct.ts @@ -70,7 +70,7 @@ export class DistributedMapStepConstruct extends Construct { BatchInput: { "destinationBucketForRclone.$": JsonPath.format( "s3:{}", - JsonPath.stringAt("$.destinationBucket") + JsonPath.stringAt("$.destinationBucket"), ), }, }, @@ -86,7 +86,7 @@ export class DistributedMapStepConstruct extends Construct { // note: this is not an s3:// URL, it is the peculiar syntax used by rclone "s3:{}/{}", JsonPath.stringAt(`$$.Map.Item.Value.${bucketColumnName}`), - JsonPath.stringAt(`$$.Map.Item.Value.${keyColumnName}`) + JsonPath.stringAt(`$$.Map.Item.Value.${keyColumnName}`), ), }, }, diff --git a/packages/aws-copy-out-sharer/construct/fargate-run-task-construct.ts b/packages/aws-copy-out-sharer/construct/fargate-run-task-construct.ts index 3084fd9..a2d02e0 100644 --- a/packages/aws-copy-out-sharer/construct/fargate-run-task-construct.ts +++ b/packages/aws-copy-out-sharer/construct/fargate-run-task-construct.ts @@ -49,7 +49,7 @@ export class FargateRunTaskConstruct extends Construct { // we need to give the rclone task the ability to do the copy out in S3 // TODO can we limit this to reading from our designated buckets and writing out taskDefinition.taskRole.addManagedPolicy( - ManagedPolicy.fromAwsManagedPolicyName("AmazonS3FullAccess") + ManagedPolicy.fromAwsManagedPolicyName("AmazonS3FullAccess"), ); const containerDefinition = taskDefinition.addContainer("RcloneContainer", { @@ -101,7 +101,7 @@ export class FargateRunTaskConstruct extends Construct { { name: "destination", value: JsonPath.stringAt( - "$.BatchInput.destinationBucketForRclone" + "$.BatchInput.destinationBucketForRclone", ), }, ], @@ -119,7 +119,7 @@ class EcsFargateSpotOnlyLaunchTarget implements IEcsLaunchTarget { */ public bind( _task: EcsRunTask, - launchTargetOptions: LaunchTargetBindOptions + launchTargetOptions: LaunchTargetBindOptions, ): EcsLaunchTargetConfig { if (!launchTargetOptions.taskDefinition.isFargateCompatible) { throw new Error("Supplied TaskDefinition is not compatible with Fargate");