PURISTA API / Modules / @purista/aws-secret-store / AWSSecretStore
Class: AWSSecretStore
@purista/aws-secret-store.AWSSecretStore
The secret store adapter for AWS Secrets Manager. It will store, retrive, update or remove secrets in AWS Secrets Manager.
For performance reasons, and to reduce costs, the secret values are cached in memory after first fetch.
You can disable the whole caching via config by setting enableCache to false. If the cache is enabled, you can set the ttl for cached secret values via config cacheTtl (in ms).
This will return the cached secret if available and if ttl is not exceeded. If a secret value exceeds the ttl, it does not automatically get removed from cache. It will be removed/overwritten on next get request.
Hierarchy
SecretStoreBaseClass
<AWSSecretStoreConfig
>↳
AWSSecretStore
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new AWSSecretStore(config
): AWSSecretStore
Parameters
Name | Type | Description |
---|---|---|
config | Object | - |
config.cacheTtl? | number | Cache time to live in ms |
config.client | SecretsManagerClientConfigType | AWS client options |
config.enableCache? | boolean | Enable cache |
config.enableGet? | boolean | Enable generally get method |
config.enableRemove? | boolean | Enable generally remove method |
config.enableSet? | boolean | Enable generally set method |
config.logLevel? | LogLevelName | A log level for new logger if logger is not set |
config.logger? | Logger | A logger instance |
Returns
Overrides
SecretStoreBaseClass.constructor
Defined in
aws-secret-store/src/AWSSecretStore.impl.ts:35
Properties
cache
• cache: SecretStoreCacheMap
Inherited from
Defined in
core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:20
client
• client: SecretsManagerClient
Defined in
aws-secret-store/src/AWSSecretStore.impl.ts:33
config
• config: Object
Type declaration
Name | Type | Description |
---|---|---|
cacheTtl? | number | Cache time to live in ms |
client | SecretsManagerClientConfigType | AWS client options |
enableCache? | boolean | Enable cache |
enableGet? | boolean | Enable generally get method |
enableRemove? | boolean | Enable generally remove method |
enableSet? | boolean | Enable generally set method |
logLevel? | LogLevelName | A log level for new logger if logger is not set |
logger? | Logger | A logger instance |
Inherited from
Defined in
core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:18
logger
• logger: Logger
Inherited from
Defined in
core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:17
name
• name: string
Inherited from
Defined in
core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:19
Methods
destroy
▸ destroy(): Promise
<void
>
Returns
Promise
<void
>
Inherited from
Defined in
core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:28
getSecret
▸ getSecret<SecretNames
>(...secretNames
): Promise
<ObjectWithKeysFromStringArray
<SecretNames
, undefined
| string
>>
Type parameters
Name | Type |
---|---|
SecretNames | extends string [] |
Parameters
Name | Type |
---|---|
...secretNames | SecretNames |
Returns
Promise
<ObjectWithKeysFromStringArray
<SecretNames
, undefined
| string
>>
Inherited from
SecretStoreBaseClass.getSecret
Defined in
core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:23
getSecretImpl
▸ getSecretImpl<SecretNames
>(...secretNames
): Promise
<ObjectWithKeysFromStringArray
<SecretNames
, undefined
| string
>>
Type parameters
Name | Type |
---|---|
SecretNames | extends string [] |
Parameters
Name | Type |
---|---|
...secretNames | SecretNames |
Returns
Promise
<ObjectWithKeysFromStringArray
<SecretNames
, undefined
| string
>>
Overrides
SecretStoreBaseClass.getSecretImpl
Defined in
aws-secret-store/src/AWSSecretStore.impl.ts:40
removeSecret
▸ removeSecret(secretName
): Promise
<void
>
Parameters
Name | Type |
---|---|
secretName | string |
Returns
Promise
<void
>
Inherited from
SecretStoreBaseClass.removeSecret
Defined in
core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:25
removeSecretImpl
▸ removeSecretImpl(secretName
): Promise
<void
>
Parameters
Name | Type |
---|---|
secretName | string |
Returns
Promise
<void
>
Overrides
SecretStoreBaseClass.removeSecretImpl
Defined in
aws-secret-store/src/AWSSecretStore.impl.ts:64
setSecret
▸ setSecret(secretName
, secretValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
secretName | string |
secretValue | string |
Returns
Promise
<void
>
Inherited from
SecretStoreBaseClass.setSecret
Defined in
core/dist/commonjs/core/SecretStore/SecretStoreBaseClass.impl.d.ts:27
setSecretImpl
▸ setSecretImpl(secretName
, secretValue
): Promise
<void
>
Parameters
Name | Type |
---|---|
secretName | string |
secretValue | string |
Returns
Promise
<void
>
Overrides
SecretStoreBaseClass.setSecretImpl