@roit/roit-secret-manager
v2.7.2
Published
### Installation
Downloads
211
Maintainers
Keywords
Readme
ROIT Secret Manager
Installation
> npm i @roit/roit-secret-manager
Permission
We need to grant permissions to the service account to be able to access Secret Manager
Usage
In the env.yaml
file add the secretManager.projectId
attribute, with the name do project gcp:
dev:
secretManager:
projectId: project-gcp
import { getSecretVersion } from "@roit/roit-secret-manager";
const secret = await createAndAccessSecret('secret-id', 'data')
const secret = await addSecretVersion('secret-id', 'data')
const secret = await getSecretVersion('secret-id', '1')
const secret = await disableSecretVersion('secret-id', '1')
Functions
| Name | Description |
| ----------------------- | ---------------------------------------- |
| createAndAccessSecret
| create secret and version |
| getSecretVersion
| returns data of the informed version |
| disableSecretVersion
| disable version of the given secret |
| addSecretVersion
| add a new version to the existing secret |