https://github.com/cloudcomponents/lambda-utils-nodejs
Lambda utils for cloudcomponents cdk constructs
https://github.com/cloudcomponents/lambda-utils-nodejs
Last synced: 11 months ago
JSON representation
Lambda utils for cloudcomponents cdk constructs
- Host: GitHub
- URL: https://github.com/cloudcomponents/lambda-utils-nodejs
- Owner: cloudcomponents
- License: mit
- Created: 2021-03-15T10:19:57.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-11T19:46:43.000Z (almost 2 years ago)
- Last Synced: 2024-09-23T09:18:36.888Z (over 1 year ago)
- Language: TypeScript
- Size: 163 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/cloudcomponents/cdk-constructs)
# @cloudcomponents/lambda-utils
[](https://github.com/cloudcomponents/lambda-utils-nodejs/actions/workflows/ci.yaml)
> Lambda utils for cloudcomponents cdk constructs
## Install
```bash
npm i @cloudcomponents/lambda-utils
```
## How to use
### SecretKey
```typescript
import { SecretKey } from "@cloudcomponents/lambda-utils";
const secretKey = new SecretKey(process.env.SECRET_KEY_STRING as string);
export const handler = async (event, context) => {
const value = await secretKey.getValue();
return `Hello ${value}`
}
```
See [cdk-secret-key](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-secret-key) for the cdk counterpart
### SecretKeyStore
```typescript
import { SecretKeyStore } from "@cloudcomponents/lambda-utils";
const secretKeyStore = new SecretKeyStore(process.env.SECRET_KEY_STORE_STRING as string);
export const handler = async (event, context) => {
const value = "secret"
await secretKey.putValue(value);
return `Hello`
}
```
See [cdk-secret-key](https://github.com/cloudcomponents/cdk-constructs/tree/master/packages/cdk-secret-key) for the cdk counterpart
## License
[MIT](LICENSE)