diff --git a/packages/aws-application/app/elsa-data-application-construct.ts b/packages/aws-application/app/elsa-data-application-construct.ts index 5afd7be..aa76d63 100644 --- a/packages/aws-application/app/elsa-data-application-construct.ts +++ b/packages/aws-application/app/elsa-data-application-construct.ts @@ -361,7 +361,7 @@ export class ElsaDataApplicationConstruct extends Construct { ): Function { const entry = path.join(__dirname, "./command-lambda/index.mjs"); - const f = new NodejsFunction(this, "api", { + const f = new NodejsFunction(this, "CommandLambda", { entry: entry, memorySize: 128, timeout: Duration.minutes(14), @@ -386,41 +386,6 @@ export class ElsaDataApplicationConstruct extends Construct { }, }); - /*const dockerImageFolder = path.join( - __dirname, - "../../../artifacts/elsa-data-command-invoke-lambda-docker-image" - ); - - // NOTE whilst we use the VPC information to communicate to the lambda - // how to execute fargate Tasks - the lambda itself *is not* put inside the VPC - // (it was taking ages to tear down the CDK stack - and it didn't feel necessary - // as it doesn't talk to the databases or anything) - - // this command lambda does almost nothing itself - all it does is trigger the creation of - // a fargate task and then tracks that to completion - and returns the logs path - // so it needs very little memory - but up to 14 mins runtime as sometimes the fargate - // tasks are a bit slow - const f2 = new DockerImageFunction(this, "CommandLambda", { - memorySize: 128, - code: DockerImageCode.fromImageAsset(dockerImageFolder), - timeout: Duration.minutes(14), - environment: { - CLUSTER_ARN: cluster.clusterArn, - CLUSTER_LOG_GROUP_NAME: clusterLogGroup.logGroupName, - TASK_DEFINITION_ARN: taskDefinition.taskDefinitionArn, - CONTAINER_NAME: FIXED_CONTAINER_NAME, - // we are passing to the lambda the subnets and security groups that need to be used - // by the Fargate task it will invoke - SUBNETS: vpc - .selectSubnets(subnetSelection) - .subnets.map((s) => s.subnetId) - .join(",")!, - SECURITY_GROUPS: taskSecurityGroups - .map((sg) => sg.securityGroupId) - .join(",")!, - }, - });*/ - f.role?.attachInlinePolicy( new Policy(this, "CommandTasksPolicy", { statements: [ diff --git a/packages/aws-application/elsa-data-stack.ts b/packages/aws-application/elsa-data-stack.ts index 2baa230..4542715 100644 --- a/packages/aws-application/elsa-data-stack.ts +++ b/packages/aws-application/elsa-data-stack.ts @@ -5,7 +5,7 @@ import { ElsaDataStackSettings } from "./elsa-data-stack-settings"; import { StringParameter } from "aws-cdk-lib/aws-ssm"; import { Secret } from "aws-cdk-lib/aws-secretsmanager"; import { Bucket } from "aws-cdk-lib/aws-s3"; -import { ElsaDataInfrastructureClient } from "@umccr/elsa-data-aws-infrastructure-client"; +import { InfrastructureClient } from "@elsa-data/aws-infrastructure-client"; export { ElsaDataStackSettings, @@ -55,7 +55,7 @@ export class ElsaDataStack extends Stack { return returnLookupValue; }; - const infraClient = new ElsaDataInfrastructureClient( + const infraClient = new InfrastructureClient( applicationProps.infrastructureStackName ); diff --git a/packages/aws-application/package.json b/packages/aws-application/package.json index b56364a..7166a98 100644 --- a/packages/aws-application/package.json +++ b/packages/aws-application/package.json @@ -31,11 +31,13 @@ "constructs": "^10.2.70" }, "devDependencies": { + "@types/node": "18.15.3", "aws-cdk": "2.93.0", "aws-cdk-lib": "2.93.0", "@aws-cdk/aws-apprunner-alpha": "2.93.0-alpha.0", "@elsa-data/aws-infrastructure-client": "1.2.3", "constructs": "10.2.70", + "esbuild": "0.19.2", "jsii": "5.1.12", "jsii-pacmak": "1.88.0", "prettier": "3.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 78ac8c8..20824ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,6 +53,9 @@ importers: "@elsa-data/aws-infrastructure-client": specifier: 1.2.3 version: 1.2.3(aws-cdk-lib@2.93.0)(constructs@10.2.70) + "@types/node": + specifier: 18.15.3 + version: 18.15.3 aws-cdk: specifier: 2.93.0 version: 2.93.0 @@ -62,6 +65,9 @@ importers: constructs: specifier: 10.2.70 version: 10.2.70 + esbuild: + specifier: 0.19.2 + version: 0.19.2 jsii: specifier: 5.1.12 version: 5.1.12 @@ -747,7 +753,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: false optional: true /@esbuild/android-arm@0.19.2: @@ -759,7 +764,6 @@ packages: cpu: [arm] os: [android] requiresBuild: true - dev: false optional: true /@esbuild/android-x64@0.19.2: @@ -771,7 +775,6 @@ packages: cpu: [x64] os: [android] requiresBuild: true - dev: false optional: true /@esbuild/darwin-arm64@0.19.2: @@ -783,7 +786,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: false optional: true /@esbuild/darwin-x64@0.19.2: @@ -795,7 +797,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: false optional: true /@esbuild/freebsd-arm64@0.19.2: @@ -807,7 +808,6 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true - dev: false optional: true /@esbuild/freebsd-x64@0.19.2: @@ -819,7 +819,6 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true - dev: false optional: true /@esbuild/linux-arm64@0.19.2: @@ -831,7 +830,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-arm@0.19.2: @@ -843,7 +841,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-ia32@0.19.2: @@ -855,7 +852,6 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-loong64@0.19.2: @@ -867,7 +863,6 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-mips64el@0.19.2: @@ -879,7 +874,6 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-ppc64@0.19.2: @@ -891,7 +885,6 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-riscv64@0.19.2: @@ -903,7 +896,6 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-s390x@0.19.2: @@ -915,7 +907,6 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-x64@0.19.2: @@ -927,7 +918,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/netbsd-x64@0.19.2: @@ -939,7 +929,6 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true - dev: false optional: true /@esbuild/openbsd-x64@0.19.2: @@ -951,7 +940,6 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true - dev: false optional: true /@esbuild/sunos-x64@0.19.2: @@ -963,7 +951,6 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true - dev: false optional: true /@esbuild/win32-arm64@0.19.2: @@ -975,7 +962,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: false optional: true /@esbuild/win32-ia32@0.19.2: @@ -987,7 +973,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: false optional: true /@esbuild/win32-x64@0.19.2: @@ -999,7 +984,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: false optional: true /@jridgewell/resolve-uri@3.1.1: @@ -1571,6 +1555,13 @@ packages: "@types/node": 18.17.12 dev: true + /@types/node@18.15.3: + resolution: + { + integrity: sha512-p6ua9zBxz5otCmbpb5D3U4B5Nanw6Pk3PPyX05xnxbB/fRv71N7CPmORg7uAD5P70T0xmx1pzAx/FUfa5X+3cw==, + } + dev: true + /@types/node@18.17.12: resolution: { @@ -1972,7 +1963,6 @@ packages: "@esbuild/win32-arm64": 0.19.2 "@esbuild/win32-ia32": 0.19.2 "@esbuild/win32-x64": 0.19.2 - dev: false /escalade@3.1.1: resolution: