@aligent/aws-wrappers 0.1.2 → 0.2.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 +56 -0
- package/cjs/index.cjs +267 -0
- package/cjs/package.json +2 -1
- package/cjs/src/index.d.ts +1 -0
- package/cjs/src/scheduler/scheduler.d.ts +83 -0
- package/docs/classes/DynamoDBService.md +65 -34
- package/docs/classes/S3Service.md +73 -33
- package/docs/classes/SNSService.md +28 -8
- package/docs/classes/SQSService.md +30 -11
- package/docs/classes/SSMService.md +66 -9
- package/docs/classes/SchedulerService.md +269 -0
- package/docs/classes/SecretsManagerService.md +119 -7
- package/docs/classes/StepFunctionsService.md +9 -9
- package/docs/modules.md +1 -0
- package/esm/index.mjs +267 -1
- package/esm/package.json +2 -1
- package/esm/src/index.d.ts +1 -0
- package/esm/src/scheduler/scheduler.d.ts +83 -0
- package/package.json +2 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SQSService
|
|
8
8
|
|
|
9
|
-
Defined in: [sqs/sqs.ts:
|
|
9
|
+
Defined in: [sqs/sqs.ts:46](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/sqs/sqs.ts#L46)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS SQS client providing structured Powertools logging
|
|
12
12
|
and X-Ray tracing by default.
|
|
@@ -19,7 +19,7 @@ and X-Ray tracing by default.
|
|
|
19
19
|
|
|
20
20
|
> **new SQSService**(`opts?`): `SQSService`
|
|
21
21
|
|
|
22
|
-
Defined in: [sqs/sqs.ts:
|
|
22
|
+
Defined in: [sqs/sqs.ts:61](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/sqs/sqs.ts#L61)
|
|
23
23
|
|
|
24
24
|
#### Parameters
|
|
25
25
|
|
|
@@ -34,10 +34,19 @@ the wrapper does not apply X-Ray instrumentation.
|
|
|
34
34
|
|
|
35
35
|
###### logger?
|
|
36
36
|
|
|
37
|
-
`
|
|
37
|
+
`LoggerInterface`
|
|
38
38
|
|
|
39
|
-
Optional Powertools logger. Defaults to
|
|
40
|
-
`
|
|
39
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
40
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
41
|
+
|
|
42
|
+
###### truncate?
|
|
43
|
+
|
|
44
|
+
`boolean`
|
|
45
|
+
|
|
46
|
+
When `true`, oversized `MessageBody` is truncated
|
|
47
|
+
(byte-safe) before sending instead of failing at the SDK. Defaults to
|
|
48
|
+
`false`. Each `sendMessage` call can override via its own `truncate`
|
|
49
|
+
option.
|
|
41
50
|
|
|
42
51
|
#### Returns
|
|
43
52
|
|
|
@@ -51,7 +60,7 @@ Optional Powertools logger. Defaults to a logger with
|
|
|
51
60
|
|
|
52
61
|
> **deleteMessage**(`input`): `Promise`\<`DeleteMessageCommandOutput`\>
|
|
53
62
|
|
|
54
|
-
Defined in: [sqs/sqs.ts:
|
|
63
|
+
Defined in: [sqs/sqs.ts:117](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/sqs/sqs.ts#L117)
|
|
55
64
|
|
|
56
65
|
Delete a single message from an SQS queue.
|
|
57
66
|
|
|
@@ -73,7 +82,7 @@ Delete a single message from an SQS queue.
|
|
|
73
82
|
|
|
74
83
|
> **deleteMessageBatch**(`input`): `Promise`\<`DeleteMessageBatchCommandOutput`[]\>
|
|
75
84
|
|
|
76
|
-
Defined in: [sqs/sqs.ts:
|
|
85
|
+
Defined in: [sqs/sqs.ts:153](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/sqs/sqs.ts#L153)
|
|
77
86
|
|
|
78
87
|
Delete a batch of messages from an SQS queue. The SQS API caps
|
|
79
88
|
DeleteMessageBatch at 10 entries per request, so this method auto-chunks
|
|
@@ -97,7 +106,7 @@ the caller's entries and sends one request per chunk.
|
|
|
97
106
|
|
|
98
107
|
> **receiveMessages**(`input`): `Promise`\<`Message`[]\>
|
|
99
108
|
|
|
100
|
-
Defined in: [sqs/sqs.ts:
|
|
109
|
+
Defined in: [sqs/sqs.ts:108](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/sqs/sqs.ts#L108)
|
|
101
110
|
|
|
102
111
|
Receive messages from an SQS queue. Returns an empty array when no
|
|
103
112
|
messages are available. No automatic deletion is performed — visibility
|
|
@@ -121,18 +130,28 @@ The `Messages` array from the response, or `[]` if absent.
|
|
|
121
130
|
|
|
122
131
|
### sendMessage()
|
|
123
132
|
|
|
124
|
-
> **sendMessage**(`input`): `Promise`\<`SendMessageCommandOutput`\>
|
|
133
|
+
> **sendMessage**(`input`, `opts?`): `Promise`\<`SendMessageCommandOutput`\>
|
|
125
134
|
|
|
126
|
-
Defined in: [sqs/sqs.ts:
|
|
135
|
+
Defined in: [sqs/sqs.ts:74](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/sqs/sqs.ts#L74)
|
|
127
136
|
|
|
128
137
|
Send a single message to an SQS queue.
|
|
129
138
|
|
|
139
|
+
At INFO level the log line includes only queue routing / FIFO metadata;
|
|
140
|
+
see `SEND_MESSAGE_SAFE_FIELDS`. `POWERTOOLS_LOG_LEVEL=DEBUG` unlocks the
|
|
141
|
+
full input.
|
|
142
|
+
|
|
130
143
|
#### Parameters
|
|
131
144
|
|
|
132
145
|
##### input
|
|
133
146
|
|
|
134
147
|
`SendMessageCommandInput`
|
|
135
148
|
|
|
149
|
+
##### opts?
|
|
150
|
+
|
|
151
|
+
###### truncate?
|
|
152
|
+
|
|
153
|
+
`boolean`
|
|
154
|
+
|
|
136
155
|
#### Returns
|
|
137
156
|
|
|
138
157
|
`Promise`\<`SendMessageCommandOutput`\>
|
|
@@ -145,7 +164,7 @@ Send a single message to an SQS queue.
|
|
|
145
164
|
|
|
146
165
|
> **sendMessageBatch**(`input`): `Promise`\<`SendMessageBatchCommandOutput`[]\>
|
|
147
166
|
|
|
148
|
-
Defined in: [sqs/sqs.ts:
|
|
167
|
+
Defined in: [sqs/sqs.ts:127](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/sqs/sqs.ts#L127)
|
|
149
168
|
|
|
150
169
|
Send a batch of messages to an SQS queue. The SQS API caps
|
|
151
170
|
SendMessageBatch at 10 entries per request, so this method auto-chunks
|
|
@@ -6,13 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SSMService
|
|
8
8
|
|
|
9
|
-
Defined in: [ssm/ssm.ts:
|
|
9
|
+
Defined in: [ssm/ssm.ts:47](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/ssm/ssm.ts#L47)
|
|
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
|
+
Write operations (`putParameter`, `deleteParameter`) are exposed for
|
|
17
|
+
convenience but should be used with care: parameter lifecycle is usually
|
|
18
|
+
managed by IaC (CDK / Terraform). Prefer IaC for anything that exists at
|
|
19
|
+
deploy time; reserve runtime writes for values that genuinely need to
|
|
20
|
+
mutate within the application.
|
|
21
|
+
|
|
16
22
|
## Constructors
|
|
17
23
|
|
|
18
24
|
<a id="constructor"></a>
|
|
@@ -21,7 +27,7 @@ directly.
|
|
|
21
27
|
|
|
22
28
|
> **new SSMService**(`opts?`): `SSMService`
|
|
23
29
|
|
|
24
|
-
Defined in: [ssm/ssm.ts:
|
|
30
|
+
Defined in: [ssm/ssm.ts:57](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/ssm/ssm.ts#L57)
|
|
25
31
|
|
|
26
32
|
#### Parameters
|
|
27
33
|
|
|
@@ -36,10 +42,10 @@ the wrapper does not apply X-Ray instrumentation.
|
|
|
36
42
|
|
|
37
43
|
###### logger?
|
|
38
44
|
|
|
39
|
-
`
|
|
45
|
+
`LoggerInterface`
|
|
40
46
|
|
|
41
|
-
Optional Powertools logger. Defaults to
|
|
42
|
-
`
|
|
47
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
48
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
43
49
|
|
|
44
50
|
#### Returns
|
|
45
51
|
|
|
@@ -47,13 +53,38 @@ Optional Powertools logger. Defaults to a logger with
|
|
|
47
53
|
|
|
48
54
|
## Methods
|
|
49
55
|
|
|
56
|
+
<a id="deleteparameter"></a>
|
|
57
|
+
|
|
58
|
+
### deleteParameter()
|
|
59
|
+
|
|
60
|
+
> **deleteParameter**(`name`): `Promise`\<`void`\>
|
|
61
|
+
|
|
62
|
+
Defined in: [ssm/ssm.ts:136](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/ssm/ssm.ts#L136)
|
|
63
|
+
|
|
64
|
+
Delete an SSM parameter by name.
|
|
65
|
+
|
|
66
|
+
Prefer IaC (CDK / Terraform) for parameter lifecycle — use this for
|
|
67
|
+
runtime cleanup only.
|
|
68
|
+
|
|
69
|
+
#### Parameters
|
|
70
|
+
|
|
71
|
+
##### name
|
|
72
|
+
|
|
73
|
+
`string`
|
|
74
|
+
|
|
75
|
+
#### Returns
|
|
76
|
+
|
|
77
|
+
`Promise`\<`void`\>
|
|
78
|
+
|
|
79
|
+
***
|
|
80
|
+
|
|
50
81
|
<a id="getparameter"></a>
|
|
51
82
|
|
|
52
83
|
### getParameter()
|
|
53
84
|
|
|
54
85
|
> **getParameter**(`name`): `Promise`\<`string` \| `undefined`\>
|
|
55
86
|
|
|
56
|
-
Defined in: [ssm/ssm.ts:
|
|
87
|
+
Defined in: [ssm/ssm.ts:68](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/ssm/ssm.ts#L68)
|
|
57
88
|
|
|
58
89
|
Fetch a single SSM parameter's value.
|
|
59
90
|
|
|
@@ -80,7 +111,7 @@ value set.
|
|
|
80
111
|
|
|
81
112
|
> **getParameters**\<`K`\>(`aliases`): `Promise`\<`Record`\<`K`, `string` \| `undefined`\>\>
|
|
82
113
|
|
|
83
|
-
Defined in: [ssm/ssm.ts:
|
|
114
|
+
Defined in: [ssm/ssm.ts:95](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/ssm/ssm.ts#L95)
|
|
84
115
|
|
|
85
116
|
Fetch multiple SSM parameters in a single request. Callers supply an
|
|
86
117
|
alias-to-path record, and the returned record is keyed by the same
|
|
@@ -125,7 +156,7 @@ no value.
|
|
|
125
156
|
|
|
126
157
|
> **getParametersByPath**(`path`, `opts?`): `Promise`\<`Parameter`[]\>
|
|
127
158
|
|
|
128
|
-
Defined in: [ssm/ssm.ts:
|
|
159
|
+
Defined in: [ssm/ssm.ts:152](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/ssm/ssm.ts#L152)
|
|
129
160
|
|
|
130
161
|
Fetch all parameters under an SSM hierarchy path, auto-paginating across
|
|
131
162
|
all pages. `Recursive` defaults to `true` (overriding the AWS SDK
|
|
@@ -155,3 +186,29 @@ to `true`.
|
|
|
155
186
|
|
|
156
187
|
The full `Parameter` objects (including `Version`,
|
|
157
188
|
`LastModifiedDate`, etc.).
|
|
189
|
+
|
|
190
|
+
***
|
|
191
|
+
|
|
192
|
+
<a id="putparameter"></a>
|
|
193
|
+
|
|
194
|
+
### putParameter()
|
|
195
|
+
|
|
196
|
+
> **putParameter**(`input`): `Promise`\<`PutParameterCommandOutput`\>
|
|
197
|
+
|
|
198
|
+
Defined in: [ssm/ssm.ts:123](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/ssm/ssm.ts#L123)
|
|
199
|
+
|
|
200
|
+
Create or update an SSM parameter. The log line omits `Value` to avoid
|
|
201
|
+
leaking secret material.
|
|
202
|
+
|
|
203
|
+
Prefer IaC (CDK / Terraform) for parameter lifecycle — use this for
|
|
204
|
+
runtime values only.
|
|
205
|
+
|
|
206
|
+
#### Parameters
|
|
207
|
+
|
|
208
|
+
##### input
|
|
209
|
+
|
|
210
|
+
`PutParameterCommandInput`
|
|
211
|
+
|
|
212
|
+
#### Returns
|
|
213
|
+
|
|
214
|
+
`Promise`\<`PutParameterCommandOutput`\>
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
[**@aligent/aws-wrappers**](../modules.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@aligent/aws-wrappers](../modules.md) / SchedulerService
|
|
6
|
+
|
|
7
|
+
# Class: SchedulerService
|
|
8
|
+
|
|
9
|
+
Defined in: scheduler/scheduler.ts:75
|
|
10
|
+
|
|
11
|
+
Wrapper around the AWS EventBridge Scheduler client providing structured
|
|
12
|
+
Powertools logging and X-Ray tracing by default.
|
|
13
|
+
|
|
14
|
+
Covers CRUD on schedules and their groups. Named `SchedulerService` (not
|
|
15
|
+
`EventBridgeSchedulerService`) so it doesn't collide with a future wrapper
|
|
16
|
+
over the separate EventBridge bus/rules API (`@aws-sdk/client-eventbridge`).
|
|
17
|
+
|
|
18
|
+
`FlexibleTimeWindow` is required by `CreateSchedule` and is passed through
|
|
19
|
+
untouched — the wrapper bakes in no default, so the caller must state their
|
|
20
|
+
intent (`{ Mode: 'OFF' }` for a fixed-time schedule).
|
|
21
|
+
|
|
22
|
+
## Constructors
|
|
23
|
+
|
|
24
|
+
<a id="constructor"></a>
|
|
25
|
+
|
|
26
|
+
### Constructor
|
|
27
|
+
|
|
28
|
+
> **new SchedulerService**(`opts?`): `SchedulerService`
|
|
29
|
+
|
|
30
|
+
Defined in: scheduler/scheduler.ts:85
|
|
31
|
+
|
|
32
|
+
#### Parameters
|
|
33
|
+
|
|
34
|
+
##### opts?
|
|
35
|
+
|
|
36
|
+
###### client?
|
|
37
|
+
|
|
38
|
+
`SchedulerClient`
|
|
39
|
+
|
|
40
|
+
Optional pre-configured `SchedulerClient`. When
|
|
41
|
+
supplied, the wrapper does not apply X-Ray instrumentation.
|
|
42
|
+
|
|
43
|
+
###### logger?
|
|
44
|
+
|
|
45
|
+
`LoggerInterface`
|
|
46
|
+
|
|
47
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
48
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
49
|
+
|
|
50
|
+
#### Returns
|
|
51
|
+
|
|
52
|
+
`SchedulerService`
|
|
53
|
+
|
|
54
|
+
## Methods
|
|
55
|
+
|
|
56
|
+
<a id="createschedule"></a>
|
|
57
|
+
|
|
58
|
+
### createSchedule()
|
|
59
|
+
|
|
60
|
+
> **createSchedule**(`input`): `Promise`\<`CreateScheduleCommandOutput`\>
|
|
61
|
+
|
|
62
|
+
Defined in: scheduler/scheduler.ts:95
|
|
63
|
+
|
|
64
|
+
Create a new schedule. At INFO the log line omits `Target.Input` (the
|
|
65
|
+
target payload, a PII carrier); `POWERTOOLS_LOG_LEVEL=DEBUG` unlocks the
|
|
66
|
+
full input.
|
|
67
|
+
|
|
68
|
+
#### Parameters
|
|
69
|
+
|
|
70
|
+
##### input
|
|
71
|
+
|
|
72
|
+
`CreateScheduleCommandInput`
|
|
73
|
+
|
|
74
|
+
#### Returns
|
|
75
|
+
|
|
76
|
+
`Promise`\<`CreateScheduleCommandOutput`\>
|
|
77
|
+
|
|
78
|
+
***
|
|
79
|
+
|
|
80
|
+
<a id="createschedulegroup"></a>
|
|
81
|
+
|
|
82
|
+
### createScheduleGroup()
|
|
83
|
+
|
|
84
|
+
> **createScheduleGroup**(`input`): `Promise`\<`CreateScheduleGroupCommandOutput`\>
|
|
85
|
+
|
|
86
|
+
Defined in: scheduler/scheduler.ts:154
|
|
87
|
+
|
|
88
|
+
Create a new schedule group. Groups are containers for schedules and are
|
|
89
|
+
typically IaC-managed; use this for dynamically-provisioned groups only.
|
|
90
|
+
|
|
91
|
+
#### Parameters
|
|
92
|
+
|
|
93
|
+
##### input
|
|
94
|
+
|
|
95
|
+
`CreateScheduleGroupCommandInput`
|
|
96
|
+
|
|
97
|
+
#### Returns
|
|
98
|
+
|
|
99
|
+
`Promise`\<`CreateScheduleGroupCommandOutput`\>
|
|
100
|
+
|
|
101
|
+
***
|
|
102
|
+
|
|
103
|
+
<a id="deleteschedule"></a>
|
|
104
|
+
|
|
105
|
+
### deleteSchedule()
|
|
106
|
+
|
|
107
|
+
> **deleteSchedule**(`input`): `Promise`\<`DeleteScheduleCommandOutput`\>
|
|
108
|
+
|
|
109
|
+
Defined in: scheduler/scheduler.ts:130
|
|
110
|
+
|
|
111
|
+
Delete a schedule.
|
|
112
|
+
|
|
113
|
+
#### Parameters
|
|
114
|
+
|
|
115
|
+
##### input
|
|
116
|
+
|
|
117
|
+
`DeleteScheduleCommandInput`
|
|
118
|
+
|
|
119
|
+
#### Returns
|
|
120
|
+
|
|
121
|
+
`Promise`\<`DeleteScheduleCommandOutput`\>
|
|
122
|
+
|
|
123
|
+
***
|
|
124
|
+
|
|
125
|
+
<a id="deleteschedulegroup"></a>
|
|
126
|
+
|
|
127
|
+
### deleteScheduleGroup()
|
|
128
|
+
|
|
129
|
+
> **deleteScheduleGroup**(`input`): `Promise`\<`DeleteScheduleGroupCommandOutput`\>
|
|
130
|
+
|
|
131
|
+
Defined in: scheduler/scheduler.ts:176
|
|
132
|
+
|
|
133
|
+
Delete a schedule group. Deleting a group also deletes every schedule it
|
|
134
|
+
contains, asynchronously — the API has no `UpdateScheduleGroup`, so this
|
|
135
|
+
is the only mutating group operation besides create.
|
|
136
|
+
|
|
137
|
+
#### Parameters
|
|
138
|
+
|
|
139
|
+
##### input
|
|
140
|
+
|
|
141
|
+
`DeleteScheduleGroupCommandInput`
|
|
142
|
+
|
|
143
|
+
#### Returns
|
|
144
|
+
|
|
145
|
+
`Promise`\<`DeleteScheduleGroupCommandOutput`\>
|
|
146
|
+
|
|
147
|
+
***
|
|
148
|
+
|
|
149
|
+
<a id="getschedule"></a>
|
|
150
|
+
|
|
151
|
+
### getSchedule()
|
|
152
|
+
|
|
153
|
+
> **getSchedule**(`input`): `Promise`\<`GetScheduleCommandOutput`\>
|
|
154
|
+
|
|
155
|
+
Defined in: scheduler/scheduler.ts:103
|
|
156
|
+
|
|
157
|
+
Fetch a schedule's full configuration.
|
|
158
|
+
|
|
159
|
+
#### Parameters
|
|
160
|
+
|
|
161
|
+
##### input
|
|
162
|
+
|
|
163
|
+
`GetScheduleCommandInput`
|
|
164
|
+
|
|
165
|
+
#### Returns
|
|
166
|
+
|
|
167
|
+
`Promise`\<`GetScheduleCommandOutput`\>
|
|
168
|
+
|
|
169
|
+
***
|
|
170
|
+
|
|
171
|
+
<a id="getschedulegroup"></a>
|
|
172
|
+
|
|
173
|
+
### getScheduleGroup()
|
|
174
|
+
|
|
175
|
+
> **getScheduleGroup**(`input`): `Promise`\<`GetScheduleGroupCommandOutput`\>
|
|
176
|
+
|
|
177
|
+
Defined in: scheduler/scheduler.ts:164
|
|
178
|
+
|
|
179
|
+
Fetch a schedule group's configuration.
|
|
180
|
+
|
|
181
|
+
#### Parameters
|
|
182
|
+
|
|
183
|
+
##### input
|
|
184
|
+
|
|
185
|
+
`GetScheduleGroupCommandInput`
|
|
186
|
+
|
|
187
|
+
#### Returns
|
|
188
|
+
|
|
189
|
+
`Promise`\<`GetScheduleGroupCommandOutput`\>
|
|
190
|
+
|
|
191
|
+
***
|
|
192
|
+
|
|
193
|
+
<a id="listschedulegroups"></a>
|
|
194
|
+
|
|
195
|
+
### listScheduleGroups()
|
|
196
|
+
|
|
197
|
+
> **listScheduleGroups**(`input?`): `Promise`\<`ScheduleGroupSummary`[]\>
|
|
198
|
+
|
|
199
|
+
Defined in: scheduler/scheduler.ts:187
|
|
200
|
+
|
|
201
|
+
List schedule groups, auto-paginating across all pages. Bounded in
|
|
202
|
+
practice by the account's group count and the `NamePrefix` filter.
|
|
203
|
+
|
|
204
|
+
#### Parameters
|
|
205
|
+
|
|
206
|
+
##### input?
|
|
207
|
+
|
|
208
|
+
`ListScheduleGroupsCommandInput`
|
|
209
|
+
|
|
210
|
+
#### Returns
|
|
211
|
+
|
|
212
|
+
`Promise`\<`ScheduleGroupSummary`[]\>
|
|
213
|
+
|
|
214
|
+
***
|
|
215
|
+
|
|
216
|
+
<a id="listschedules"></a>
|
|
217
|
+
|
|
218
|
+
### listSchedules()
|
|
219
|
+
|
|
220
|
+
> **listSchedules**(`input?`): `Promise`\<`ScheduleSummary`[]\>
|
|
221
|
+
|
|
222
|
+
Defined in: scheduler/scheduler.ts:140
|
|
223
|
+
|
|
224
|
+
List schedules, auto-paginating across all pages. Bounded in practice by
|
|
225
|
+
the account's schedule count and the `GroupName` / `NamePrefix` / `State`
|
|
226
|
+
filters, so the flat-array shape is safe.
|
|
227
|
+
|
|
228
|
+
#### Parameters
|
|
229
|
+
|
|
230
|
+
##### input?
|
|
231
|
+
|
|
232
|
+
`ListSchedulesCommandInput`
|
|
233
|
+
|
|
234
|
+
#### Returns
|
|
235
|
+
|
|
236
|
+
`Promise`\<`ScheduleSummary`[]\>
|
|
237
|
+
|
|
238
|
+
***
|
|
239
|
+
|
|
240
|
+
<a id="updateschedule"></a>
|
|
241
|
+
|
|
242
|
+
### updateSchedule()
|
|
243
|
+
|
|
244
|
+
> **updateSchedule**(`input`): `Promise`\<`UpdateScheduleCommandOutput`\>
|
|
245
|
+
|
|
246
|
+
Defined in: scheduler/scheduler.ts:122
|
|
247
|
+
|
|
248
|
+
Update an existing schedule.
|
|
249
|
+
|
|
250
|
+
**`UpdateSchedule` has PUT (full-replacement) semantics.** Any field you
|
|
251
|
+
omit is reset to its default — this is not a partial patch. To change one
|
|
252
|
+
attribute, `getSchedule` first and resend the complete configuration with
|
|
253
|
+
that attribute modified, or you will silently erase `ScheduleExpression`,
|
|
254
|
+
`Target`, `Description`, `StartDate`, etc. The wrapper does not merge on
|
|
255
|
+
your behalf: deep-merging a `Target` (with its mutually-exclusive
|
|
256
|
+
target-type params) has no single correct semantics.
|
|
257
|
+
|
|
258
|
+
At INFO the log line omits `Target.Input`; `POWERTOOLS_LOG_LEVEL=DEBUG`
|
|
259
|
+
unlocks the full input.
|
|
260
|
+
|
|
261
|
+
#### Parameters
|
|
262
|
+
|
|
263
|
+
##### input
|
|
264
|
+
|
|
265
|
+
`UpdateScheduleCommandInput`
|
|
266
|
+
|
|
267
|
+
#### Returns
|
|
268
|
+
|
|
269
|
+
`Promise`\<`UpdateScheduleCommandOutput`\>
|
|
@@ -6,11 +6,18 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SecretsManagerService
|
|
8
8
|
|
|
9
|
-
Defined in: [secrets-manager/secrets-manager.ts:
|
|
9
|
+
Defined in: [secrets-manager/secrets-manager.ts:72](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/secrets-manager/secrets-manager.ts#L72)
|
|
10
10
|
|
|
11
11
|
Wrapper around the AWS Secrets Manager client providing structured
|
|
12
12
|
Powertools logging and X-Ray tracing by default.
|
|
13
13
|
|
|
14
|
+
Write operations (`createSecret`, `updateSecret`, `putSecretValue`,
|
|
15
|
+
`deleteSecret`) are exposed for convenience but should be used with care:
|
|
16
|
+
secret lifecycle is usually managed by IaC (CDK / Terraform). Prefer IaC
|
|
17
|
+
for anything that exists at deploy time; reserve runtime writes for
|
|
18
|
+
dynamically-issued credentials, rotation flows, or other genuinely
|
|
19
|
+
mutable values.
|
|
20
|
+
|
|
14
21
|
## Constructors
|
|
15
22
|
|
|
16
23
|
<a id="constructor"></a>
|
|
@@ -19,7 +26,7 @@ Powertools logging and X-Ray tracing by default.
|
|
|
19
26
|
|
|
20
27
|
> **new SecretsManagerService**(`opts?`): `SecretsManagerService`
|
|
21
28
|
|
|
22
|
-
Defined in: [secrets-manager/secrets-manager.ts:
|
|
29
|
+
Defined in: [secrets-manager/secrets-manager.ts:83](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/secrets-manager/secrets-manager.ts#L83)
|
|
23
30
|
|
|
24
31
|
#### Parameters
|
|
25
32
|
|
|
@@ -35,10 +42,10 @@ owns that decision.
|
|
|
35
42
|
|
|
36
43
|
###### logger?
|
|
37
44
|
|
|
38
|
-
`
|
|
45
|
+
`LoggerInterface`
|
|
39
46
|
|
|
40
|
-
Optional Powertools logger. Defaults to
|
|
41
|
-
`
|
|
47
|
+
Optional Powertools logger. Defaults to `new Logger()`,
|
|
48
|
+
which picks up `POWERTOOLS_SERVICE_NAME` from the environment.
|
|
42
49
|
|
|
43
50
|
#### Returns
|
|
44
51
|
|
|
@@ -46,13 +53,65 @@ Optional Powertools logger. Defaults to a logger with
|
|
|
46
53
|
|
|
47
54
|
## Methods
|
|
48
55
|
|
|
56
|
+
<a id="createsecret"></a>
|
|
57
|
+
|
|
58
|
+
### createSecret()
|
|
59
|
+
|
|
60
|
+
> **createSecret**(`input`): `Promise`\<`CreateSecretCommandOutput`\>
|
|
61
|
+
|
|
62
|
+
Defined in: [secrets-manager/secrets-manager.ts:121](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/secrets-manager/secrets-manager.ts#L121)
|
|
63
|
+
|
|
64
|
+
Create a new secret. At INFO level the log line includes only identity
|
|
65
|
+
and non-secret metadata; `POWERTOOLS_LOG_LEVEL=DEBUG` unlocks the full
|
|
66
|
+
input (including `SecretString` / `SecretBinary`).
|
|
67
|
+
|
|
68
|
+
Prefer IaC (CDK / Terraform) for secret lifecycle — use this for
|
|
69
|
+
dynamically-issued credentials only.
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
##### input
|
|
74
|
+
|
|
75
|
+
`CreateSecretCommandInput`
|
|
76
|
+
|
|
77
|
+
#### Returns
|
|
78
|
+
|
|
79
|
+
`Promise`\<`CreateSecretCommandOutput`\>
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
<a id="deletesecret"></a>
|
|
84
|
+
|
|
85
|
+
### deleteSecret()
|
|
86
|
+
|
|
87
|
+
> **deleteSecret**(`input`): `Promise`\<`DeleteSecretCommandOutput`\>
|
|
88
|
+
|
|
89
|
+
Defined in: [secrets-manager/secrets-manager.ts:163](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/secrets-manager/secrets-manager.ts#L163)
|
|
90
|
+
|
|
91
|
+
Delete a secret. Pass `ForceDeleteWithoutRecovery: true` to bypass the
|
|
92
|
+
default 7-30 day recovery window (irreversible).
|
|
93
|
+
|
|
94
|
+
Prefer IaC (CDK / Terraform) for secret lifecycle.
|
|
95
|
+
|
|
96
|
+
#### Parameters
|
|
97
|
+
|
|
98
|
+
##### input
|
|
99
|
+
|
|
100
|
+
`DeleteSecretCommandInput`
|
|
101
|
+
|
|
102
|
+
#### Returns
|
|
103
|
+
|
|
104
|
+
`Promise`\<`DeleteSecretCommandOutput`\>
|
|
105
|
+
|
|
106
|
+
***
|
|
107
|
+
|
|
49
108
|
<a id="getjsonsecret"></a>
|
|
50
109
|
|
|
51
110
|
### getJsonSecret()
|
|
52
111
|
|
|
53
112
|
> **getJsonSecret**\<`T`\>(`secretId`): `Promise`\<`T`\>
|
|
54
113
|
|
|
55
|
-
Defined in: [secrets-manager/secrets-manager.ts:
|
|
114
|
+
Defined in: [secrets-manager/secrets-manager.ts:107](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/secrets-manager/secrets-manager.ts#L107)
|
|
56
115
|
|
|
57
116
|
Fetch a secret and parse it as JSON.
|
|
58
117
|
|
|
@@ -90,7 +149,7 @@ If the secret has no `SecretString` or the value is not valid JSON.
|
|
|
90
149
|
|
|
91
150
|
> **getSecret**(`secretId`): `Promise`\<`string`\>
|
|
92
151
|
|
|
93
|
-
Defined in: [secrets-manager/secrets-manager.ts:
|
|
152
|
+
Defined in: [secrets-manager/secrets-manager.ts:95](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/secrets-manager/secrets-manager.ts#L95)
|
|
94
153
|
|
|
95
154
|
Fetch a secret's string value from Secrets Manager.
|
|
96
155
|
|
|
@@ -112,3 +171,56 @@ The secret's `SecretString` value.
|
|
|
112
171
|
|
|
113
172
|
If the response does not contain a `SecretString` (e.g. the secret
|
|
114
173
|
stores binary data).
|
|
174
|
+
|
|
175
|
+
***
|
|
176
|
+
|
|
177
|
+
<a id="putsecretvalue"></a>
|
|
178
|
+
|
|
179
|
+
### putSecretValue()
|
|
180
|
+
|
|
181
|
+
> **putSecretValue**(`input`): `Promise`\<`PutSecretValueCommandOutput`\>
|
|
182
|
+
|
|
183
|
+
Defined in: [secrets-manager/secrets-manager.ts:150](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/secrets-manager/secrets-manager.ts#L150)
|
|
184
|
+
|
|
185
|
+
Store a new version of a secret's value. At INFO level the log line
|
|
186
|
+
omits `SecretString` / `SecretBinary`; `POWERTOOLS_LOG_LEVEL=DEBUG`
|
|
187
|
+
unlocks the full input.
|
|
188
|
+
|
|
189
|
+
Typically used by rotation flows.
|
|
190
|
+
|
|
191
|
+
#### Parameters
|
|
192
|
+
|
|
193
|
+
##### input
|
|
194
|
+
|
|
195
|
+
`PutSecretValueCommandInput`
|
|
196
|
+
|
|
197
|
+
#### Returns
|
|
198
|
+
|
|
199
|
+
`Promise`\<`PutSecretValueCommandOutput`\>
|
|
200
|
+
|
|
201
|
+
***
|
|
202
|
+
|
|
203
|
+
<a id="updatesecret"></a>
|
|
204
|
+
|
|
205
|
+
### updateSecret()
|
|
206
|
+
|
|
207
|
+
> **updateSecret**(`input`): `Promise`\<`UpdateSecretCommandOutput`\>
|
|
208
|
+
|
|
209
|
+
Defined in: [secrets-manager/secrets-manager.ts:136](https://github.com/aligent/microservice-development-utilities/blob/1c8403742cbf82a4bd82725126d0860e0996e39d/packages/aws-wrappers/src/secrets-manager/secrets-manager.ts#L136)
|
|
210
|
+
|
|
211
|
+
Update an existing secret's metadata or value. At INFO level the log
|
|
212
|
+
line omits `SecretString` / `SecretBinary`; `POWERTOOLS_LOG_LEVEL=DEBUG`
|
|
213
|
+
unlocks the full input.
|
|
214
|
+
|
|
215
|
+
Prefer IaC (CDK / Terraform) for secret lifecycle — use this for
|
|
216
|
+
runtime metadata updates only.
|
|
217
|
+
|
|
218
|
+
#### Parameters
|
|
219
|
+
|
|
220
|
+
##### input
|
|
221
|
+
|
|
222
|
+
`UpdateSecretCommandInput`
|
|
223
|
+
|
|
224
|
+
#### Returns
|
|
225
|
+
|
|
226
|
+
`Promise`\<`UpdateSecretCommandOutput`\>
|