@vetsmm/nestjs-aws-secrets-manager
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Nest Logo

A thin wrapper around the [aws-sdk](https://github.com/aws/aws-sdk-js) library to use the AWS Secrets Manager in NestJs applications.

NPM Version Package License NPM Downloads Support us

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

Package Sidebar

Install

npm i @vetsmm/nestjs-aws-secrets-manager

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

9.14 kB

Total Files

12

Last publish

Collaborators

  • mgtripoli