@vetsmm/nestjs-aws-secrets-manager
v1.0.2
Published
NestJS module for AWS Secrets Manager
Downloads
3
Maintainers
Readme
Installation
npm install --save @vetsmm/nestjs-aws-secrets-manager
#or
yarn add @vetsmm/nestjs-aws-secrets-manager
Getting Started
Add and initialize the global module to your App.module.ts
Using .registerAsync()
for dynamic values (preferred)
import { AWSSecretsManagerModule } from '@vetsmm/nestjs-aws-secrets-manager';
import { AppService } from './app.service';
import { Module } from '@nestjs/common';
import { SecretsManager } from 'aws-sdk';
@Module({
imports: [AWSSecretsManagerModule.forRoot(new SecretsManager())],
providers: [AppService],
})
export class AppModule {}
import { SecretsService } from '@vetsmm/nestjs-aws-secrets-manager';
export class MySweetService {
constructor(private readonly secretsService: SecretsService) {}
private async getCredentials(): Credentials {
return await this.secretsService.getSecret<Credentials>('app-credentials');
}
}
Contributing
Please feel free to open a PR for any ideas you have. This was orginally created with a narrow focus for our own use, but we are happy to expand it to be more useful to the community.
Contributors
License
MIT