1.0.2 • Published 1 year ago

@vetsmm/nestjs-aws-secrets-manager v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

1.0.2

1 year ago

1.0.1

2 years ago