1.0.2 • Published 4 years ago

nest-aws-secrets-manager v1.0.2

Weekly downloads
15
License
MIT
Repository
github
Last release
4 years ago

Description

An effficient Nest.js AWS Secrets Manager

Installation

$ npm install nest-aws-secrets-manager

Adding the Global Module

Add the AwsSecretsManagerModule to your App Module imports. It will register globally.

import { AWSSecretsManagerModule } from 'nest-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 {}

Use the Secrets Manager

import { SecretsRetrieverService } from 'nest-aws-secrets-manager';

export class AppService {
  constructor(private readonly secretsRetrieverService: SecretsRetrieverService) {}

  private async getCredentials: Credentials {
    return await this.secretsRetrieverService.getSecret<Credentials>('app-credentials');
  }
}

Support

Pull requests are welcome. Please remember that commits must be made using Angular conventional-changelog

Stay in touch

License

Nest-AWS-Secrets_manager is MIT licensed.