@awsless/awsless 0.0.282 → 0.0.284

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
@@ -755,6 +755,18 @@ var CommandSchema = z12.string().describe(`The script you want to execute when t
755
755
  var CodeSchema = LocalDirectorySchema.describe(`The code directory that will be deployed to your instance.`);
756
756
  var ConnectSchema = z12.boolean().describe("Allows you to connect to all instances with an Instance Connect Endpoint.");
757
757
  var EnvironmentSchema2 = z12.record(z12.string(), z12.string()).optional().describe("Environment variable key-value pairs.");
758
+ var ActionSchema2 = z12.string();
759
+ var ActionsSchema2 = z12.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
760
+ var ArnSchema2 = z12.string().startsWith("arn:");
761
+ var WildcardSchema2 = z12.literal("*");
762
+ var ResourceSchema2 = z12.union([ArnSchema2, WildcardSchema2]).transform((v) => v);
763
+ var ResourcesSchema2 = z12.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
764
+ var PermissionSchema2 = z12.object({
765
+ effect: z12.enum(["allow", "deny"]).default("allow"),
766
+ actions: ActionsSchema2,
767
+ resources: ResourcesSchema2
768
+ });
769
+ var PermissionsSchema2 = z12.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
758
770
  var InstanceDefaultSchema = z12.object({
759
771
  connect: ConnectSchema.default(false)
760
772
  }).default({}).describe("Define the default settings for all instances in your stacks.");
@@ -766,7 +778,8 @@ var InstancesSchema = z12.record(
766
778
  code: CodeSchema,
767
779
  user: z12.string().default("ec2-user"),
768
780
  command: CommandSchema.optional(),
769
- environment: EnvironmentSchema2.optional()
781
+ environment: EnvironmentSchema2.optional(),
782
+ permissions: PermissionsSchema2.optional()
770
783
  })
771
784
  ).optional().describe("Define the instances in your stack.");
772
785
 
@@ -1044,17 +1057,12 @@ var PubSubSchema = z22.record(
1044
1057
  ).optional().describe("Define the pubsub subscriber in your stack.");
1045
1058
 
1046
1059
  // src/feature/search/schema.ts
1047
- import { z as z23 } from "zod";
1048
1060
  import { gibibytes as gibibytes2 } from "@awsless/size";
1061
+ import { z as z23 } from "zod";
1049
1062
  var VersionSchema = z23.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
1050
1063
  var TypeSchema3 = z23.enum([
1051
1064
  "t3.small",
1052
1065
  "t3.medium",
1053
- "t3.large",
1054
- "t3.xlarge",
1055
- "t3.2xlarge",
1056
- "t4g.small",
1057
- "t4g.medium",
1058
1066
  "m3.medium",
1059
1067
  "m3.large",
1060
1068
  "m3.xlarge",
@@ -1100,21 +1108,6 @@ var TypeSchema3 = z23.enum([
1100
1108
  "r3.8xlarge",
1101
1109
  "i2.xlarge",
1102
1110
  "i2.2xlarge",
1103
- "d2.xlarge",
1104
- "d2.2xlarge",
1105
- "d2.4xlarge",
1106
- "d2.8xlarge",
1107
- "c4.large",
1108
- "c4.xlarge",
1109
- "c4.2xlarge",
1110
- "c4.4xlarge",
1111
- "c4.8xlarge",
1112
- "r4.large",
1113
- "r4.xlarge",
1114
- "r4.2xlarge",
1115
- "r4.4xlarge",
1116
- "r4.8xlarge",
1117
- "r4.16xlarge",
1118
1111
  "i3.large",
1119
1112
  "i3.xlarge",
1120
1113
  "i3.2xlarge",
@@ -1133,12 +1126,6 @@ var TypeSchema3 = z23.enum([
1133
1126
  "m6g.4xlarge",
1134
1127
  "m6g.8xlarge",
1135
1128
  "m6g.12xlarge",
1136
- "c6g.large",
1137
- "c6g.xlarge",
1138
- "c6g.2xlarge",
1139
- "c6g.4xlarge",
1140
- "c6g.8xlarge",
1141
- "c6g.12xlarge",
1142
1129
  "r6gd.large",
1143
1130
  "r6gd.xlarge",
1144
1131
  "r6gd.2xlarge",
@@ -3598,6 +3585,9 @@ var instanceFeature = defineFeature({
3598
3585
  actions: ["s3:GetObject", "s3:ListObjects", "s3:ListObjectsV2", "s3:HeadObject"],
3599
3586
  resources: [bucketName.apply((bucket) => `arn:aws:s3:::${bucket}/${name}`)]
3600
3587
  });
3588
+ if (props.permissions) {
3589
+ policy.addStatement(...props.permissions);
3590
+ }
3601
3591
  ctx.registerPolicy(policy);
3602
3592
  const profile = new aws10.iam.InstanceProfile(group, "profile", {
3603
3593
  name,
@@ -3906,7 +3896,7 @@ var searchFeature = defineFeature({
3906
3896
  for (const [id, props] of Object.entries(ctx.stackConfig.searchs ?? {})) {
3907
3897
  const group = new Node14(ctx.stack, "search", id);
3908
3898
  const openSearch = new aws15.openSearch.Domain(group, "domain", {
3909
- // name: formatLocalResourceName(ctx.app.name, ctx.stack.name, this.name, id),
3899
+ name: shortId([ctx.app.name, ctx.stack.name, this.name, id].join("--")),
3910
3900
  version: props.version,
3911
3901
  storageSize: props.storage,
3912
3902
  instance: {
@@ -475,6 +475,18 @@ var CommandSchema = z15.string().describe(`The script you want to execute when t
475
475
  var CodeSchema = LocalDirectorySchema.describe(`The code directory that will be deployed to your instance.`);
476
476
  var ConnectSchema = z15.boolean().describe("Allows you to connect to all instances with an Instance Connect Endpoint.");
477
477
  var EnvironmentSchema2 = z15.record(z15.string(), z15.string()).optional().describe("Environment variable key-value pairs.");
478
+ var ActionSchema2 = z15.string();
479
+ var ActionsSchema2 = z15.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
480
+ var ArnSchema2 = z15.string().startsWith("arn:");
481
+ var WildcardSchema2 = z15.literal("*");
482
+ var ResourceSchema2 = z15.union([ArnSchema2, WildcardSchema2]).transform((v) => v);
483
+ var ResourcesSchema2 = z15.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
484
+ var PermissionSchema2 = z15.object({
485
+ effect: z15.enum(["allow", "deny"]).default("allow"),
486
+ actions: ActionsSchema2,
487
+ resources: ResourcesSchema2
488
+ });
489
+ var PermissionsSchema2 = z15.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
478
490
  var InstanceDefaultSchema = z15.object({
479
491
  connect: ConnectSchema.default(false)
480
492
  }).default({}).describe("Define the default settings for all instances in your stacks.");
@@ -486,7 +498,8 @@ var InstancesSchema = z15.record(
486
498
  code: CodeSchema,
487
499
  user: z15.string().default("ec2-user"),
488
500
  command: CommandSchema.optional(),
489
- environment: EnvironmentSchema2.optional()
501
+ environment: EnvironmentSchema2.optional(),
502
+ permissions: PermissionsSchema2.optional()
490
503
  })
