confconf AWS Secrets Manager configuration provider
Features
Install
npm i --save @confconf/aws-secrets-manager
Usage
import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
import { confconf } from "@confconf/confconf";
import { awsSecretsManager } from "@confconf/aws-secrets-manager";
const client = new SecretsManagerClient();
const configSchema = {
};
type Config = {
};
const configLoader = confconf<Config>({
schema: configSchema,
providers: [
awsSecretsManager({
client,
secretToLoad: "name/of/the/secret",
}),
],
});
const config = await configLoader.loadAndValidate();
API reference
awsSecretsManager(opts: AwsSecretsManagerProviderOpts)
Creates a new instance of the AWS secrets Manager configuration provider
opts
[AwsSecretsManagerProviderOpts]
interface AwsSecretsManagerProviderOpts {
client: SecretsManagerClient;
secretToLoad:
| string
| {
secretId: string;
versionId?: string;
versionStage?: string;
transform?: TransformFn;
};
}