@awsless/awsless 0.0.545 → 0.0.546

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
@@ -1153,7 +1153,7 @@ import { days as days3, toDays as toDays2 } from "@awsless/duration";
1153
1153
  import { toMebibytes } from "@awsless/size";
1154
1154
  import { z as z23 } from "zod";
1155
1155
  var CpuSchema = z23.union([z23.literal(0.25), z23.literal(0.5), z23.literal(1), z23.literal(2), z23.literal(4), z23.literal(8), z23.literal(16)]).transform((v) => `${v} vCPU`).describe(
1156
- "The number of virtual CPU units (vCPU) used by the task. For tasks using the Fargate launch type, this field is required. Valid values: 0.25, 0.5, 1, 2, 4, 8, 16 vCPU."
1156
+ "The number of virtual CPU units (vCPU) used by the instance. Valid values: 0.25, 0.5, 1, 2, 4, 8, 16 vCPU."
1157
1157
  );
1158
1158
  var validMemorySize = [
1159
1159
  // 0.25 vCPU
@@ -1191,9 +1191,7 @@ var validMemorySize = [
1191
1191
  var MemorySizeSchema2 = SizeSchema.refine(
1192
1192
  (s) => validMemorySize.includes(toMebibytes(s)),
1193
1193
  `Invalid memory size. Allowed sizes: ${validMemorySize.join(", ")} MiB`
1194
- ).describe(
1195
- "The amount of memory (in MiB) used by the task. For tasks using the Fargate launch type, this field is required and must be compatible with the CPU value. Valid memory values depend on the CPU configuration."
1196
- );
1194
+ ).describe("The amount of memory (in MiB) used by the instance. Valid memory values depend on the CPU configuration.");
1197
1195
  var HealthCheckSchema = z23.object({
1198
1196
  path: z23.string().describe("The path that the container runs to determine if it is healthy."),
1199
1197
  interval: DurationSchema.describe("The time period in seconds between each health check execution."),
@@ -1208,7 +1206,7 @@ var HealthCheckSchema = z23.object({
1208
1206
  )
1209
1207
  }).describe("The health check command and associated configuration parameters for the container.");
1210
1208
  var EnvironmentSchema2 = z23.record(z23.string(), z23.string()).optional().describe("Environment variable key-value pairs.");
1211
- var ArchitectureSchema3 = z23.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
1209
+ var ArchitectureSchema3 = z23.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the instance supports.");
1212
1210
  var ActionSchema2 = z23.string();
1213
1211
  var ActionsSchema2 = z23.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
1214
1212
  var ArnSchema2 = z23.string().startsWith("arn:");
@@ -1220,9 +1218,8 @@ var PermissionSchema2 = z23.object({
1220
1218
  actions: ActionsSchema2,
1221
1219
  resources: ResourcesSchema2
1222
1220
  });
1223
- var PermissionsSchema2 = z23.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your function.");
1224
- var MinifySchema2 = z23.boolean().describe("Minify the function code.");
1225
- var DescriptionSchema2 = z23.string().describe("A description of the function.");
1221
+ var PermissionsSchema2 = z23.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
1222
+ var DescriptionSchema2 = z23.string().describe("A description of the instance.");
1226
1223
  var ImageSchema = z23.string().optional().describe("The URL of the container image to use.");
1227
1224
  var validLogRetentionDays2 = [
1228
1225
  ...[1, 3, 5, 7, 14, 30, 60, 90, 120, 150],
@@ -1246,8 +1243,7 @@ var LogSchema2 = z23.union([
1246
1243
  })
1247
1244
  ]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
1248
1245
  var FileCodeSchema2 = z23.object({
1249
- file: LocalFileSchema.describe("The file path of the function code."),
1250
- minify: MinifySchema2.optional().default(true)
1246
+ file: LocalFileSchema.describe("The file path of the instance code.")
1251
1247
  });
1252
1248
  var CodeSchema2 = z23.union([
1253
1249
  LocalFileSchema.transform((file) => ({
@@ -6401,6 +6397,18 @@ var imageFeature = defineFeature({
6401
6397
  name,
6402
6398
  defaultTtl: toSeconds8(days7(365))
6403
6399
  });
6400
+ const responseHeaders = new $23.aws.cloudfront.ResponseHeadersPolicy(group, "response", {
6401
+ name,
6402
+ corsConfig: {
6403
+ originOverride: true,
6404
+ accessControlMaxAgeSec: toSeconds8(days7(365)),
6405
+ accessControlAllowHeaders: { items: ["*"] },
6406
+ accessControlAllowMethods: { items: ["ALL"] },
6407
+ accessControlAllowOrigins: { items: ["*"] },
6408
+ accessControlExposeHeaders: { items: ["*"] },
6409
+ accessControlAllowCredentials: false
6410
+ }
6411
+ });
6404
6412
  const distribution = new $23.aws.cloudfront.Distribution(group, "distribution", {
6405
6413
  comment: name,
6406
6414
  enabled: true,
@@ -6456,6 +6464,7 @@ var imageFeature = defineFeature({
6456
6464
  compress: true,
6457
6465
  targetOriginId: "group",
6458
6466
  cachePolicyId: cache.id,
6467
+ responseHeadersPolicyId: responseHeaders.id,
6459
6468
  viewerProtocolPolicy: "redirect-to-https",
6460
6469
  allowedMethods: ["GET", "HEAD"],
6461
6470
  cachedMethods: ["GET", "HEAD"]
@@ -6956,8 +6965,8 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
6956
6965
  const tags = {
6957
6966
  APP: ctx.appConfig.name,
6958
6967
  APP_ID: ctx.appId,
6959
- STACK: ctx.stackConfig.name,
6960
- CODE_HASH: code.sourceHash.pipe((v) => v)
6968
+ STACK: ctx.stackConfig.name
6969
+ // CODE_HASH: code.sourceHash.pipe<string>(v => v!),
6961
6970
  };
6962
6971
  const variables = {};
6963
6972
  const task2 = new $25.aws.ecs.TaskDefinition(
@@ -6965,7 +6974,6 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
6965
6974
  "task",
6966
6975
  {
6967
6976
  family: name,
6968
- // family: 'test',
6969
6977
  networkMode: "awsvpc",
6970
6978
  cpu: props.cpu,
6971
6979
  memory: toMebibytes4(props.memorySize).toString(),
@@ -6976,8 +6984,7 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
6976
6984
  cpuArchitecture: constantCase14(props.architecture),
6977
6985
  operatingSystemFamily: "LINUX"
6978
6986
  },
6979
- // trackLatest: false,
6980
- // skipDestroy: true,
6987
+ trackLatest: true,
6981
6988
  containerDefinitions: new Future4(async (resolve) => {
6982
6989
  const data = await resolveInputs3(variables);
6983
6990
  const { s3Bucket, s3Key } = await resolveInputs3({
@@ -7046,14 +7053,22 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
7046
7053
  tags
7047
7054
  },
7048
7055
  {
7056
+ replaceOnChanges: [
7057
+ "containerDefinitions",
7058
+ "cpu",
7059
+ "memory",
7060
+ "runtimePlatform",
7061
+ "executionRoleArn",
7062
+ "taskRoleArn"
7063
+ ],
7049
7064
  dependsOn: [code]
7050
7065
  }
7051
7066
  );
7052
- return;
7053
7067
  const securityGroup = new $25.aws.security.Group(group, "security-group", {
7054
7068
  name,
7055
7069
  description: "Security group for the instance",
7056
7070
  vpcId: ctx.shared.get("vpc", "id"),
7071
+ revokeRulesOnDelete: true,
7057
7072
  tags
7058
7073
  });
7059
7074
  new $25.aws.vpc.SecurityGroupIngressRule(group, "ingress-rule-http", {
@@ -7109,9 +7124,6 @@ var createFargateTask = (parentGroup, ctx, ns, id, local) => {
7109
7124
  // rollback: true,
7110
7125
  // },
7111
7126
  // deploymentController: { type: 'ECS' },
7112
- triggers: {
7113
- redeployment: (/* @__PURE__ */ new Date()).toISOString()
7114
- },
7115
7127
  tags
7116
7128
  // The internal url (dnsName) doesn't work for ldambda's
7117
7129
  // https://github.com/aws/containers-roadmap/issues/1960
@@ -545,7 +545,7 @@ import { days as days3, toDays as toDays2 } from "@awsless/duration";
545
545
  import { toMebibytes } from "@awsless/size";
546
546
  import { z as z20 } from "zod";
547
547
  var CpuSchema = z20.union([z20.literal(0.25), z20.literal(0.5), z20.literal(1), z20.literal(2), z20.literal(4), z20.literal(8), z20.literal(16)]).transform((v) => `${v} vCPU`).describe(
548
- "The number of virtual CPU units (vCPU) used by the task. For tasks using the Fargate launch type, this field is required. Valid values: 0.25, 0.5, 1, 2, 4, 8, 16 vCPU."
548
+ "The number of virtual CPU units (vCPU) used by the instance. Valid values: 0.25, 0.5, 1, 2, 4, 8, 16 vCPU."
549
549
  );
550
550
  var validMemorySize = [
551
551
  // 0.25 vCPU
@@ -583,9 +583,7 @@ var validMemorySize = [
583
583
  var MemorySizeSchema2 = SizeSchema.refine(
584
584
  (s) => validMemorySize.includes(toMebibytes(s)),
585
585
  `Invalid memory size. Allowed sizes: ${validMemorySize.join(", ")} MiB`
586
- ).describe(
587
- "The amount of memory (in MiB) used by the task. For tasks using the Fargate launch type, this field is required and must be compatible with the CPU value. Valid memory values depend on the CPU configuration."
588
- );
586
+ ).describe("The amount of memory (in MiB) used by the instance. Valid memory values depend on the CPU configuration.");
589
587
  var HealthCheckSchema = z20.object({
590
588
  path: z20.string().describe("The path that the container runs to determine if it is healthy."),
591
589
  interval: DurationSchema.describe("The time period in seconds between each health check execution."),
@@ -600,7 +598,7 @@ var HealthCheckSchema = z20.object({
600
598
  )
601
599
  }).describe("The health check command and associated configuration parameters for the container.");
602
600
  var EnvironmentSchema2 = z20.record(z20.string(), z20.string()).optional().describe("Environment variable key-value pairs.");
603
- var ArchitectureSchema3 = z20.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
601
+ var ArchitectureSchema3 = z20.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the instance supports.");
604
602
  var ActionSchema2 = z20.string();
605
603
  var ActionsSchema2 = z20.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
606
604
  var ArnSchema2 = z20.string().startsWith("arn:");
@@ -612,9 +610,8 @@ var PermissionSchema2 = z20.object({
612
610
  actions: ActionsSchema2,
613
611
  resources: ResourcesSchema2
614
612
  });
615
- var PermissionsSchema2 = z20.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your function.");
616
- var MinifySchema2 = z20.boolean().describe("Minify the function code.");
617
- var DescriptionSchema2 = z20.string().describe("A description of the function.");
613
+ var PermissionsSchema2 = z20.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
614
+ var DescriptionSchema2 = z20.string().describe("A description of the instance.");
618
615
  var ImageSchema = z20.string().optional().describe("The URL of the container image to use.");
619
616
  var validLogRetentionDays2 = [
620
617
  ...[1, 3, 5, 7, 14, 30, 60, 90, 120, 150],
@@ -638,8 +635,7 @@ var LogSchema2 = z20.union([
638
635
  })
639
636
  ]).describe("Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time.");
640
637
  var FileCodeSchema2 = z20.object({
641
- file: LocalFileSchema.describe("The file path of the function code."),
642
- minify: MinifySchema2.optional().default(true)
638
+ file: LocalFileSchema.describe("The file path of the instance code.")
643
639
  });
644
640
  var CodeSchema2 = z20.union([
645
641
  LocalFileSchema.transform((file) => ({
@@ -1 +1 @@
1
- 335545401eb807d040031352ed637833c4aba83e
1
+ 7c5adbe4ad1276b196803a85ebc100c075505ab5
Binary file
@@ -1 +1 @@
1
- 77d5c40c76a204153d51f02737dfbfb9568c0601
1
+ ef2b6fd90bd8357553ef37365f1be78f40d03ed6
Binary file
@@ -1 +1 @@
1
- 086d41e23cf9435145f194134c7ffa5de7465470
1
+ d1258c2679b1f5ce95dd7c9c463ab8518a1160f8
Binary file