@awsless/cli 0.0.46-next.18 → 0.0.46-next.19

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
@@ -105365,9 +105365,9 @@ var createPubSubService = (parentGroup, ctx, id, props, inputs) => {
105365
105365
  taskDefinition: task2.arn,
105366
105366
  launchType: "FARGATE",
105367
105367
  networkConfiguration: {
105368
- subnets: ctx.shared.get("vpc", "public-subnets"),
105368
+ subnets: ctx.shared.get("vpc", "private-subnets"),
105369
105369
  securityGroups: [inputs.securityGroupId],
105370
- assignPublicIp: true
105370
+ assignPublicIp: false
105371
105371
  },
105372
105372
  loadBalancer: [
105373
105373
  {
@@ -106953,9 +106953,13 @@ var vpcFeature = defineFeature({
106953
106953
  public: publicRouteTable
106954
106954
  };
106955
106955
  let ipv6Identifier = 0;
106956
+ const subnetIdsByType = {
106957
+ private: [],
106958
+ public: []
106959
+ };
106956
106960
  for (const [_type, table3] of Object.entries(tables)) {
106957
106961
  const type = _type;
106958
- const subnetIds = [];
106962
+ const subnetIds = subnetIdsByType[type];
106959
106963
  for (const i in zones) {
106960
106964
  const index = Number(i) + 1;
106961
106965
  const id = `${type}-${index}`;
@@ -106982,6 +106986,26 @@ var vpcFeature = defineFeature({
106982
106986
  }
106983
106987
  ctx.shared.set("vpc", `${type}-subnets`, subnetIds);
106984
106988
  }
106989
+ const eip = new aws.Eip(group, "nat", {
106990
+ domain: "vpc",
106991
+ tags: {
106992
+ Name: ctx.app.name
106993
+ }
106994
+ });
106995
+ const natGateway = new aws.nat.Gateway(group, "nat", {
106996
+ allocationId: eip.allocationId,
106997
+ subnetId: subnetIdsByType.public[0],
106998
+ tags: {
106999
+ Name: ctx.app.name
107000
+ }
107001
+ }, {
107002
+ dependsOn: [attachment]
107003
+ });
107004
+ new aws.Route(group, "nat-ipv4", {
107005
+ routeTableId: privateRouteTable.id,
107006
+ destinationCidrBlock: "0.0.0.0/0",
107007
+ natGatewayId: natGateway.id
107008
+ });
106985
107009
  }
106986
107010
  });
106987
107011
 
@@ -107800,7 +107824,7 @@ var jobFeature = defineFeature({
107800
107824
  Name: `${ctx.app.name}-job-storage`
107801
107825
  }
107802
107826
  });
107803
- for (const [index, subnetId] of ctx.shared.get("vpc", "public-subnets").entries()) {
107827
+ for (const [index, subnetId] of ctx.shared.get("vpc", "private-subnets").entries()) {
107804
107828
  new aws.efs.MountTarget(storageGroup, `mount-target-${index + 1}`, {
107805
107829
  fileSystemId: fileSystem.id,
107806
107830
  subnetId,
@@ -107814,7 +107838,7 @@ var jobFeature = defineFeature({
107814
107838
  const jobs = Object.entries(ctx.stackConfig.jobs ?? {});
107815
107839
  if (jobs.length === 0)
107816
107840
  return;
107817
- const subnets = ctx.shared.get("vpc", "public-subnets");
107841
+ const subnets = ctx.shared.get("vpc", "private-subnets");
107818
107842
  ctx.addEnv("JOB_SUBNETS", new Output(new Set(findInputDeps(subnets)), async (resolve4) => {
107819
107843
  const resolved = await resolveInputs(subnets);
107820
107844
  resolve4(JSON.stringify(resolved));
@@ -108102,9 +108126,9 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
108102
108126
  desiredCount: 1,
108103
108127
  launchType: "FARGATE",
108104
108128
  networkConfiguration: {
108105
- subnets: ctx.shared.get("vpc", "public-subnets"),
108129
+ subnets: ctx.shared.get("vpc", "private-subnets"),
108106
108130
  securityGroups: [securityGroup.id],
108107
- assignPublicIp: true
108131
+ assignPublicIp: false
108108
108132
  },
108109
108133
  forceNewDeployment: true,
108110
108134
  forceDelete: true,
@@ -1,7 +1,7 @@
1
1
  // src/feature/bundle/server/handle.ts
2
2
  import { patch, unpatch } from "@awsless/json";
3
3
  import { ExpectedError, invoke, isErrorResponse } from "@awsless/lambda";
4
- import { formatRoutePayload, getCurrentRoute, withBundleRoute } from "awsless";
4
+ import { formatRoutePayload, getCurrentRoute, withBundleRouteContext } from "awsless";
5
5
 
6
6
  // src/feature/bundle/server/resource/util.ts
7
7
  var routeType = (route) => {
@@ -355,7 +355,7 @@ var createBundle = (handlers) => {
355
355
  throw new Error("Unknown bundle route: " + match2.key);
356
356
  }
357
357
  process.env.AWSLESS_ROUTE = match2.key;
358
- return withBundleRoute(match2.key, internalInvoke, async () => {
358
+ return withBundleRouteContext(match2.key, internalInvoke, async () => {
359
359
  const handle = await load();
360
360
  const routedContext = { ...context, route: match2.key };
361
361
  return handle(match2.payload ?? {}, routedContext);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/cli",
3
- "version": "0.0.46-next.18",
3
+ "version": "0.0.46-next.19",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -38,15 +38,15 @@
38
38
  "@awsless/ts-file-cache": "^0.0.16"
39
39
  },
40
40
  "peerDependencies": {
41
- "@awsless/validate": "^0.1.7",
42
- "@awsless/json": "^0.0.11",
43
41
  "@awsless/dynamodb": "^0.3.21",
44
- "@awsless/big-float": "^0.1.7",
45
- "@awsless/lambda": "^0.0.47",
46
- "@awsless/s3": "^0.0.22",
47
42
  "@awsless/duration": "^0.0.4",
43
+ "@awsless/json": "^0.0.11",
44
+ "@awsless/s3": "^0.0.22",
45
+ "@awsless/validate": "^0.1.7",
48
46
  "@awsless/weak-cache": "^0.0.1",
49
- "awsless": "^0.0.15-next.4"
47
+ "awsless": "^0.0.15-next.5",
48
+ "@awsless/big-float": "^0.1.7",
49
+ "@awsless/lambda": "^0.0.47"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@clack/prompts": "^0.7.0",
@@ -101,24 +101,24 @@
101
101
  "zod": "^3.24.2",
102
102
  "zod-to-json-schema": "^3.24.3",
103
103
  "@awsless/big-float": "^0.1.7",
104
- "@awsless/cloudwatch": "^0.0.1",
105
104
  "@awsless/clui": "^0.0.9",
105
+ "@awsless/cloudwatch": "^0.0.1",
106
+ "@awsless/duration": "^0.0.4",
106
107
  "@awsless/dynamodb": "^0.3.21",
107
- "@awsless/iot": "^0.0.5",
108
- "@awsless/json": "^0.0.11",
109
108
  "@awsless/lambda": "^0.0.47",
109
+ "@awsless/json": "^0.0.11",
110
+ "@awsless/iot": "^0.0.5",
110
111
  "@awsless/open-search": "^0.0.24",
112
+ "@awsless/s3": "^0.0.22",
113
+ "@awsless/redis": "^0.1.13",
114
+ "@awsless/size": "^0.0.2",
111
115
  "@awsless/scheduler": "^0.0.5",
112
116
  "@awsless/sns": "^0.0.11",
113
117
  "@awsless/sqs": "^0.0.24",
114
- "@awsless/redis": "^0.1.13",
118
+ "@awsless/ssm": "^0.0.8",
115
119
  "@awsless/validate": "^0.1.7",
116
- "@awsless/s3": "^0.0.22",
117
120
  "@awsless/weak-cache": "^0.0.1",
118
- "@awsless/ssm": "^0.0.8",
119
- "awsless": "^0.0.15-next.4",
120
- "@awsless/size": "^0.0.2",
121
- "@awsless/duration": "^0.0.4"
121
+ "awsless": "^0.0.15-next.5"
122
122
  },
123
123
  "scripts": {
124
124
  "test": "bun cli/build-handlers.ts && pnpm vitest",