{"id":15792865,"url":"https://github.com/asomethings/nest-aws","last_synced_at":"2025-06-18T06:38:34.753Z","repository":{"id":39600596,"uuid":"279014015","full_name":"asomethings/nest-aws","owner":"asomethings","description":"AWS Module for Nestjs framework","archived":false,"fork":false,"pushed_at":"2023-01-24T03:27:57.000Z","size":1956,"stargazers_count":2,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T16:03:16.738Z","etag":null,"topics":["aws","nestjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asomethings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-12T07:25:54.000Z","updated_at":"2022-12-11T23:49:30.000Z","dependencies_parsed_at":"2023-02-13T15:30:44.637Z","dependency_job_id":null,"html_url":"https://github.com/asomethings/nest-aws","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asomethings%2Fnest-aws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asomethings%2Fnest-aws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asomethings%2Fnest-aws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asomethings%2Fnest-aws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asomethings","download_url":"https://codeload.github.com/asomethings/nest-aws/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253025296,"owners_count":21842404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","nestjs"],"created_at":"2024-10-04T23:06:04.599Z","updated_at":"2025-05-08T07:40:59.769Z","avatar_url":"https://github.com/asomethings.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\u003cimg src=\"https://nestjs.com/img/logo_text.svg\" width=\"320\" alt=\"Nest Logo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Description\n\n**Alpha Release: Use it with caution**\n\n\nAWS Module for Nest.js framework\n\n\n## Installation\n\nNPM\n\n```\nnpm i --save nest-aws\n```\n\nYarn\n\n```\nyarn add nest-aws\n```\n\n## Usage\n\nImport AwsModule into root AwsModule\n\n```typescript\n@Module({\n  imports: [\n    AwsModule.forRoot({\n      region: 'ap-northeast-2'\n      accessKeyId: 'your-aws-access-key',\n      secretAccessKeyId: 'your-aws-secret-key',\n    }),\n  ],\n  providers: [...],\n})\nexport class AppModule {}\n```\n\nDefine AWS Services that you wan't to use\n\n```typescript\nimport { S3, SES } from 'aws-sdk'\n\n@Module({\n  imports: [\n    AwsModule.forFeature(S3, SES),\n  ],\n  providers: [...],\n})\nexport class AppModule {}\n```\n\nNow, inject S3 and SES with InjectAwsService\n\n```typescript\n@Injectable()\nexport class UserService {\n  constructor(\n    @InjectAwsService(S3)\n    private readonly s3: S3,\n    @InjectAwsService(SES)\n    private readonly ses: SES,\n  ) {}\n}\n```\n\nAll AWS Services will be initiated with settings that you have provided in `forRoot`\n\n## Options\n\n```typescript\nAwsModule.forRoot({\n  // AWS Region (Optional)\n  region: '',\n\n\n  // AWS Access Key Id (Optional)\n  accessKeyId: '...',\n\n  // AWS Secret Access Key Id (Optional)\n  secretAccessKeyId: '...',\n}),\n```\n\n## Async Options\n\n1. Use factory\n\n```typescript\nAwsModule.forRootAsync({\n  useFactory: () =\u003e ({\n    region: 'ap-northeast-2',\n  }),\n})\n```\n\nOR\n\n```typescript\nAwsModule.forRootAsync({\n  imports: [ConfigModule],\n  useFactory: (configService: ConfigService) =\u003e ({\n    accessKeyId: configService.get('accessKeyId'),\n    secretAccessKeyId: configService.get('secretAccessKeyId'),\n  }),\n  inject: [ConfigService],\n})\n```\n\n2. Use Class\n\n```typescript\nAwsModule.forRootAsync({\n  useClass: AwsConfigService\n})\n```\n\n```typescript\nclass AwsConfigService implements AwsOptionsFactory {\n  createAwsOptions(): Promise\u003cAwsModuleOptions\u003e | AwsModuleOptions {\n    return {\n      region: 'ap-northeast-2',\n    }\n  }\n}\n```\n\n3. Use existing\n\n```typescript\nAwsModule.forRootAsync({\n  imports: [ConfigModule],\n  useExisting: ConfigService,\n})\n\n```\n\n## TODO\n\n- [ ] Write Tests\n- [ ] Support More Options\n- [ ] Seperate AwsModule with AwsCoreModule (Like @nestjs/typeorm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasomethings%2Fnest-aws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasomethings%2Fnest-aws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasomethings%2Fnest-aws/lists"}