@awsless/awsless 0.0.603 → 0.0.605

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
@@ -185,8 +185,8 @@ import promiseLimit from "p-limit";
185
185
  import { z } from "zod";
186
186
  import "@aws-sdk/signature-v4-crt";
187
187
  var ImportKeys = createCustomResourceClass("cloudfront-kvs", "import-keys");
188
- var createCloudFrontKvsProvider = ({ profile, region }) => {
189
- const client = new CloudFrontKeyValueStoreClient({ profile, region });
188
+ var createCloudFrontKvsProvider = ({ credentials, region }) => {
189
+ const client = new CloudFrontKeyValueStoreClient({ credentials, region });
190
190
  const queues = {};
191
191
  const getConcurrencyQueue = (arn) => {
192
192
  if (!queues[arn]) {
@@ -340,8 +340,8 @@ var Invalidation = createCustomResourceClass2(
340
340
  "cloudfront",
341
341
  "invalidation"
342
342
  );
343
- var createCloudFrontProvider = ({ profile, region }) => {
344
- const cloudFront = new CloudFrontClient({ profile, region });
343
+ var createCloudFrontProvider = ({ credentials, region }) => {
344
+ const cloudFront = new CloudFrontClient({ credentials, region });
345
345
  return createCustomProvider2("cloudfront", {
346
346
  invalidation: {
347
347
  async updateResource(props) {
@@ -413,8 +413,8 @@ import { createCustomProvider as createCustomProvider4, createCustomResourceClas
413
413
  import { resolveNs } from "node:dns/promises";
414
414
  import { z as z4 } from "zod";
415
415
  var NsCheck = createCustomResourceClass4("nameservers", "check");
416
- var createNameServersProvider = ({ profile, region }) => {
417
- const client = new Route53Client({ profile, region });
416
+ var createNameServersProvider = ({ credentials, region }) => {
417
+ const client = new Route53Client({ credentials, region });
418
418
  return createCustomProvider4("nameservers", {
419
419
  check: {
420
420
  async createResource(props) {
@@ -561,6 +561,7 @@ var createWorkSpace = async (props) => {
561
561
  enableDebug();
562
562
  }
563
563
  await aws.install();
564
+ const cred = await props.credentials();
564
565
  const workspace = new WorkSpace({
565
566
  providers: [
566
567
  createLambdaProvider(props),
@@ -569,7 +570,10 @@ var createWorkSpace = async (props) => {
569
570
  createNameServersProvider(props),
570
571
  aws(
571
572
  {
572
- profile: props.profile,
573
+ accessKey: cred.accessKeyId,
574
+ secretKey: cred.secretAccessKey,
575
+ // token: cred.sessionToken,
576
+ // profile: props.profile,
573
577
  region: props.region,
574
578
  maxRetries: 5
575
579
  }
@@ -579,7 +583,10 @@ var createWorkSpace = async (props) => {
579
583
  ),
580
584
  aws(
581
585
  {
582
- profile: props.profile,
586
+ accessKey: cred.accessKeyId,
587
+ secretKey: cred.secretAccessKey,
588
+ // token: cred.sessionToken,
589
+ // profile: props.profile,
583
590
  region: "us-east-1",
584
591
  maxRetries: 5
585
592
  },
@@ -6152,7 +6159,7 @@ var layerFeature = defineFeature({
6152
6159
  },
6153
6160
  {
6154
6161
  dependsOn: [zip],
6155
- replaceOnChanges: ["sourceCodeHash"]
6162
+ replaceOnChanges: ["sourceCodeHash", "s3ObjectVersion"]
6156
6163
  }
6157
6164
  );
6158
6165
  ctx.shared.add("layer", "arn", id, layer.arn);
@@ -6193,20 +6200,29 @@ var imageFeature = defineFeature({
6193
6200
  source: path,
6194
6201
  sourceHash: $hash(path)
6195
6202
  });
6196
- const layer = new aws24.lambda.LayerVersion(group, "layer", {
6197
- layerName: layerId,
6198
- description: "sharp-arm.zip for the awsless image feature.",
6199
- compatibleArchitectures: ["arm64"],
6200
- s3Bucket: zipFile.bucket,
6201
- s3ObjectVersion: zipFile.versionId,
6202
- s3Key: zipFile.key.pipe((name) => {
6203
- if (name.startsWith("/")) {
6204
- return name.substring(1);
6205
- }
6206
- return name;
6207
- }),
6208
- sourceCodeHash: $hash(path)
6209
- });
6203
+ const layer = new aws24.lambda.LayerVersion(
6204
+ group,
6205
+ "layer",
6206
+ {
6207
+ layerName: layerId,
6208
+ description: "sharp-arm.zip for the awsless image feature.",
6209
+ compatibleArchitectures: ["arm64"],
6210
+ s3Bucket: zipFile.bucket,
6211
+ s3ObjectVersion: zipFile.versionId,
6212
+ s3Key: zipFile.key.pipe((name) => {
6213
+ if (name.startsWith("/")) {
6214
+ return name.substring(1);
6215
+ }
6216
+ return name;
6217
+ }),
6218
+ sourceCodeHash: $hash(path),
6219
+ skipDestroy: true
6220
+ },
6221
+ {
6222
+ dependsOn: [zipFile],
6223
+ replaceOnChanges: ["sourceCodeHash", "s3ObjectVersion"]
6224
+ }
6225
+ );
6210
6226
  ctx.shared.add("layer", "arn", layerId, layer.arn);
6211
6227
  },
6212
6228
  onStack(ctx) {
@@ -8412,7 +8428,6 @@ var set = (program2) => {
8412
8428
  const { workspace } = await createWorkSpace({
8413
8429
  credentials,
8414
8430
  accountId,
8415
- profile,
8416
8431
  region
8417
8432
  });
8418
8433
  const params = new SsmStore({
@@ -8630,7 +8645,6 @@ var del2 = (program2) => {
8630
8645
  const { workspace, state: state2 } = await createWorkSpace({
8631
8646
  credentials,
8632
8647
  accountId,
8633
- profile,
8634
8648
  region
8635
8649
  });
8636
8650
  await task("Deleting the stacks to AWS", async (update2) => {
@@ -9032,7 +9046,6 @@ var deploy = (program2) => {
9032
9046
  const { workspace, state: state2 } = await createWorkSpace({
9033
9047
  credentials,
9034
9048
  accountId,
9035
- profile,
9036
9049
  region
9037
9050
  });
9038
9051
  await log18.task({
@@ -9088,7 +9101,6 @@ var create = (program2) => {
9088
9101
  const { workspace } = await createWorkSpace({
9089
9102
  credentials,
9090
9103
  accountId,
9091
- profile,
9092
9104
  region
9093
9105
  });
9094
9106
  await workspace.hydrate(app);
@@ -9229,7 +9241,6 @@ var update = (program2) => {
9229
9241
  const { workspace } = await createWorkSpace({
9230
9242
  credentials,
9231
9243
  accountId,
9232
- profile,
9233
9244
  region
9234
9245
  });
9235
9246
  await workspace.hydrate(app);
@@ -9406,7 +9417,6 @@ var del3 = (program2) => {
9406
9417
  const { workspace } = await createWorkSpace({
9407
9418
  credentials,
9408
9419
  accountId,
9409
- profile,
9410
9420
  region
9411
9421
  });
9412
9422
  await workspace.hydrate(app);
@@ -9490,7 +9500,6 @@ var bind = (program2) => {
9490
9500
  const { workspace } = await createWorkSpace({
9491
9501
  credentials,
9492
9502
  accountId,
9493
- profile,
9494
9503
  region
9495
9504
  });
9496
9505
  await workspace.hydrate(app);
@@ -9643,7 +9652,6 @@ var resources = (program2) => {
9643
9652
  const { workspace } = await createWorkSpace({
9644
9653
  credentials,
9645
9654
  accountId,
9646
- profile,
9647
9655
  region
9648
9656
  });
9649
9657
  const stacks = await workspace.status(app);
@@ -9758,7 +9766,7 @@ var pull = (program2) => {
9758
9766
  const credentials = await getCredentials(profile);
9759
9767
  const accountId = await getAccountId(credentials, region);
9760
9768
  const { app } = createApp({ appConfig, stackConfigs, accountId });
9761
- const { state: state2 } = await createWorkSpace({ credentials, region, accountId, profile });
9769
+ const { state: state2 } = await createWorkSpace({ credentials, region, accountId });
9762
9770
  await pullRemoteState(app, state2);
9763
9771
  return "State pull was successful.";
9764
9772
  });
@@ -9775,7 +9783,7 @@ var push = (program2) => {
9775
9783
  const credentials = await getCredentials(appConfig.profile);
9776
9784
  const accountId = await getAccountId(credentials, region);
9777
9785
  const { app } = createApp({ appConfig, stackConfigs, accountId });
9778
- const { state: state2 } = await createWorkSpace({ credentials, region, accountId, profile });
9786
+ const { state: state2 } = await createWorkSpace({ credentials, region, accountId });
9779
9787
  const ok = await prompt12.confirm({
9780
9788
  message: "Pushing up the local state might corrupt your remote state. Are you sure?",
9781
9789
  initialValue: false
@@ -9799,7 +9807,7 @@ var unlock = (program2) => {
9799
9807
  const credentials = await getCredentials(profile);
9800
9808
  const accountId = await getAccountId(credentials, region);
9801
9809
  const { app } = createApp({ appConfig, stackConfigs, accountId });
9802
- const { lock } = await createWorkSpace({ credentials, region, accountId, profile });
9810
+ const { lock } = await createWorkSpace({ credentials, region, accountId });
9803
9811
  const isLocked = await lock.locked(app.urn);
9804
9812
  if (!isLocked) {
9805
9813
  return "No lock is exists.";
@@ -9871,7 +9879,6 @@ var list2 = (program2) => {
9871
9879
  const { workspace } = await createWorkSpace({
9872
9880
  credentials,
9873
9881
  accountId,
9874
- profile,
9875
9882
  region
9876
9883
  });
9877
9884
  await workspace.hydrate(app);
@@ -9908,7 +9915,6 @@ var deploy2 = (program2) => {
9908
9915
  const { workspace } = await createWorkSpace({
9909
9916
  credentials,
9910
9917
  accountId,
9911
- profile,
9912
9918
  region
9913
9919
  });
9914
9920
  await log26.task({
@@ -9964,7 +9970,6 @@ var logs = (program2) => {
9964
9970
  const { workspace } = await createWorkSpace({
9965
9971
  credentials,
9966
9972
  accountId,
9967
- profile,
9968
9973
  region
9969
9974
  });
9970
9975
  await workspace.hydrate(app);
@@ -10139,7 +10144,6 @@ var clearCache = (program2) => {
10139
10144
  const { workspace } = await createWorkSpace({
10140
10145
  credentials,
10141
10146
  accountId,
10142
- profile,
10143
10147
  region
10144
10148
  });
10145
10149
  await workspace.hydrate(app);
@@ -10273,7 +10277,6 @@ var clearCache2 = (program2) => {
10273
10277
  const { workspace } = await createWorkSpace({
10274
10278
  credentials,
10275
10279
  accountId,
10276
- profile,
10277
10280
  region
10278
10281
  });
10279
10282
  await workspace.hydrate(app);
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/awsless",
3
- "version": "0.0.603",
3
+ "version": "0.0.605",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -37,18 +37,18 @@
37
37
  "@awsless/cloudwatch": "^0.0.1",
38
38
  "@awsless/duration": "^0.0.4",
39
39
  "@awsless/dynamodb": "^0.3.8",
40
+ "@awsless/clui": "^0.0.8",
40
41
  "@awsless/iot": "^0.0.3",
41
42
  "@awsless/json": "^0.0.10",
42
43
  "@awsless/lambda": "^0.0.35",
43
- "@awsless/mqtt": "^0.0.2",
44
44
  "@awsless/open-search": "^0.0.21",
45
+ "@awsless/mqtt": "^0.0.2",
46
+ "@awsless/redis": "^0.0.14",
45
47
  "@awsless/s3": "^0.0.21",
46
48
  "@awsless/sns": "^0.0.10",
49
+ "@awsless/sqs": "^0.0.16",
47
50
  "@awsless/validate": "^0.1.3",
48
- "@awsless/redis": "^0.0.14",
49
51
  "@awsless/ssm": "^0.0.7",
50
- "@awsless/clui": "^0.0.8",
51
- "@awsless/sqs": "^0.0.16",
52
52
  "@awsless/weak-cache": "^0.0.1"
53
53
  },
54
54
  "dependencies": {
@@ -145,10 +145,10 @@
145
145
  "@awsless/duration": "^0.0.4",
146
146
  "@awsless/graphql": "^0.0.9",
147
147
  "@awsless/json": "^0.0.10",
148
- "@awsless/scheduler": "^0.0.4",
149
148
  "@awsless/size": "^0.0.2",
150
- "@awsless/validate": "^0.1.3",
151
- "@awsless/ts-file-cache": "^0.0.12"
149
+ "@awsless/scheduler": "^0.0.4",
150
+ "@awsless/ts-file-cache": "^0.0.12",
151
+ "@awsless/validate": "^0.1.3"
152
152
  },
153
153
  "devDependencies": {
154
154
  "@hono/node-server": "1.19.9",