https://github.com/kbrashears5/typescript-aws-sts-helper
Typescript AWS STS Helper
https://github.com/kbrashears5/typescript-aws-sts-helper
aws helper javascript lambda sts typescript
Last synced: 5 months ago
JSON representation
Typescript AWS STS Helper
- Host: GitHub
- URL: https://github.com/kbrashears5/typescript-aws-sts-helper
- Owner: kbrashears5
- License: mit
- Created: 2020-05-28T01:33:36.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-01T06:23:04.000Z (about 2 years ago)
- Last Synced: 2025-10-03T22:50:09.549Z (9 months ago)
- Topics: aws, helper, javascript, lambda, sts, typescript
- Language: TypeScript
- Homepage: https://github.com/kbrashears5/typescript-aws-sts-helper#readme
- Size: 69.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
typescript-aws-sts-helper
Typescript helper functions for AWS STS service
[](https://github.com/kbrashears5/typescript-aws-sts-helper/actions/workflows/ci-cd.yml)
[](https://codecov.io/gh/kbrashears5/typescript-aws-sts-helper)
[](https://img.shields.io/npm/v/typescript-aws-sts-helper)
[](https://img.shields.io/npm/dt/typescript-aws-sts-helper)
## Install
```
npm install typescript-aws-sts-helper@latest
```
## Usage
### Default - running in Lambda in your own account
```typescript
const logger = new Logger(LogLevel.Trace);
const helper = new STSHelper(logger);
const response = await helper.AssumeRoleAsync('roleArn');
```
### Running in separate account or not in Lambda
```typescript
import * as STS from '@aws-sdk/client-sts';
const logger = new Logger(LogLevel.Trace);
const options: STS.STSClientConfig = {
accessKeyId: '{access_key}',
secretAccessKey: '{secret_key}',
region: 'us-east-1',
};
const repository = new STS.STS(options);
const helper = new STSHelper(logger, repository);
const response = await helper.AssumeRoleAsync('roleArn');
```
## Notes
If no options are supplied, will default to `us-east-1` as the region
## Development
Clone the latest and run
```npm
npm run prep
```
to install packages and prep the git hooks