@dyanet/config-aws 1.0.0 → 1.0.1
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 +334 -65
- package/dist/cjs/loaders/secrets-manager.loader.js +10 -3
- package/dist/cjs/loaders/secrets-manager.loader.js.map +1 -1
- package/dist/esm/loaders/secrets-manager.loader.js +10 -3
- package/dist/esm/loaders/secrets-manager.loader.js.map +1 -1
- package/dist/types/loaders/secrets-manager.loader.d.ts +1 -1
- package/dist/types/loaders/secrets-manager.loader.d.ts.map +1 -1
- package/package.json +7 -10
package/README.md
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
# @dyanet/config-aws
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@dyanet/config-aws)
|
|
4
|
+
[](https://github.com/dyanet/config-aws/actions/workflows/ci.yml)
|
|
5
|
+
[](https://codecov.io/gh/dyanet/config-aws)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
Framework-agnostic AWS configuration management library for Node.js applications. Load configuration from environment variables, AWS Secrets Manager, SSM Parameter Store, S3, and `.env` files with configurable precedence.
|
|
4
9
|
|
|
5
10
|
## Features
|
|
6
11
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
12
|
+
- **Framework Agnostic** - Works with any JavaScript/TypeScript application
|
|
13
|
+
- **Multiple Sources** - Environment variables, `.env` files, S3, Secrets Manager, SSM Parameter Store
|
|
14
|
+
- **Configurable Precedence** - Control which sources override others
|
|
15
|
+
- **Schema Validation** - Validate configuration with Zod schemas
|
|
16
|
+
- **TypeScript First** - Full type safety and IntelliSense support
|
|
17
|
+
- **Verbose Logging** - Debug configuration loading with detailed output
|
|
18
|
+
- **Tree-Shakeable** - ESM and CommonJS builds with tree-shaking support
|
|
13
19
|
|
|
14
20
|
## Installation
|
|
15
21
|
|
|
@@ -42,27 +48,27 @@ import { ConfigManager, EnvironmentLoader, SecretsManagerLoader } from '@dyanet/
|
|
|
42
48
|
import { z } from 'zod';
|
|
43
49
|
|
|
44
50
|
// Define your configuration schema
|
|
45
|
-
const
|
|
51
|
+
const schema = z.object({
|
|
46
52
|
DATABASE_URL: z.string(),
|
|
47
53
|
API_KEY: z.string(),
|
|
48
|
-
PORT: z.
|
|
54
|
+
PORT: z.coerce.number().default(3000),
|
|
49
55
|
});
|
|
50
56
|
|
|
51
57
|
// Create and load configuration
|
|
52
|
-
const
|
|
58
|
+
const config = new ConfigManager({
|
|
53
59
|
loaders: [
|
|
54
60
|
new EnvironmentLoader({ prefix: 'APP_' }),
|
|
55
|
-
new SecretsManagerLoader({ secretName: '/
|
|
61
|
+
new SecretsManagerLoader({ secretName: '/my-app/config' }),
|
|
56
62
|
],
|
|
57
|
-
schema
|
|
58
|
-
precedence: 'aws-first', // AWS
|
|
63
|
+
schema,
|
|
64
|
+
precedence: 'aws-first', // AWS sources override local
|
|
59
65
|
});
|
|
60
66
|
|
|
61
|
-
await
|
|
67
|
+
await config.load();
|
|
62
68
|
|
|
63
|
-
// Access configuration
|
|
64
|
-
const dbUrl =
|
|
65
|
-
const allConfig =
|
|
69
|
+
// Access configuration values
|
|
70
|
+
const dbUrl = config.get('DATABASE_URL');
|
|
71
|
+
const allConfig = config.getAll();
|
|
66
72
|
```
|
|
67
73
|
|
|
68
74
|
## Loaders
|
|
@@ -72,123 +78,386 @@ const allConfig = configManager.getAll();
|
|
|
72
78
|
Loads configuration from `process.env` with optional prefix filtering.
|
|
73
79
|
|
|
74
80
|
```typescript
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
import { EnvironmentLoader } from '@dyanet/config-aws';
|
|
82
|
+
|
|
83
|
+
const loader = new EnvironmentLoader({
|
|
84
|
+
prefix: 'APP_', // Only load vars starting with APP_
|
|
85
|
+
exclude: ['APP_SECRET'], // Exclude specific variables
|
|
78
86
|
});
|
|
79
87
|
```
|
|
80
88
|
|
|
89
|
+
| Option | Type | Default | Description |
|
|
90
|
+
|--------|------|---------|-------------|
|
|
91
|
+
| `prefix` | `string` | `undefined` | Only load variables starting with this prefix (prefix is stripped from keys) |
|
|
92
|
+
| `exclude` | `string[]` | `[]` | Variable names to exclude from loading |
|
|
93
|
+
|
|
81
94
|
### EnvFileLoader
|
|
82
95
|
|
|
83
|
-
Loads configuration from `.env` files using AWS ECS format.
|
|
96
|
+
Loads configuration from `.env` files using [AWS ECS environment file format](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/use-environment-file.html).
|
|
84
97
|
|
|
85
98
|
```typescript
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
99
|
+
import { EnvFileLoader } from '@dyanet/config-aws';
|
|
100
|
+
|
|
101
|
+
const loader = new EnvFileLoader({
|
|
102
|
+
paths: ['.env', '.env.local', '.env.production'],
|
|
103
|
+
override: true,
|
|
89
104
|
});
|
|
90
105
|
```
|
|
91
106
|
|
|
107
|
+
| Option | Type | Default | Description |
|
|
108
|
+
|--------|------|---------|-------------|
|
|
109
|
+
| `paths` | `string[]` | `['.env', '.env.local']` | Paths to `.env` files to load |
|
|
110
|
+
| `encoding` | `BufferEncoding` | `'utf-8'` | File encoding |
|
|
111
|
+
| `override` | `boolean` | `true` | Whether later files override earlier ones |
|
|
112
|
+
|
|
113
|
+
**Environment File Format:**
|
|
114
|
+
```bash
|
|
115
|
+
# Lines beginning with # are comments
|
|
116
|
+
DATABASE_URL=postgres://localhost:5432/db
|
|
117
|
+
API_KEY=sk-1234567890
|
|
118
|
+
|
|
119
|
+
# Values can contain = signs
|
|
120
|
+
CONNECTION_STRING=host=localhost;port=5432
|
|
121
|
+
|
|
122
|
+
# No quotes needed - quotes are literal
|
|
123
|
+
MESSAGE=Hello World
|
|
124
|
+
```
|
|
125
|
+
|
|
92
126
|
### S3Loader
|
|
93
127
|
|
|
94
|
-
Loads configuration from S3 buckets
|
|
128
|
+
Loads configuration from S3 buckets. Supports JSON and `.env` formats with auto-detection.
|
|
95
129
|
|
|
96
130
|
```typescript
|
|
97
|
-
|
|
131
|
+
import { S3Loader } from '@dyanet/config-aws';
|
|
132
|
+
|
|
133
|
+
const loader = new S3Loader({
|
|
98
134
|
bucket: 'my-config-bucket',
|
|
99
135
|
key: 'config/production.json',
|
|
100
|
-
|
|
136
|
+
region: 'us-east-1',
|
|
137
|
+
format: 'auto', // or 'json' | 'env'
|
|
101
138
|
});
|
|
102
139
|
```
|
|
103
140
|
|
|
141
|
+
| Option | Type | Default | Description |
|
|
142
|
+
|--------|------|---------|-------------|
|
|
143
|
+
| `bucket` | `string` | **required** | S3 bucket name |
|
|
144
|
+
| `key` | `string` | **required** | S3 object key |
|
|
145
|
+
| `region` | `string` | `undefined` | AWS region (uses default if not specified) |
|
|
146
|
+
| `format` | `'json' \| 'env' \| 'auto'` | `'auto'` | Configuration file format |
|
|
147
|
+
|
|
104
148
|
### SecretsManagerLoader
|
|
105
149
|
|
|
106
150
|
Loads configuration from AWS Secrets Manager.
|
|
107
151
|
|
|
108
152
|
```typescript
|
|
109
|
-
|
|
110
|
-
|
|
153
|
+
import { SecretsManagerLoader } from '@dyanet/config-aws';
|
|
154
|
+
|
|
155
|
+
const loader = new SecretsManagerLoader({
|
|
156
|
+
secretName: '/my-app/database',
|
|
111
157
|
region: 'us-east-1',
|
|
112
158
|
environmentMapping: {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
159
|
+
development: 'dev/',
|
|
160
|
+
production: 'prod/',
|
|
161
|
+
},
|
|
117
162
|
});
|
|
118
163
|
```
|
|
119
164
|
|
|
165
|
+
| Option | Type | Default | Description |
|
|
166
|
+
|--------|------|---------|-------------|
|
|
167
|
+
| `secretName` | `string` | `undefined` | Name or ARN of the secret |
|
|
168
|
+
| `region` | `string` | `undefined` | AWS region |
|
|
169
|
+
| `environmentMapping` | `Record<string, string>` | `undefined` | Map environment names to path prefixes |
|
|
170
|
+
|
|
120
171
|
### SSMParameterStoreLoader
|
|
121
172
|
|
|
122
|
-
Loads configuration from AWS SSM Parameter Store.
|
|
173
|
+
Loads configuration from AWS SSM Parameter Store with pagination support.
|
|
123
174
|
|
|
124
175
|
```typescript
|
|
125
|
-
|
|
126
|
-
|
|
176
|
+
import { SSMParameterStoreLoader } from '@dyanet/config-aws';
|
|
177
|
+
|
|
178
|
+
const loader = new SSMParameterStoreLoader({
|
|
179
|
+
parameterPath: '/my-app/config',
|
|
127
180
|
region: 'us-east-1',
|
|
128
|
-
withDecryption: true
|
|
181
|
+
withDecryption: true,
|
|
182
|
+
environmentMapping: {
|
|
183
|
+
development: '/dev',
|
|
184
|
+
production: '/prod',
|
|
185
|
+
},
|
|
129
186
|
});
|
|
130
187
|
```
|
|
131
188
|
|
|
132
|
-
|
|
189
|
+
| Option | Type | Default | Description |
|
|
190
|
+
|--------|------|---------|-------------|
|
|
191
|
+
| `parameterPath` | `string` | `undefined` | Path prefix for parameters |
|
|
192
|
+
| `region` | `string` | `undefined` | AWS region |
|
|
193
|
+
| `withDecryption` | `boolean` | `true` | Decrypt SecureString parameters |
|
|
194
|
+
| `environmentMapping` | `Record<string, string>` | `undefined` | Map environment names to path prefixes |
|
|
133
195
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
196
|
+
## ConfigManager
|
|
197
|
+
|
|
198
|
+
The `ConfigManager` orchestrates loading from multiple sources with configurable precedence.
|
|
199
|
+
|
|
200
|
+
### Options
|
|
137
201
|
|
|
138
202
|
```typescript
|
|
139
|
-
|
|
140
|
-
|
|
203
|
+
interface ConfigManagerOptions<T> {
|
|
204
|
+
loaders?: ConfigLoader[];
|
|
205
|
+
schema?: ZodType<T>;
|
|
206
|
+
precedence?: 'aws-first' | 'local-first' | LoaderPrecedence[];
|
|
207
|
+
validateOnLoad?: boolean;
|
|
208
|
+
enableLogging?: boolean;
|
|
209
|
+
logger?: Logger;
|
|
210
|
+
verbose?: VerboseOptions | boolean;
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
| Option | Type | Default | Description |
|
|
215
|
+
|--------|------|---------|-------------|
|
|
216
|
+
| `loaders` | `ConfigLoader[]` | `[]` | Array of configuration loaders |
|
|
217
|
+
| `schema` | `ZodType<T>` | `undefined` | Zod schema for validation |
|
|
218
|
+
| `precedence` | `string \| LoaderPrecedence[]` | `'aws-first'` | Precedence strategy |
|
|
219
|
+
| `validateOnLoad` | `boolean` | `true` | Validate configuration after loading |
|
|
220
|
+
| `enableLogging` | `boolean` | `false` | Enable basic logging |
|
|
221
|
+
| `logger` | `Logger` | `console` | Custom logger implementation |
|
|
222
|
+
| `verbose` | `VerboseOptions \| boolean` | `false` | Enable verbose debugging output |
|
|
223
|
+
|
|
224
|
+
### Precedence Strategies
|
|
225
|
+
|
|
226
|
+
**`aws-first`** (default): Local sources load first, AWS sources override
|
|
227
|
+
```
|
|
228
|
+
EnvironmentLoader → EnvFileLoader → S3Loader → SecretsManagerLoader → SSMParameterStoreLoader
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**`local-first`**: AWS sources load first, local sources override
|
|
232
|
+
```
|
|
233
|
+
SSMParameterStoreLoader → SecretsManagerLoader → S3Loader → EnvFileLoader → EnvironmentLoader
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
**Custom precedence**: Define your own order
|
|
237
|
+
```typescript
|
|
238
|
+
const config = new ConfigManager({
|
|
141
239
|
loaders: [envLoader, secretsLoader, ssmLoader],
|
|
142
240
|
precedence: [
|
|
143
241
|
{ loader: 'EnvironmentLoader', priority: 1 },
|
|
144
|
-
{ loader: '
|
|
145
|
-
{ loader: '
|
|
146
|
-
]
|
|
242
|
+
{ loader: 'SSMParameterStoreLoader', priority: 2 },
|
|
243
|
+
{ loader: 'SecretsManagerLoader', priority: 3 }, // Highest priority wins
|
|
244
|
+
],
|
|
147
245
|
});
|
|
148
246
|
```
|
|
149
247
|
|
|
248
|
+
### Methods
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
// Load configuration from all sources
|
|
252
|
+
await config.load();
|
|
253
|
+
|
|
254
|
+
// Get a specific value
|
|
255
|
+
const value = config.get('DATABASE_URL');
|
|
256
|
+
|
|
257
|
+
// Get all configuration
|
|
258
|
+
const all = config.getAll();
|
|
259
|
+
|
|
260
|
+
// Check if loaded
|
|
261
|
+
const loaded = config.isLoaded();
|
|
262
|
+
|
|
263
|
+
// Get current environment
|
|
264
|
+
const env = config.getAppEnv(); // reads APP_ENV or defaults to 'development'
|
|
265
|
+
|
|
266
|
+
// Get load result with source info
|
|
267
|
+
const result = config.getLoadResult();
|
|
268
|
+
|
|
269
|
+
// Serialize to JSON
|
|
270
|
+
const json = config.serialize();
|
|
271
|
+
|
|
272
|
+
// Deserialize from JSON
|
|
273
|
+
const restored = ConfigManager.deserialize(json, { schema });
|
|
274
|
+
```
|
|
275
|
+
|
|
150
276
|
## Verbose Logging
|
|
151
277
|
|
|
152
278
|
Enable detailed logging to debug configuration loading:
|
|
153
279
|
|
|
154
280
|
```typescript
|
|
155
|
-
const
|
|
281
|
+
const config = new ConfigManager({
|
|
282
|
+
loaders: [...],
|
|
283
|
+
verbose: true, // Enable all verbose options
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
// Or customize verbose options
|
|
287
|
+
const config = new ConfigManager({
|
|
156
288
|
loaders: [...],
|
|
157
289
|
verbose: {
|
|
158
|
-
logKeys: true,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
290
|
+
logKeys: true, // Log variable names
|
|
291
|
+
logValues: false, // Log values (WARNING: may expose secrets)
|
|
292
|
+
logOverrides: true, // Log when variables are overridden
|
|
293
|
+
logTiming: true, // Log loader timing
|
|
294
|
+
maskValues: true, // Mask sensitive values
|
|
295
|
+
sensitiveKeys: ['password', 'secret', 'key', 'token'],
|
|
296
|
+
},
|
|
163
297
|
});
|
|
164
298
|
```
|
|
165
299
|
|
|
166
|
-
|
|
300
|
+
**Example output:**
|
|
301
|
+
```
|
|
302
|
+
[config-aws] Loading configuration...
|
|
303
|
+
[config-aws] EnvironmentLoader: loaded 15 keys in 2ms
|
|
304
|
+
[config-aws] - DATABASE_URL
|
|
305
|
+
[config-aws] - API_KEY
|
|
306
|
+
[config-aws] - PORT
|
|
307
|
+
[config-aws] SecretsManagerLoader: loaded 3 keys in 145ms
|
|
308
|
+
[config-aws] - DATABASE_URL (overrides EnvironmentLoader)
|
|
309
|
+
[config-aws] - API_SECRET
|
|
310
|
+
[config-aws] - JWT_KEY
|
|
311
|
+
[config-aws] Configuration loaded: 18 total keys, 2 overrides, 236ms total
|
|
312
|
+
```
|
|
167
313
|
|
|
168
|
-
|
|
314
|
+
## Error Handling
|
|
169
315
|
|
|
170
|
-
|
|
171
|
-
- `ValidationError` - Zod schema validation failed
|
|
172
|
-
- `AWSServiceError` - AWS API call failed
|
|
173
|
-
- `ConfigurationLoadError` - Loader failed to load
|
|
174
|
-
- `MissingConfigurationError` - Required keys missing
|
|
316
|
+
The library provides specific error classes for different failure scenarios:
|
|
175
317
|
|
|
176
318
|
```typescript
|
|
319
|
+
import {
|
|
320
|
+
ConfigurationError, // Base error class
|
|
321
|
+
ValidationError, // Schema validation failed
|
|
322
|
+
AWSServiceError, // AWS API call failed
|
|
323
|
+
ConfigurationLoadError, // Loader failed to load
|
|
324
|
+
MissingConfigurationError, // Required keys missing
|
|
325
|
+
} from '@dyanet/config-aws';
|
|
326
|
+
|
|
177
327
|
try {
|
|
178
|
-
await
|
|
328
|
+
await config.load();
|
|
179
329
|
} catch (error) {
|
|
180
330
|
if (error instanceof ValidationError) {
|
|
181
|
-
console.error('
|
|
331
|
+
console.error('Validation failed:', error.validationErrors);
|
|
182
332
|
} else if (error instanceof AWSServiceError) {
|
|
183
|
-
console.error(`AWS ${error.service} failed:`, error.
|
|
333
|
+
console.error(`AWS ${error.service} failed:`, error.operation);
|
|
334
|
+
} else if (error instanceof ConfigurationLoadError) {
|
|
335
|
+
console.error(`Loader ${error.loader} failed:`, error.message);
|
|
184
336
|
}
|
|
185
337
|
}
|
|
186
338
|
```
|
|
187
339
|
|
|
188
|
-
##
|
|
340
|
+
## Schema Validation
|
|
341
|
+
|
|
342
|
+
Use Zod schemas to validate and transform configuration:
|
|
343
|
+
|
|
344
|
+
```typescript
|
|
345
|
+
import { z } from 'zod';
|
|
346
|
+
|
|
347
|
+
const schema = z.object({
|
|
348
|
+
// Required string
|
|
349
|
+
DATABASE_URL: z.string().url(),
|
|
350
|
+
|
|
351
|
+
// Number with coercion and default
|
|
352
|
+
PORT: z.coerce.number().default(3000),
|
|
353
|
+
|
|
354
|
+
// Boolean with coercion
|
|
355
|
+
DEBUG: z.coerce.boolean().default(false),
|
|
356
|
+
|
|
357
|
+
// Enum
|
|
358
|
+
NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
|
|
359
|
+
|
|
360
|
+
// Optional with default
|
|
361
|
+
LOG_LEVEL: z.string().default('info'),
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
type Config = z.infer<typeof schema>;
|
|
365
|
+
|
|
366
|
+
const config = new ConfigManager<Config>({
|
|
367
|
+
loaders: [...],
|
|
368
|
+
schema,
|
|
369
|
+
validateOnLoad: true,
|
|
370
|
+
});
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## Custom Loaders
|
|
374
|
+
|
|
375
|
+
Implement the `ConfigLoader` interface to create custom loaders:
|
|
376
|
+
|
|
377
|
+
```typescript
|
|
378
|
+
import { ConfigLoader } from '@dyanet/config-aws';
|
|
379
|
+
|
|
380
|
+
class CustomLoader implements ConfigLoader {
|
|
381
|
+
getName(): string {
|
|
382
|
+
return 'CustomLoader';
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
async isAvailable(): Promise<boolean> {
|
|
386
|
+
// Return true if this loader can load configuration
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
async load(): Promise<Record<string, unknown>> {
|
|
391
|
+
// Load and return configuration
|
|
392
|
+
return {
|
|
393
|
+
CUSTOM_KEY: 'custom_value',
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
## Utilities
|
|
400
|
+
|
|
401
|
+
### EnvFileParser
|
|
402
|
+
|
|
403
|
+
Parse `.env` file content directly:
|
|
404
|
+
|
|
405
|
+
```typescript
|
|
406
|
+
import { EnvFileParser } from '@dyanet/config-aws';
|
|
407
|
+
|
|
408
|
+
const content = `
|
|
409
|
+
# Database config
|
|
410
|
+
DATABASE_URL=postgres://localhost:5432/db
|
|
411
|
+
API_KEY=sk-1234567890
|
|
412
|
+
`;
|
|
413
|
+
|
|
414
|
+
const parsed = EnvFileParser.parse(content);
|
|
415
|
+
// { DATABASE_URL: 'postgres://localhost:5432/db', API_KEY: 'sk-1234567890' }
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### ConfigValidationUtil
|
|
419
|
+
|
|
420
|
+
Validate configuration objects:
|
|
421
|
+
|
|
422
|
+
```typescript
|
|
423
|
+
import { ConfigValidationUtil } from '@dyanet/config-aws';
|
|
424
|
+
import { z } from 'zod';
|
|
425
|
+
|
|
426
|
+
const schema = z.object({
|
|
427
|
+
PORT: z.coerce.number(),
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
const result = ConfigValidationUtil.validate({ PORT: '3000' }, schema);
|
|
431
|
+
// { PORT: 3000 }
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
## TypeScript Support
|
|
435
|
+
|
|
436
|
+
Full TypeScript support with type inference from Zod schemas:
|
|
437
|
+
|
|
438
|
+
```typescript
|
|
439
|
+
import { ConfigManager } from '@dyanet/config-aws';
|
|
440
|
+
import { z } from 'zod';
|
|
441
|
+
|
|
442
|
+
const schema = z.object({
|
|
443
|
+
DATABASE_URL: z.string(),
|
|
444
|
+
PORT: z.coerce.number(),
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
type Config = z.infer<typeof schema>;
|
|
448
|
+
|
|
449
|
+
const config = new ConfigManager<Config>({ schema, loaders: [...] });
|
|
450
|
+
await config.load();
|
|
451
|
+
|
|
452
|
+
// Fully typed
|
|
453
|
+
const port: number = config.get('PORT');
|
|
454
|
+
const all: Config = config.getAll();
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
## Related Packages
|
|
189
458
|
|
|
190
|
-
- **
|
|
191
|
-
- **
|
|
459
|
+
- **[@dyanet/nestjs-config-aws](../nestjs-config-aws)** - NestJS adapter for this library
|
|
460
|
+
- **[@dyanet/nextjs-config-aws](../nextjs-config-aws)** - Next.js adapter for this library
|
|
192
461
|
|
|
193
462
|
## License
|
|
194
463
|
|
|
@@ -48,11 +48,18 @@ class SecretsManagerLoader {
|
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Get the name of this loader for logging and debugging.
|
|
51
|
-
* @returns The loader name with secret path
|
|
51
|
+
* @returns The loader name with secret path or base secret name if path cannot be built
|
|
52
52
|
*/
|
|
53
53
|
getName() {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
// Avoid calling buildSecretName() to prevent stack overflow when
|
|
55
|
+
// environment mapping is missing - buildSecretName() throws an error
|
|
56
|
+
// that includes getName() in the message, causing infinite recursion.
|
|
57
|
+
const envPrefix = this._config.environmentMapping[this._appEnv];
|
|
58
|
+
if (envPrefix) {
|
|
59
|
+
return `SecretsManagerLoader(/${envPrefix}${this._config.secretName})`;
|
|
60
|
+
}
|
|
61
|
+
// Fallback to base secret name when environment mapping is unavailable
|
|
62
|
+
return `SecretsManagerLoader(${this._config.secretName})`;
|
|
56
63
|
}
|
|
57
64
|
/**
|
|
58
65
|
* Check if this loader is available in the current environment.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-manager.loader.js","sourceRoot":"","sources":["../../../src/loaders/secrets-manager.loader.ts"],"names":[],"mappings":";;;AAAA,4EAA8F;AAC9F,wEAAsE;AAItE,sCAAoE;AAEpE;;;;;;;;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* Get the name of this loader for logging and debugging.
|
|
48
|
-
* @returns The loader name with secret path
|
|
48
|
+
* @returns The loader name with secret path or base secret name if path cannot be built
|
|
49
49
|
*/
|
|
50
50
|
getName() {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
// Avoid calling buildSecretName() to prevent stack overflow when
|
|
52
|
+
// environment mapping is missing - buildSecretName() throws an error
|
|
53
|
+
// that includes getName() in the message, causing infinite recursion.
|
|
54
|
+
const envPrefix = this._config.environmentMapping[this._appEnv];
|
|
55
|
+
if (envPrefix) {
|
|
56
|
+
return `SecretsManagerLoader(/${envPrefix}${this._config.secretName})`;
|
|
57
|
+
}
|
|
58
|
+
// Fallback to base secret name when environment mapping is unavailable
|
|
59
|
+
return `SecretsManagerLoader(${this._config.secretName})`;
|
|
53
60
|
}
|
|
54
61
|
/**
|
|
55
62
|
* Check if this loader is available in the current environment.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-manager.loader.js","sourceRoot":"","sources":["../../../src/loaders/secrets-manager.loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAItE,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAO,oBAAoB;IAQ/B,YAAY,SAAqC,EAAE;QACjD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC;QAE5E,4BAA4B;QAC5B,IAAI,CAAC,OAAO,GAAG;YACb,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,oBAAoB;YACrD,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,C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K,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAC/H,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAC3C,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,eAAe;QACb,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEhE,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,sBAAsB,CAC9B,6CAA6C,IAAI,CAAC,OAAO,KAAK;gBAC5D,2BAA2B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EACtF,IAAI,CAAC,OAAO,EAAE,CACf,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;IACnD,CAAC;IAED;;;OAGG;IACH,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,qBAAqB;QACnB,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -34,7 +34,7 @@ export declare class SecretsManagerLoader implements ConfigLoader {
|
|
|
34
34
|
constructor(config?: SecretsManagerLoaderConfig);
|
|
35
35
|
/**
|
|
36
36
|
* Get the name of this loader for logging and debugging.
|
|
37
|
-
* @returns The loader name with secret path
|
|
37
|
+
* @returns The loader name with secret path or base secret name if path cannot be built
|
|
38
38
|
*/
|
|
39
39
|
getName(): string;
|
|
40
40
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-manager.loader.d.ts","sourceRoot":"","sources":["../../../src/loaders/secrets-manager.loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAG9F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAGjG;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,oBAAqB,YAAW,YAAY;IACvD,gBAAgB;IAChB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACjD,gBAAgB;IAChB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,0BAA0B,CAAC,CAAC;IACjE,gBAAgB;IAChB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEvB,MAAM,GAAE,0BAA+B;IAsBnD;;;OAGG;IACH,OAAO,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"secrets-manager.loader.d.ts","sourceRoot":"","sources":["../../../src/loaders/secrets-manager.loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAG9F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAGjG;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,oBAAqB,YAAW,YAAY;IACvD,gBAAgB;IAChB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACjD,gBAAgB;IAChB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,0BAA0B,CAAC,CAAC;IACjE,gBAAgB;IAChB,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEvB,MAAM,GAAE,0BAA+B;IAsBnD;;;OAGG;IACH,OAAO,IAAI,MAAM;IAYjB;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAerC;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAoE9C;;;OAGG;IACH,eAAe,IAAI,MAAM;IAczB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;OAGG;IACH,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAGhD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dyanet/config-aws",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Framework-agnostic AWS configuration management with support for environment variables, AWS Secrets Manager, SSM Parameter Store, S3, and .env files",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"author": "Dyanet",
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": ">=
|
|
49
|
-
"npm": ">=
|
|
48
|
+
"node": ">=20.0.0",
|
|
49
|
+
"npm": ">=10.0.0"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public",
|
|
@@ -75,23 +75,20 @@
|
|
|
75
75
|
"@aws-sdk/client-s3": "^3.0.0",
|
|
76
76
|
"@types/jest": "^29.5.0",
|
|
77
77
|
"@types/node": "^20.0.0",
|
|
78
|
-
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
79
|
-
"@typescript-eslint/parser": "^6.21.0",
|
|
80
78
|
"aws-sdk-client-mock": "^4.0.0",
|
|
81
|
-
"eslint": "^8.0.0",
|
|
82
79
|
"fast-check": "^3.15.0",
|
|
83
80
|
"jest": "^29.5.0",
|
|
84
|
-
"rimraf": "^
|
|
81
|
+
"rimraf": "^6.0.0",
|
|
85
82
|
"ts-jest": "^29.1.0",
|
|
86
83
|
"typescript": "^5.9.2",
|
|
87
84
|
"zod": "^3.22.0"
|
|
88
85
|
},
|
|
89
86
|
"repository": {
|
|
90
87
|
"type": "git",
|
|
91
|
-
"url": "https://github.com/dyanet/
|
|
88
|
+
"url": "https://github.com/dyanet/config-aws.git"
|
|
92
89
|
},
|
|
93
90
|
"bugs": {
|
|
94
|
-
"url": "https://github.com/dyanet/
|
|
91
|
+
"url": "https://github.com/dyanet/config-aws/issues"
|
|
95
92
|
},
|
|
96
|
-
"homepage": "https://github.com/dyanet/
|
|
93
|
+
"homepage": "https://github.com/dyanet/config-aws/tree/main/packages/config-aws"
|
|
97
94
|
}
|