491
504
  ).optional().describe("Define the instances in your stack.");
492
505
 
@@ -602,17 +615,12 @@ var RestDefaultSchema = z19.record(
602
615
  var RestSchema = z19.record(ResourceIdSchema, z19.record(RouteSchema2, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
603
616
 
604
617
  // src/feature/search/schema.ts
605
- import { z as z20 } from "zod";
606
618
  import { gibibytes as gibibytes2 } from "@awsless/size";
619
+ import { z as z20 } from "zod";
607
620
  var VersionSchema = z20.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
608
621
  var TypeSchema3 = z20.enum([
609
622
  "t3.small",
610
623
  "t3.medium",
611
- "t3.large",
612
- "t3.xlarge",
613
- "t3.2xlarge",
614
- "t4g.small",
615
- "t4g.medium",
616
624
  "m3.medium",
617
625
  "m3.large",
618
626
  "m3.xlarge",
@@ -658,21 +666,6 @@ var TypeSchema3 = z20.enum([
658
666
  "r3.8xlarge",
659
667
  "i2.xlarge",
660
668
  "i2.2xlarge",
661
- "d2.xlarge",
662
- "d2.2xlarge",
663
- "d2.4xlarge",
664
- "d2.8xlarge",
665
- "c4.large",
666
- "c4.xlarge",
667
- "c4.2xlarge",
668
- "c4.4xlarge",
669
- "c4.8xlarge",
670
- "r4.large",
671
- "r4.xlarge",
672
- "r4.2xlarge",
673
- "r4.4xlarge",
674
- "r4.8xlarge",
675
- "r4.16xlarge",
676
669
  "i3.large",
677
670
  "i3.xlarge",
678
671
  "i3.2xlarge",
@@ -691,12 +684,6 @@ var TypeSchema3 = z20.enum([
691
684
  "m6g.4xlarge",
692
685
  "m6g.8xlarge",
693
686
  "m6g.12xlarge",
694
- "c6g.large",
695
- "c6g.xlarge",
696
- "c6g.2xlarge",
697
- "c6g.4xlarge",
698
- "c6g.8xlarge",
699
- "c6g.12xlarge",
700
687
  "r6gd.large",
701
688
  "r6gd.xlarge",
702
689
  "r6gd.2xlarge",