Skip to content

Commit

Permalink
Merge pull request #14 from elsa-data/feature/bump-pre-commits
Browse files Browse the repository at this point in the history
Bumped pre-commits and re-ran
  • Loading branch information
andrewpatto authored Nov 14, 2023
2 parents fcf732c + 0629b88 commit 39dfb0e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.1.0
hooks:
- id: prettier

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class CanWriteLambdaStepConstruct extends Construct {
"s3:ResourceAccount": [Stack.of(this).account],
},
},
})
}),
);

this.invocableLambda = new LambdaInvoke(
Expand All @@ -64,7 +64,7 @@ export class CanWriteLambdaStepConstruct extends Construct {
{
lambdaFunction: canWriteLambda,
resultPath: JsonPath.DISCARD,
}
},
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class CopyOutStateMachineConstruct extends Construct {
vpc: props.vpc,
vpcSubnetSelection: props.vpcSubnetSelection,
requiredRegion: Stack.of(this).region,
}
},
);

const rcloneRunTask = new FargateRunTaskConstruct(
Expand All @@ -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
Expand All @@ -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),
),
});

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -170,24 +170,24 @@ export class CopyOutStateMachineConstruct extends Construct {
effect: Effect.ALLOW,
actions: ["lambda:InvokeFunction"],
resources: ["*"],
})
}),
);

this.stateMachine.addToRolePolicy(
new PolicyStatement({
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", {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class DistributedMapStepConstruct extends Construct {
BatchInput: {
"destinationBucketForRclone.$": JsonPath.format(
"s3:{}",
JsonPath.stringAt("$.destinationBucket")
JsonPath.stringAt("$.destinationBucket"),
),
},
},
Expand All @@ -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}`),
),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down Expand Up @@ -101,7 +101,7 @@ export class FargateRunTaskConstruct extends Construct {
{
name: "destination",
value: JsonPath.stringAt(
"$.BatchInput.destinationBucketForRclone"
"$.BatchInput.destinationBucketForRclone",
),
},
],
Expand All @@ -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");
Expand Down

0 comments on commit 39dfb0e

Please sign in to comment.