@awsless/cli 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js
CHANGED
|
@@ -7237,6 +7237,7 @@ var iconFeature = defineFeature({
|
|
|
7237
7237
|
import { Group as Group26, Output as Output7, resolveInputs as resolveInputs4, findInputDeps as findInputDeps4 } from "@terraforge/core";
|
|
7238
7238
|
import { aws as aws27 } from "@terraforge/aws";
|
|
7239
7239
|
import { camelCase as camelCase8 } from "change-case";
|
|
7240
|
+
import deepmerge5 from "deepmerge";
|
|
7240
7241
|
import { relative as relative8 } from "path";
|
|
7241
7242
|
|
|
7242
7243
|
// src/feature/job/util.ts
|
|
@@ -7461,45 +7462,9 @@ var createFargateJob = (parentGroup, ctx, ns, id, local) => {
|
|
|
7461
7462
|
const variableDeps = /* @__PURE__ */ new Set();
|
|
7462
7463
|
const taskDependsOn = [code];
|
|
7463
7464
|
const accessPoint = props.persistentStorage ? (() => {
|
|
7464
|
-
const
|
|
7465
|
-
group,
|
|
7466
|
-
"persistent-storage-security-group",
|
|
7467
|
-
{
|
|
7468
|
-
name: shortId(`${shortName}:storage-sg`),
|
|
7469
|
-
description: name,
|
|
7470
|
-
vpcId: ctx.shared.get("vpc", "id"),
|
|
7471
|
-
revokeRulesOnDelete: true,
|
|
7472
|
-
tags
|
|
7473
|
-
}
|
|
7474
|
-
);
|
|
7475
|
-
new aws26.vpc.SecurityGroupIngressRule(group, "persistent-storage-ingress-rule", {
|
|
7476
|
-
securityGroupId: persistentStorageSecurityGroup.id,
|
|
7477
|
-
referencedSecurityGroupId: ctx.shared.get("job", "security-group-id"),
|
|
7478
|
-
description: "Allow NFS traffic from this job",
|
|
7479
|
-
ipProtocol: "tcp",
|
|
7480
|
-
fromPort: 2049,
|
|
7481
|
-
toPort: 2049,
|
|
7482
|
-
tags
|
|
7483
|
-
});
|
|
7484
|
-
const fileSystem = new aws26.efs.FileSystem(group, "persistent-storage-file-system", {
|
|
7485
|
-
encrypted: true,
|
|
7486
|
-
performanceMode: "generalPurpose",
|
|
7487
|
-
throughputMode: "elastic",
|
|
7488
|
-
tags: {
|
|
7489
|
-
...tags,
|
|
7490
|
-
Name: `${name}-storage`
|
|
7491
|
-
}
|
|
7492
|
-
});
|
|
7493
|
-
for (const [index, subnetId] of ctx.shared.get("vpc", "public-subnets").entries()) {
|
|
7494
|
-
const mountTarget = new aws26.efs.MountTarget(group, `mount-target-${index + 1}`, {
|
|
7495
|
-
fileSystemId: fileSystem.id,
|
|
7496
|
-
subnetId,
|
|
7497
|
-
securityGroups: [persistentStorageSecurityGroup.id]
|
|
7498
|
-
});
|
|
7499
|
-
taskDependsOn.push(mountTarget);
|
|
7500
|
-
}
|
|
7465
|
+
const fileSystemId = ctx.shared.get("job", "persistent-storage-file-system-id");
|
|
7501
7466
|
const accessPoint2 = new aws26.efs.AccessPoint(group, "access-point", {
|
|
7502
|
-
fileSystemId
|
|
7467
|
+
fileSystemId,
|
|
7503
7468
|
rootDirectory: {
|
|
7504
7469
|
path: `/jobs/${name}`,
|
|
7505
7470
|
creationInfo: {
|
|
@@ -7510,10 +7475,10 @@ var createFargateJob = (parentGroup, ctx, ns, id, local) => {
|
|
|
7510
7475
|
},
|
|
7511
7476
|
tags
|
|
7512
7477
|
});
|
|
7513
|
-
taskDependsOn.push(
|
|
7478
|
+
taskDependsOn.push(accessPoint2);
|
|
7514
7479
|
return {
|
|
7515
7480
|
accessPoint: accessPoint2,
|
|
7516
|
-
|
|
7481
|
+
fileSystemId
|
|
7517
7482
|
};
|
|
7518
7483
|
})() : void 0;
|
|
7519
7484
|
const task2 = new aws26.ecs.TaskDefinition(
|
|
@@ -7537,7 +7502,7 @@ var createFargateJob = (parentGroup, ctx, ns, id, local) => {
|
|
|
7537
7502
|
{
|
|
7538
7503
|
name: "persistent-storage",
|
|
7539
7504
|
efsVolumeConfiguration: {
|
|
7540
|
-
fileSystemId: accessPoint.
|
|
7505
|
+
fileSystemId: accessPoint.fileSystemId,
|
|
7541
7506
|
transitEncryption: "ENABLED",
|
|
7542
7507
|
authorizationConfig: {
|
|
7543
7508
|
accessPointId: accessPoint.accessPoint.id
|
|
@@ -7760,6 +7725,52 @@ var jobFeature = defineFeature({
|
|
|
7760
7725
|
}
|
|
7761
7726
|
});
|
|
7762
7727
|
ctx.shared.set("job", "security-group-id", securityGroup.id);
|
|
7728
|
+
const needsPersistentStorage = ctx.stackConfigs.some(
|
|
7729
|
+
(stack) => Object.values(stack.jobs ?? {}).some((job) => {
|
|
7730
|
+
const merged = deepmerge5(ctx.appConfig.defaults.job, job);
|
|
7731
|
+
return merged.persistentStorage;
|
|
7732
|
+
})
|
|
7733
|
+
);
|
|
7734
|
+
if (needsPersistentStorage) {
|
|
7735
|
+
const storageGroup = new Group26(ctx.base, "job", "persistent-storage");
|
|
7736
|
+
const storageSecurityGroup = new aws27.security.Group(storageGroup, "security-group", {
|
|
7737
|
+
name: `${ctx.app.name}-job-storage`,
|
|
7738
|
+
description: "Shared security group for job persistent storage",
|
|
7739
|
+
vpcId: ctx.shared.get("vpc", "id"),
|
|
7740
|
+
revokeRulesOnDelete: true,
|
|
7741
|
+
tags: {
|
|
7742
|
+
APP: ctx.appConfig.name
|
|
7743
|
+
}
|
|
7744
|
+
});
|
|
7745
|
+
new aws27.vpc.SecurityGroupIngressRule(storageGroup, "ingress-rule", {
|
|
7746
|
+
securityGroupId: storageSecurityGroup.id,
|
|
7747
|
+
referencedSecurityGroupId: securityGroup.id,
|
|
7748
|
+
description: "Allow NFS traffic from jobs",
|
|
7749
|
+
ipProtocol: "tcp",
|
|
7750
|
+
fromPort: 2049,
|
|
7751
|
+
toPort: 2049,
|
|
7752
|
+
tags: {
|
|
7753
|
+
APP: ctx.appConfig.name
|
|
7754
|
+
}
|
|
7755
|
+
});
|
|
7756
|
+
const fileSystem = new aws27.efs.FileSystem(storageGroup, "file-system", {
|
|
7757
|
+
encrypted: true,
|
|
7758
|
+
performanceMode: "generalPurpose",
|
|
7759
|
+
throughputMode: "elastic",
|
|
7760
|
+
tags: {
|
|
7761
|
+
APP: ctx.appConfig.name,
|
|
7762
|
+
Name: `${ctx.app.name}-job-storage`
|
|
7763
|
+
}
|
|
7764
|
+
});
|
|
7765
|
+
for (const [index, subnetId] of ctx.shared.get("vpc", "public-subnets").entries()) {
|
|
7766
|
+
new aws27.efs.MountTarget(storageGroup, `mount-target-${index + 1}`, {
|
|
7767
|
+
fileSystemId: fileSystem.id,
|
|
7768
|
+
subnetId,
|
|
7769
|
+
securityGroups: [storageSecurityGroup.id]
|
|
7770
|
+
});
|
|
7771
|
+
}
|
|
7772
|
+
ctx.shared.set("job", "persistent-storage-file-system-id", fileSystem.id);
|
|
7773
|
+
}
|
|
7763
7774
|
},
|
|
7764
7775
|
onStack(ctx) {
|
|
7765
7776
|
const jobs = Object.entries(ctx.stackConfig.jobs ?? {});
|
|
@@ -7820,7 +7831,7 @@ import { aws as aws28 } from "@terraforge/aws";
|
|
|
7820
7831
|
import { Group as Group27, Output as Output8, findInputDeps as findInputDeps5, resolveInputs as resolveInputs5 } from "@terraforge/core";
|
|
7821
7832
|
import { constantCase as constantCase13, pascalCase as pascalCase4 } from "change-case";
|
|
7822
7833
|
import { createHash as createHash6 } from "crypto";
|
|
7823
|
-
import
|
|
7834
|
+
import deepmerge6 from "deepmerge";
|
|
7824
7835
|
import { join as join19 } from "path";
|
|
7825
7836
|
|
|
7826
7837
|
// src/feature/instance/build/executable.ts
|
|
@@ -7883,7 +7894,7 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
|
|
|
7883
7894
|
resourceName: id
|
|
7884
7895
|
});
|
|
7885
7896
|
const shortName = shortId(`${ctx.app.name}:${ctx.stack.name}:${ns}:${id}:${ctx.appId}`);
|
|
7886
|
-
const props =
|
|
7897
|
+
const props = deepmerge6(ctx.appConfig.defaults.instance, local);
|
|
7887
7898
|
const image2 = props.image || (props.architecture === "arm64" ? "public.ecr.aws/aws-cli/aws-cli:arm64" : "public.ecr.aws/aws-cli/aws-cli:amd64");
|
|
7888
7899
|
ctx.registerBuild("instance", name, async (build3, { workspace }) => {
|
|
7889
7900
|
const fingerprint = await generateFileHash3(workspace, local.code.file);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -87,23 +87,23 @@
|
|
|
87
87
|
"zod": "^3.24.2",
|
|
88
88
|
"zod-to-json-schema": "^3.24.3",
|
|
89
89
|
"@awsless/big-float": "^0.1.6",
|
|
90
|
-
"@awsless/clui": "^0.0.8",
|
|
91
|
-
"@awsless/dynamodb": "^0.3.20",
|
|
92
90
|
"@awsless/cloudwatch": "^0.0.1",
|
|
91
|
+
"@awsless/clui": "^0.0.8",
|
|
93
92
|
"@awsless/duration": "^0.0.4",
|
|
93
|
+
"@awsless/dynamodb": "^0.3.20",
|
|
94
94
|
"@awsless/iot": "^0.0.5",
|
|
95
95
|
"@awsless/json": "^0.0.11",
|
|
96
96
|
"@awsless/lambda": "^0.0.42",
|
|
97
|
+
"@awsless/s3": "^0.0.21",
|
|
97
98
|
"@awsless/redis": "^0.0.16",
|
|
98
99
|
"@awsless/scheduler": "^0.0.4",
|
|
99
100
|
"@awsless/size": "^0.0.2",
|
|
100
|
-
"@awsless/sns": "^0.0.10",
|
|
101
101
|
"@awsless/sqs": "^0.0.21",
|
|
102
|
-
"@awsless/s3": "^0.0.21",
|
|
103
|
-
"@awsless/validate": "^0.1.7",
|
|
104
102
|
"@awsless/ts-file-cache": "^0.0.13",
|
|
103
|
+
"@awsless/validate": "^0.1.7",
|
|
105
104
|
"@awsless/weak-cache": "^0.0.1",
|
|
106
|
-
"awsless": "^0.0.3"
|
|
105
|
+
"awsless": "^0.0.3",
|
|
106
|
+
"@awsless/sns": "^0.0.10"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@hono/node-server": "1.19.9",
|