env-fetcher-service
v0.0.8
Published
The following package fetches aws stored parametes
Downloads
460
Readme
Env-fetcher-service
This package is used to fetch configuration from AWS Stored Parameters and AWS Secret Manager
Installation
Install env-fetcher-service with npm
npm i env-fetcher-service
License
Authors
Usage/Examples
import { App } from 'env-fetcher-service';
export class MainService {
fetchConfig() {
const app = new App();
const options = {
credentials: {
region: '<region>',
credentials: {
accessKeyId: '<access-key-id>',
secretAccessKey: '<secret-access-key-id>',
},
},
metadata: {
secretId: '<secret-ID>', // required for AWS Secret Manager,
path: '<ssm-path>', //required for AWS Stored parameter
},
enrichmentOptions: {
enrichResponse: true,
trimPathVariableName: true,
},
};
const extractorType = 'AWS_SSM' || 'AWS_SECRET_MANAGER';
const response = app.extractEnv(extractorType, options);
return response;
}
}