@aligent/aws-wrappers 0.1.2 → 0.3.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.
- package/README.md +57 -1
- package/cjs/index.cjs +343 -49
- package/cjs/package.json +2 -1
- package/cjs/src/dynamodb/dynamodb.d.ts +4 -0
- package/cjs/src/index.d.ts +1 -0
- package/cjs/src/s3/s3.d.ts +4 -0
- package/cjs/src/scheduler/scheduler.d.ts +85 -0
- package/cjs/src/secrets-manager/secrets-manager.d.ts +7 -6
- package/cjs/src/sfn/sfn.d.ts +4 -0
- package/cjs/src/sns/sns.d.ts +5 -2
- package/cjs/src/sqs/sqs.d.ts +5 -2
- package/cjs/src/ssm/ssm.d.ts +4 -0
- package/cjs/src/util/redact.d.ts +14 -4
- package/docs/classes/DynamoDBService.md +69 -34
- package/docs/classes/S3Service.md +77 -33
- package/docs/classes/SNSService.md +31 -8
- package/docs/classes/SQSService.md +33 -11
- package/docs/classes/SSMService.md +70 -9
- package/docs/classes/SchedulerService.md +271 -0
- package/docs/classes/SecretsManagerService.md +120 -7
- package/docs/classes/StepFunctionsService.md +13 -9
- package/docs/modules.md +1 -0
- package/esm/index.mjs +344 -51
- package/esm/package.json +2 -1
- package/esm/src/dynamodb/dynamodb.d.ts +4 -0
- package/esm/src/index.d.ts +1 -0
- package/esm/src/s3/s3.d.ts +4 -0
- package/esm/src/scheduler/scheduler.d.ts +85 -0
- package/esm/src/secrets-manager/secrets-manager.d.ts +7 -6
- package/esm/src/sfn/sfn.d.ts +4 -0
- package/esm/src/sns/sns.d.ts +5 -2
- package/esm/src/sqs/sqs.d.ts +5 -2
- package/esm/src/ssm/ssm.d.ts +4 -0
- package/esm/src/util/redact.d.ts +14 -4
- package/package.json +2 -1
|
@@ -6,11 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: S3Service
|
|
8
8
|
|
|
9
|
-
Defined in: [s3/s3.ts:
|
|
9
|
+
Defined in: [s3/s3.ts:70](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L70)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS S3 client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
13
13
|
|
|
14
|
+
Where a method's input carries payloads, secret material or PII, the INFO
|
|
15
|
+
log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
16
|
+
`TRACE`) log full SDK inputs.
|
|
17
|
+
|
|
14
18
|
Input shapes are intentionally tight (Bucket/Key/Body only). Callers
|
|
15
19
|
needing SDK-level options not exposed here (server-side encryption,
|
|
16
20
|
tagging, version IDs) should use `S3Client` directly.
|
|
@@ -23,7 +27,7 @@ tagging, version IDs) should use `S3Client` directly.
|
|
|
23
27
|
|
|
24
28
|
> **new S3Service**(`opts?`): `S3Service`
|
|
25
29
|
|
|
26
|
-
Defined in: [s3/s3.ts:
|
|
30
|
+
Defined in: [s3/s3.ts:80](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L80)
|
|
27
31
|
|
|
28
32
|
#### Parameters
|
|
29
33
|
|
|
@@ -38,10 +42,10 @@ the wrapper does not apply X-Ray instrumentation.
|
|
|
38
42
|
|
|
39
43
|
###### logger?
|
|
40
44
|
|
|
41
|
-
`
|
|
45
|
+
`LoggerInterface`
|
|
42
46
|
|
|
43
|
-
Optional Powertools logger. Defaults to
|
|
44
|
-
`
|
|
47
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
48
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
45
49
|
|
|
46
50
|
#### Returns
|
|
47
51
|
|
|
@@ -55,7 +59,7 @@ Optional Powertools logger. Defaults to a logger with
|
|
|
55
59
|
|
|
56
60
|
> **copyObject**(`input`): `Promise`\<`CopyObjectCommandOutput`\>
|
|
57
61
|
|
|
58
|
-
Defined in: [s3/s3.ts:
|
|
62
|
+
Defined in: [s3/s3.ts:175](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L175)
|
|
59
63
|
|
|
60
64
|
Copy an object within S3.
|
|
61
65
|
|
|
@@ -77,7 +81,7 @@ Copy an object within S3.
|
|
|
77
81
|
|
|
78
82
|
> **deleteObject**(`input`): `Promise`\<`DeleteObjectCommandOutput`\>
|
|
79
83
|
|
|
80
|
-
Defined in: [s3/s3.ts:
|
|
84
|
+
Defined in: [s3/s3.ts:268](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L268)
|
|
81
85
|
|
|
82
86
|
Delete a single object from S3.
|
|
83
87
|
|
|
@@ -99,7 +103,7 @@ Delete a single object from S3.
|
|
|
99
103
|
|
|
100
104
|
> **deleteObjects**(`bucket`, `keys`): `Promise`\<`DeleteObjectsCommandOutput`[]\>
|
|
101
105
|
|
|
102
|
-
Defined in: [s3/s3.ts:
|
|
106
|
+
Defined in: [s3/s3.ts:280](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L280)
|
|
103
107
|
|
|
104
108
|
Delete multiple objects from S3, auto-chunking the request into batches
|
|
105
109
|
of 1000 keys (the S3-enforced DeleteObjects limit). Returns one output
|
|
@@ -127,7 +131,7 @@ per chunk.
|
|
|
127
131
|
|
|
128
132
|
> **emptyBucket**(`bucket`): `Promise`\<`string`[]\>
|
|
129
133
|
|
|
130
|
-
Defined in: [s3/s3.ts:
|
|
134
|
+
Defined in: [s3/s3.ts:309](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L309)
|
|
131
135
|
|
|
132
136
|
Delete every object in a bucket. Streams the listing page-by-page and
|
|
133
137
|
delegates each page's deletion to `deleteObjects`, so peak memory stays
|
|
@@ -153,7 +157,7 @@ The keys of every deleted object.
|
|
|
153
157
|
|
|
154
158
|
> **getAllObjects**\<`T`\>(`bucket`, `prefix?`): `Promise`\<`T`[]\>
|
|
155
159
|
|
|
156
|
-
Defined in: [s3/s3.ts:
|
|
160
|
+
Defined in: [s3/s3.ts:206](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L206)
|
|
157
161
|
|
|
158
162
|
List and JSON-parse every object under a bucket and optional prefix.
|
|
159
163
|
Auto-paginated. Objects without a body are skipped.
|
|
@@ -188,7 +192,7 @@ Expected type of each parsed object.
|
|
|
188
192
|
|
|
189
193
|
> **getJsonObject**\<`T`\>(`input`): `Promise`\<`T` \| `undefined`\>
|
|
190
194
|
|
|
191
|
-
Defined in: [s3/s3.ts:
|
|
195
|
+
Defined in: [s3/s3.ts:153](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L153)
|
|
192
196
|
|
|
193
197
|
Get an object from S3 and parse it as JSON.
|
|
194
198
|
|
|
@@ -224,7 +228,7 @@ If the body is non-empty and not valid JSON.
|
|
|
224
228
|
|
|
225
229
|
> **getObject**(`input`): `Promise`\<`GetObjectCommandOutput`\>
|
|
226
230
|
|
|
227
|
-
Defined in: [s3/s3.ts:
|
|
231
|
+
Defined in: [s3/s3.ts:127](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L127)
|
|
228
232
|
|
|
229
233
|
Get an object from S3.
|
|
230
234
|
|
|
@@ -246,7 +250,7 @@ Get an object from S3.
|
|
|
246
250
|
|
|
247
251
|
> **getObjectBody**(`input`): `Promise`\<`string` \| `undefined`\>
|
|
248
252
|
|
|
249
|
-
Defined in: [s3/s3.ts:
|
|
253
|
+
Defined in: [s3/s3.ts:139](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L139)
|
|
250
254
|
|
|
251
255
|
Get an object from S3 and return its body as a string.
|
|
252
256
|
|
|
@@ -265,13 +269,67 @@ has no body.
|
|
|
265
269
|
|
|
266
270
|
***
|
|
267
271
|
|
|
272
|
+
<a id="getpresignedurl"></a>
|
|
273
|
+
|
|
274
|
+
### getPresignedUrl()
|
|
275
|
+
|
|
276
|
+
> **getPresignedUrl**(`input`): `Promise`\<`string`\>
|
|
277
|
+
|
|
278
|
+
Defined in: [s3/s3.ts:244](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L244)
|
|
279
|
+
|
|
280
|
+
Generate a presigned URL that callers can use to GET or PUT an S3 object
|
|
281
|
+
directly, without going through the wrapper. The signing happens against
|
|
282
|
+
the wrapper's `S3Client`, so callers do not need their own client.
|
|
283
|
+
|
|
284
|
+
GET URLs are signed with `ResponseContentDisposition: 'attachment'` so
|
|
285
|
+
browsers download the object rather than rendering it in-place.
|
|
286
|
+
|
|
287
|
+
The input shape is an inline object (rather than the `Required<Pick<...>>`
|
|
288
|
+
pattern used by other S3 methods) because this method wraps two SDK
|
|
289
|
+
commands rather than one, and `action` / `expiresIn` are wrapper-level
|
|
290
|
+
concerns with no SDK-input equivalent.
|
|
291
|
+
|
|
292
|
+
#### Parameters
|
|
293
|
+
|
|
294
|
+
##### input
|
|
295
|
+
|
|
296
|
+
###### action
|
|
297
|
+
|
|
298
|
+
`"get"` \| `"put"`
|
|
299
|
+
|
|
300
|
+
`'get'` to download, `'put'` to upload.
|
|
301
|
+
|
|
302
|
+
###### Bucket
|
|
303
|
+
|
|
304
|
+
`string`
|
|
305
|
+
|
|
306
|
+
The S3 bucket name.
|
|
307
|
+
|
|
308
|
+
###### expiresIn?
|
|
309
|
+
|
|
310
|
+
`number`
|
|
311
|
+
|
|
312
|
+
URL lifetime in seconds. Defaults to 3600 (1 hour).
|
|
313
|
+
|
|
314
|
+
###### Key
|
|
315
|
+
|
|
316
|
+
`string`
|
|
317
|
+
|
|
318
|
+
The S3 object key.
|
|
319
|
+
|
|
320
|
+
#### Returns
|
|
321
|
+
|
|
322
|
+
`Promise`\<`string`\>
|
|
323
|
+
|
|
324
|
+
***
|
|
325
|
+
|
|
268
326
|
<a id="headobject"></a>
|
|
269
327
|
|
|
270
328
|
### headObject()
|
|
271
329
|
|
|
272
330
|
> **headObject**(`input`): `Promise`\<`HeadObjectCommandOutput`\>
|
|
273
331
|
|
|
274
|
-
Defined in: [s3/s3.ts:
|
|
332
|
+
Defined in: [s3/s3.ts:165](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L165)
|
|
275
333
|
|
|
276
334
|
Fetch the metadata for an S3 object without downloading its body.
|
|
277
335
|
|
|
@@ -293,7 +351,7 @@ Fetch the metadata for an S3 object without downloading its body.
|
|
|
293
351
|
|
|
294
352
|
> **listObjects**(`bucket`, `prefix?`): `Promise`\<`string`[]\>
|
|
295
353
|
|
|
296
|
-
Defined in: [s3/s3.ts:
|
|
354
|
+
Defined in: [s3/s3.ts:186](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L186)
|
|
297
355
|
|
|
298
356
|
List object keys under a bucket and optional prefix, auto-paginating
|
|
299
357
|
across all pages.
|
|
@@ -320,7 +378,7 @@ across all pages.
|
|
|
320
378
|
|
|
321
379
|
> **putJsonObject**\<`T`\>(`input`): `Promise`\<`PutObjectCommandOutput`\>
|
|
322
380
|
|
|
323
|
-
Defined in: [s3/s3.ts:
|
|
381
|
+
Defined in: [s3/s3.ts:110](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L110)
|
|
324
382
|
|
|
325
383
|
Serialise a value to JSON and store it as an S3 object.
|
|
326
384
|
|
|
@@ -340,21 +398,7 @@ Type of the value being stored.
|
|
|
340
398
|
|
|
341
399
|
##### input
|
|
342
400
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
`T`
|
|
346
|
-
|
|
347
|
-
###### Bucket
|
|
348
|
-
|
|
349
|
-
`string`
|
|
350
|
-
|
|
351
|
-
###### Key
|
|
352
|
-
|
|
353
|
-
`string`
|
|
354
|
-
|
|
355
|
-
###### Metadata?
|
|
356
|
-
|
|
357
|
-
`Record`\<`string`, `string`\>
|
|
401
|
+
`PutJsonObjectInput`\<`T`\>
|
|
358
402
|
|
|
359
403
|
#### Returns
|
|
360
404
|
|
|
@@ -368,7 +412,7 @@ Type of the value being stored.
|
|
|
368
412
|
|
|
369
413
|
> **putObject**(`input`): `Promise`\<`PutObjectCommandOutput`\>
|
|
370
414
|
|
|
371
|
-
Defined in: [s3/s3.ts:
|
|
415
|
+
Defined in: [s3/s3.ts:94](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/s3/s3.ts#L94)
|
|
372
416
|
|
|
373
417
|
Put an object into S3.
|
|
374
418
|
|
|
@@ -380,7 +424,7 @@ content into CloudWatch.
|
|
|
380
424
|
|
|
381
425
|
##### input
|
|
382
426
|
|
|
383
|
-
`
|
|
427
|
+
`PutObjectInput`
|
|
384
428
|
|
|
385
429
|
Bucket, Key, and Body of the object to store.
|
|
386
430
|
|
|
@@ -6,11 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SNSService
|
|
8
8
|
|
|
9
|
-
Defined in: [sns/sns.ts:
|
|
9
|
+
Defined in: [sns/sns.ts:43](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sns/sns.ts#L43)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS SNS client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
13
13
|
|
|
14
|
+
Where a method's input carries payloads, secret material or PII, the INFO
|
|
15
|
+
log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
16
|
+
`TRACE`) log full SDK inputs.
|
|
17
|
+
|
|
14
18
|
## Constructors
|
|
15
19
|
|
|
16
20
|
<a id="constructor"></a>
|
|
@@ -19,7 +23,7 @@ and X-Ray tracing by default.
|
|
|
19
23
|
|
|
20
24
|
> **new SNSService**(`opts?`): `SNSService`
|
|
21
25
|
|
|
22
|
-
Defined in: [sns/sns.ts:
|
|
26
|
+
Defined in: [sns/sns.ts:59](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sns/sns.ts#L59)
|
|
23
27
|
|
|
24
28
|
#### Parameters
|
|
25
29
|
|
|
@@ -34,10 +38,20 @@ the wrapper does not apply X-Ray instrumentation.
|
|
|
34
38
|
|
|
35
39
|
###### logger?
|
|
36
40
|
|
|
37
|
-
`
|
|
41
|
+
`LoggerInterface`
|
|
42
|
+
|
|
43
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
44
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
45
|
+
|
|
46
|
+
###### truncate?
|
|
38
47
|
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
`boolean`
|
|
49
|
+
|
|
50
|
+
When `true`, oversized `Message` / `Subject` are
|
|
51
|
+
truncated (byte-safe / codepoint-safe) before sending instead of failing
|
|
52
|
+
at the SDK. Defaults to `false` — the SDK throws on oversize, which is
|
|
53
|
+
usually the right failure mode. Each `publish` call can override via
|
|
54
|
+
its own `truncate` option.
|
|
41
55
|
|
|
42
56
|
#### Returns
|
|
43
57
|
|
|
@@ -49,12 +63,15 @@ Optional Powertools logger. Defaults to a logger with
|
|
|
49
63
|
|
|
50
64
|
### publish()
|
|
51
65
|
|
|
52
|
-
> **publish**(`input`): `Promise`\<`PublishCommandOutput`\>
|
|
66
|
+
> **publish**(`input`, `opts?`): `Promise`\<`PublishCommandOutput`\>
|
|
53
67
|
|
|
54
|
-
Defined in: [sns/sns.ts:
|
|
68
|
+
Defined in: [sns/sns.ts:73](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sns/sns.ts#L73)
|
|
55
69
|
|
|
56
70
|
Publish a single message to an SNS topic.
|
|
57
71
|
|
|
72
|
+
At INFO level the log line includes only routing / dedup metadata; see
|
|
73
|
+
`PUBLISH_SAFE_FIELDS` for the list.
|
|
74
|
+
|
|
58
75
|
#### Parameters
|
|
59
76
|
|
|
60
77
|
##### input
|
|
@@ -63,6 +80,12 @@ Publish a single message to an SNS topic.
|
|
|
63
80
|
|
|
64
81
|
PublishCommandInput including TopicArn and Message.
|
|
65
82
|
|
|
83
|
+
##### opts?
|
|
84
|
+
|
|
85
|
+
###### truncate?
|
|
86
|
+
|
|
87
|
+
`boolean`
|
|
88
|
+
|
|
66
89
|
#### Returns
|
|
67
90
|
|
|
68
91
|
`Promise`\<`PublishCommandOutput`\>
|
|
@@ -75,7 +98,7 @@ PublishCommandInput including TopicArn and Message.
|
|
|
75
98
|
|
|
76
99
|
> **publishBatch**(`input`): `Promise`\<`PublishBatchCommandOutput`[]\>
|
|
77
100
|
|
|
78
|
-
Defined in: [sns/sns.ts:
|
|
101
|
+
Defined in: [sns/sns.ts:110](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sns/sns.ts#L110)
|
|
79
102
|
|
|
80
103
|
Publish a batch of messages to an SNS topic. The SNS API caps
|
|
81
104
|
PublishBatch at 10 entries per request, so this method auto-chunks
|
|
@@ -6,11 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SQSService
|
|
8
8
|
|
|
9
|
-
Defined in: [sqs/sqs.ts:
|
|
9
|
+
Defined in: [sqs/sqs.ts:49](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sqs/sqs.ts#L49)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS SQS client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
13
13
|
|
|
14
|
+
Where a method's input carries payloads, secret material or PII, the INFO
|
|
15
|
+
log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
16
|
+
`TRACE`) log full SDK inputs.
|
|
17
|
+
|
|
14
18
|
## Constructors
|
|
15
19
|
|
|
16
20
|
<a id="constructor"></a>
|
|
@@ -19,7 +23,7 @@ and X-Ray tracing by default.
|
|
|
19
23
|
|
|
20
24
|
> **new SQSService**(`opts?`): `SQSService`
|
|
21
25
|
|
|
22
|
-
Defined in: [sqs/sqs.ts:
|
|
26
|
+
Defined in: [sqs/sqs.ts:64](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sqs/sqs.ts#L64)
|
|
23
27
|
|
|
24
28
|
#### Parameters
|
|
25
29
|
|
|
@@ -34,10 +38,19 @@ the wrapper does not apply X-Ray instrumentation.
|
|
|
34
38
|
|
|
35
39
|
###### logger?
|
|
36
40
|
|
|
37
|
-
`
|
|
41
|
+
`LoggerInterface`
|
|
42
|
+
|
|
43
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
44
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
45
|
+
|
|
46
|
+
###### truncate?
|
|
38
47
|
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
`boolean`
|
|
49
|
+
|
|
50
|
+
When `true`, oversized `MessageBody` is truncated
|
|
51
|
+
(byte-safe) before sending instead of failing at the SDK. Defaults to
|
|
52
|
+
`false`. Each `sendMessage` call can override via its own `truncate`
|
|
53
|
+
option.
|
|
41
54
|
|
|
42
55
|
#### Returns
|
|
43
56
|
|
|
@@ -51,7 +64,7 @@ Optional Powertools logger. Defaults to a logger with
|
|
|
51
64
|
|
|
52
65
|
> **deleteMessage**(`input`): `Promise`\<`DeleteMessageCommandOutput`\>
|
|
53
66
|
|
|
54
|
-
Defined in: [sqs/sqs.ts:
|
|
67
|
+
Defined in: [sqs/sqs.ts:119](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sqs/sqs.ts#L119)
|
|
55
68
|
|
|
56
69
|
Delete a single message from an SQS queue.
|
|
57
70
|
|
|
@@ -73,7 +86,7 @@ Delete a single message from an SQS queue.
|
|
|
73
86
|
|
|
74
87
|
> **deleteMessageBatch**(`input`): `Promise`\<`DeleteMessageBatchCommandOutput`[]\>
|
|
75
88
|
|
|
76
|
-
Defined in: [sqs/sqs.ts:
|
|
89
|
+
Defined in: [sqs/sqs.ts:155](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sqs/sqs.ts#L155)
|
|
77
90
|
|
|
78
91
|
Delete a batch of messages from an SQS queue. The SQS API caps
|
|
79
92
|
DeleteMessageBatch at 10 entries per request, so this method auto-chunks
|
|
@@ -97,7 +110,7 @@ the caller's entries and sends one request per chunk.
|
|
|
97
110
|
|
|
98
111
|
> **receiveMessages**(`input`): `Promise`\<`Message`[]\>
|
|
99
112
|
|
|
100
|
-
Defined in: [sqs/sqs.ts:
|
|
113
|
+
Defined in: [sqs/sqs.ts:110](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sqs/sqs.ts#L110)
|
|
101
114
|
|
|
102
115
|
Receive messages from an SQS queue. Returns an empty array when no
|
|
103
116
|
messages are available. No automatic deletion is performed — visibility
|
|
@@ -121,18 +134,27 @@ The `Messages` array from the response, or `[]` if absent.
|
|
|
121
134
|
|
|
122
135
|
### sendMessage()
|
|
123
136
|
|
|
124
|
-
> **sendMessage**(`input`): `Promise`\<`SendMessageCommandOutput`\>
|
|
137
|
+
> **sendMessage**(`input`, `opts?`): `Promise`\<`SendMessageCommandOutput`\>
|
|
125
138
|
|
|
126
|
-
Defined in: [sqs/sqs.ts:
|
|
139
|
+
Defined in: [sqs/sqs.ts:76](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sqs/sqs.ts#L76)
|
|
127
140
|
|
|
128
141
|
Send a single message to an SQS queue.
|
|
129
142
|
|
|
143
|
+
At INFO level the log line includes only queue routing / FIFO metadata;
|
|
144
|
+
see `SEND_MESSAGE_SAFE_FIELDS`.
|
|
145
|
+
|
|
130
146
|
#### Parameters
|
|
131
147
|
|
|
132
148
|
##### input
|
|
133
149
|
|
|
134
150
|
`SendMessageCommandInput`
|
|
135
151
|
|
|
152
|
+
##### opts?
|
|
153
|
+
|
|
154
|
+
###### truncate?
|
|
155
|
+
|
|
156
|
+
`boolean`
|
|
157
|
+
|
|
136
158
|
#### Returns
|
|
137
159
|
|
|
138
160
|
`Promise`\<`SendMessageCommandOutput`\>
|
|
@@ -145,7 +167,7 @@ Send a single message to an SQS queue.
|
|
|
145
167
|
|
|
146
168
|
> **sendMessageBatch**(`input`): `Promise`\<`SendMessageBatchCommandOutput`[]\>
|
|
147
169
|
|
|
148
|
-
Defined in: [sqs/sqs.ts:
|
|
170
|
+
Defined in: [sqs/sqs.ts:129](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/sqs/sqs.ts#L129)
|
|
149
171
|
|
|
150
172
|
Send a batch of messages to an SQS queue. The SQS API caps
|
|
151
173
|
SendMessageBatch at 10 entries per request, so this method auto-chunks
|
|
@@ -6,13 +6,23 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SSMService
|
|
8
8
|
|
|
9
|
-
Defined in: [ssm/ssm.ts:
|
|
9
|
+
Defined in: [ssm/ssm.ts:50](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/ssm/ssm.ts#L50)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS SSM Parameter Store client providing structured
|
|
12
|
-
Powertools logging and X-Ray tracing by default. All operations enable
|
|
12
|
+
Powertools logging and X-Ray tracing by default. All read operations enable
|
|
13
13
|
`WithDecryption` — callers needing plaintext should use `SSMClient`
|
|
14
14
|
directly.
|
|
15
15
|
|
|
16
|
+
Where a method's input carries payloads, secret material or PII, the INFO
|
|
17
|
+
log line omits them; the verbose levels (`POWERTOOLS_LOG_LEVEL=DEBUG` or
|
|
18
|
+
`TRACE`) log full SDK inputs.
|
|
19
|
+
|
|
20
|
+
Write operations (`putParameter`, `deleteParameter`) are exposed for
|
|
21
|
+
convenience but should be used with care: parameter lifecycle is usually
|
|
22
|
+
managed by IaC (CDK / Terraform). Prefer IaC for anything that exists at
|
|
23
|
+
deploy time; reserve runtime writes for values that genuinely need to
|
|
24
|
+
mutate within the application.
|
|
25
|
+
|
|
16
26
|
## Constructors
|
|
17
27
|
|
|
18
28
|
<a id="constructor"></a>
|
|
@@ -21,7 +31,7 @@ directly.
|
|
|
21
31
|
|
|
22
32
|
> **new SSMService**(`opts?`): `SSMService`
|
|
23
33
|
|
|
24
|
-
Defined in: [ssm/ssm.ts:
|
|
34
|
+
Defined in: [ssm/ssm.ts:60](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/ssm/ssm.ts#L60)
|
|
25
35
|
|
|
26
36
|
#### Parameters
|
|
27
37
|
|
|
@@ -36,10 +46,10 @@ the wrapper does not apply X-Ray instrumentation.
|
|
|
36
46
|
|
|
37
47
|
###### logger?
|
|
38
48
|
|
|
39
|
-
`
|
|
49
|
+
`LoggerInterface`
|
|
40
50
|
|
|
41
|
-
Optional Powertools logger. Defaults to
|
|
42
|
-
`
|
|
51
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
52
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
43
53
|
|
|
44
54
|
#### Returns
|
|
45
55
|
|
|
@@ -47,13 +57,38 @@ Optional Powertools logger. Defaults to a logger with
|
|
|
47
57
|
|
|
48
58
|
## Methods
|
|
49
59
|
|
|
60
|
+
<a id="deleteparameter"></a>
|
|
61
|
+
|
|
62
|
+
### deleteParameter()
|
|
63
|
+
|
|
64
|
+
> **deleteParameter**(`name`): `Promise`\<`void`\>
|
|
65
|
+
|
|
66
|
+
Defined in: [ssm/ssm.ts:139](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/ssm/ssm.ts#L139)
|
|
67
|
+
|
|
68
|
+
Delete an SSM parameter by name.
|
|
69
|
+
|
|
70
|
+
Prefer IaC (CDK / Terraform) for parameter lifecycle — use this for
|
|
71
|
+
runtime cleanup only.
|
|
72
|
+
|
|
73
|
+
#### Parameters
|
|
74
|
+
|
|
75
|
+
##### name
|
|
76
|
+
|
|
77
|
+
`string`
|
|
78
|
+
|
|
79
|
+
#### Returns
|
|
80
|
+
|
|
81
|
+
`Promise`\<`void`\>
|
|
82
|
+
|
|
83
|
+
***
|
|
84
|
+
|
|
50
85
|
<a id="getparameter"></a>
|
|
51
86
|
|
|
52
87
|
### getParameter()
|
|
53
88
|
|
|
54
89
|
> **getParameter**(`name`): `Promise`\<`string` \| `undefined`\>
|
|
55
90
|
|
|
56
|
-
Defined in: [ssm/ssm.ts:
|
|
91
|
+
Defined in: [ssm/ssm.ts:71](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/ssm/ssm.ts#L71)
|
|
57
92
|
|
|
58
93
|
Fetch a single SSM parameter's value.
|
|
59
94
|
|
|
@@ -80,7 +115,7 @@ value set.
|
|
|
80
115
|
|
|
81
116
|
> **getParameters**\<`K`\>(`aliases`): `Promise`\<`Record`\<`K`, `string` \| `undefined`\>\>
|
|
82
117
|
|
|
83
|
-
Defined in: [ssm/ssm.ts:
|
|
118
|
+
Defined in: [ssm/ssm.ts:98](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/ssm/ssm.ts#L98)
|
|
84
119
|
|
|
85
120
|
Fetch multiple SSM parameters in a single request. Callers supply an
|
|
86
121
|
alias-to-path record, and the returned record is keyed by the same
|
|
@@ -125,7 +160,7 @@ no value.
|
|
|
125
160
|
|
|
126
161
|
> **getParametersByPath**(`path`, `opts?`): `Promise`\<`Parameter`[]\>
|
|
127
162
|
|
|
128
|
-
Defined in: [ssm/ssm.ts:
|
|
163
|
+
Defined in: [ssm/ssm.ts:155](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/ssm/ssm.ts#L155)
|
|
129
164
|
|
|
130
165
|
Fetch all parameters under an SSM hierarchy path, auto-paginating across
|
|
131
166
|
all pages. `Recursive` defaults to `true` (overriding the AWS SDK
|
|
@@ -155,3 +190,29 @@ to `true`.
|
|
|
155
190
|
|
|
156
191
|
The full `Parameter` objects (including `Version`,
|
|
157
192
|
`LastModifiedDate`, etc.).
|
|
193
|
+
|
|
194
|
+
***
|
|
195
|
+
|
|
196
|
+
<a id="putparameter"></a>
|
|
197
|
+
|
|
198
|
+
### putParameter()
|
|
199
|
+
|
|
200
|
+
> **putParameter**(`input`): `Promise`\<`PutParameterCommandOutput`\>
|
|
201
|
+
|
|
202
|
+
Defined in: [ssm/ssm.ts:126](https://github.com/aligent/microservice-development-utilities/blob/a2bb34fea27b6af8b52791a3302aefd2b6af331f/packages/aws-wrappers/src/ssm/ssm.ts#L126)
|
|
203
|
+
|
|
204
|
+
Create or update an SSM parameter. The log line omits `Value` to avoid
|
|
205
|
+
leaking secret material.
|
|
206
|
+
|
|
207
|
+
Prefer IaC (CDK / Terraform) for parameter lifecycle — use this for
|
|
208
|
+
runtime values only.
|
|
209
|
+
|
|
210
|
+
#### Parameters
|
|
211
|
+
|
|
212
|
+
##### input
|
|
213
|
+
|
|
214
|
+
`PutParameterCommandInput`
|
|
215
|
+
|
|
216
|
+
#### Returns
|
|
217
|
+
|
|
218
|
+
`Promise`\<`PutParameterCommandOutput`\>
|