@lafken/queue 0.8.0 → 0.9.0

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.
@@ -1,4 +1,13 @@
1
- import type { LambdaMetadata, LambdaProps, QueueNames } from '@lafken/common';
1
+ import type { LambdaMetadata, LambdaProps, QueueNames, ResourceOutputType } from '@lafken/common';
2
+ /**
3
+ * Attributes that can be exported from an SQS queue resource.
4
+ *
5
+ * Based on Terraform `aws_sqs_queue` attribute reference:
6
+ * - `arn`: ARN of the SQS queue.
7
+ * - `id`: URL for the created Amazon SQS queue.
8
+ * - `url`: Same as `id`: the URL for the created Amazon SQS queue.
9
+ */
10
+ export type QueueOutputAttributes = 'arn' | 'id' | 'url';
2
11
  export interface StandardProps {
3
12
  /**
4
13
  * Delivery delay in seconds.
@@ -57,6 +66,27 @@ export interface StandardProps {
57
66
  * If not specified, a default name based on the resource or class is used.
58
67
  */
59
68
  queueName?: QueueNames;
69
+ /**
70
+ * Defines which SQS queue attributes should be exported.
71
+ *
72
+ * Supported attributes are based on Terraform `aws_sqs_queue`
73
+ * attribute reference:
74
+ * - `arn`: ARN of the SQS queue.
75
+ * - `id`: URL for the created Amazon SQS queue.
76
+ * - `url`: Same as `id`: the URL for the created Amazon SQS queue.
77
+ *
78
+ * Each selected attribute can be exported through SSM Parameter Store (`type: 'ssm'`)
79
+ * or Terraform outputs (`type: 'output'`).
80
+ *
81
+ * @example
82
+ * {
83
+ * outputs: [
84
+ * { type: 'ssm', name: '/my-app/queue-arn', value: 'arn' },
85
+ * { type: 'output', name: 'queue_url', value: 'url' }
86
+ * ]
87
+ * }
88
+ */
89
+ outputs?: ResourceOutputType<QueueOutputAttributes>;
60
90
  }
61
91
  export interface FifoProps extends StandardProps {
62
92
  /**
@@ -5,6 +5,7 @@ declare const Queue_base: (new (...args: any[]) => {
5
5
  isGlobal(module: import("@lafken/common").ModuleGlobalReferenceNames | (string & {}), id: string): void;
6
6
  isDependent(resolveDependency: () => void): void;
7
7
  readonly node: import("constructs").Node;
8
+ with(...mixins: import("constructs").IMixin[]): import("constructs").IConstruct;
8
9
  toString(): string;
9
10
  }) & typeof SqsQueue;
10
11
  export declare class Queue extends Queue_base {
@@ -25,6 +25,7 @@ class Queue extends resolver_1.lafkenResource.make(sqs_queue_1.SqsQueue) {
25
25
  this.isGlobal(scope.id, handler.queueName);
26
26
  this.validateEventParams();
27
27
  this.addEventSource(id);
28
+ new resolver_1.ResourceOutput(this, handler.outputs);
28
29
  }
29
30
  addEventSource(id) {
30
31
  const { handler, resourceMetadata } = this.props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lafken/queue",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "private": false,
5
5
  "description": "Define SQS queues and consumers using TypeScript decorators - automatic infrastructure generation with Lafken",
6
6
  "keywords": [
@@ -52,28 +52,28 @@
52
52
  "lib"
53
53
  ],
54
54
  "dependencies": {
55
- "@aws-sdk/client-sqs": "^3.990.0",
55
+ "@aws-sdk/client-sqs": "^3.1020.0",
56
56
  "aws-lambda": "^1.0.7",
57
57
  "reflect-metadata": "^0.2.2",
58
- "@lafken/resolver": "0.8.0"
58
+ "@lafken/resolver": "0.9.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@cdktn/provider-aws": "^23.0.0",
62
- "@swc/core": "^1.15.11",
63
- "@swc/helpers": "^0.5.18",
64
- "@types/aws-lambda": "^8.10.160",
65
- "@vitest/runner": "^4.0.18",
66
- "cdktn": "^0.22.0",
61
+ "@cdktn/provider-aws": "^23.5.0",
62
+ "@swc/core": "^1.15.21",
63
+ "@swc/helpers": "^0.5.20",
64
+ "@types/aws-lambda": "^8.10.161",
65
+ "@vitest/runner": "^4.1.2",
66
+ "cdktn": "^0.22.1",
67
67
  "cdktn-vitest": "^1.0.0",
68
- "constructs": "^10.4.5",
68
+ "constructs": "^10.6.0",
69
69
  "unplugin-swc": "^1.5.9",
70
- "vitest": "^4.0.18",
71
- "@lafken/common": "0.8.0"
70
+ "vitest": "^4.1.2",
71
+ "@lafken/common": "0.9.0"
72
72
  },
73
73
  "peerDependencies": {
74
- "@cdktn/provider-aws": "^23.0.0",
75
- "@lafken/common": "^0.7.0",
76
- "cdktn": "^0.22.0",
74
+ "@cdktn/provider-aws": ">=23.0.0",
75
+ "@lafken/common": ">=0.8.0",
76
+ "cdktn": ">=0.22.0",
77
77
  "constructs": "^10.4.5"
78
78
  },
79
79
  "engines": {