Skip to content

vetsmm/nest-aws-secrets-manager

Repository files navigation

Secrets Manager Logo

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages