PURISTA API / Modules / @purista/aws-config-store / AWSConfigStore
Class: AWSConfigStore
@purista/aws-config-store.AWSConfigStore
The config store adapter for AWS System Manager. It will store, retrive, update or remove configs in AWS System Manager.
For performance reasons, and to reduce costs, the config 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 config values via config cacheTtl (in ms).
This will return the cached config if available and if ttl is not exceeded. If a config value exceeds the ttl, it does not automatically get removed from cache. It will be removed/overwritten on next get request.
Hierarchy
ConfigStoreBaseClass
<AWSConfigStoreConfig
>↳
AWSConfigStore
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new AWSConfigStore(config
): AWSConfigStore
Parameters
Name | Type | Description |
---|---|---|
config | Object | - |
config.cacheTtl? | number | Cache time to live in ms |
config.client | SSMClientConfig | 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
ConfigStoreBaseClass.constructor
Defined in
aws-config-store/src/AWSConfigStore.impl.ts:30
Properties
cache
• cache: ConfigStoreCacheMap
Inherited from
Defined in
core/dist/commonjs/core/ConfigStore/ConfigStoreBaseClass.impl.d.ts:20
client
• client: SSMClient
Defined in
aws-config-store/src/AWSConfigStore.impl.ts:28
config
• config: Object
Type declaration
Name | Type | Description |
---|---|---|
cacheTtl? | number | Cache time to live in ms |
client | SSMClientConfig | 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/ConfigStore/ConfigStoreBaseClass.impl.d.ts:18
logger
• logger: Logger
Inherited from
Defined in
core/dist/commonjs/core/ConfigStore/ConfigStoreBaseClass.impl.d.ts:17
name
• name: string
Inherited from
Defined in
core/dist/commonjs/core/ConfigStore/ConfigStoreBaseClass.impl.d.ts:19
Methods
destroy
▸ destroy(): Promise
<void
>
Returns
Promise
<void
>
Inherited from
Defined in
core/dist/commonjs/core/ConfigStore/ConfigStoreBaseClass.impl.d.ts:70
getConfig
▸ getConfig<ConfigNames
>(...configNames
): Promise
<ObjectWithKeysFromStringArray
<ConfigNames
>>
Returns the values for given config properties. This function SHOULD NOT be overwritten by store implementation. For implementation overwrite protected getConfigImpl
Type parameters
Name | Type |
---|---|
ConfigNames | extends string [] |
Parameters
Name | Type |
---|---|
...configNames | ConfigNames |
Returns
Promise
<ObjectWithKeysFromStringArray
<ConfigNames
>>
an object of
Inherited from
ConfigStoreBaseClass.getConfig
Defined in
core/dist/commonjs/core/ConfigStore/ConfigStoreBaseClass.impl.d.ts:37
getConfigImpl
▸ getConfigImpl<ConfigNames
>(...configNames
): Promise
<ObjectWithKeysFromStringArray
<ConfigNames
>>
This method must be overwritten by actual store implementation.
Type parameters
Name | Type |
---|---|
ConfigNames | extends string [] |
Parameters
Name | Type | Description |
---|---|---|
...configNames | ConfigNames | list of config items |
Returns
Promise
<ObjectWithKeysFromStringArray
<ConfigNames
>>
an object of
Overrides
ConfigStoreBaseClass.getConfigImpl
Defined in
aws-config-store/src/AWSConfigStore.impl.ts:35
removeConfig
▸ removeConfig(configName
): Promise
<void
>
Removes the config item given by config name. This function SHOULD NOT be overwritten by store implementation. For implementation overwrite protected removeConfigImpl
Parameters
Name | Type |
---|---|
configName | string |
Returns
Promise
<void
>
Inherited from
ConfigStoreBaseClass.removeConfig
Defined in
core/dist/commonjs/core/ConfigStore/ConfigStoreBaseClass.impl.d.ts:52
removeConfigImpl
▸ removeConfigImpl(configName
): Promise
<void
>
This method must be overwritten by actual store implementation.
Parameters
Name | Type |
---|---|
configName | string |
Returns
Promise
<void
>
Overrides
ConfigStoreBaseClass.removeConfigImpl
Defined in
aws-config-store/src/AWSConfigStore.impl.ts:58
setConfig
▸ setConfig(configName
, configValue
): Promise
<void
>
Sets a config value This function SHOULD NOT be overwritten by store implementation. For implementation overwrite protected setConfigImpl
Parameters
Name | Type |
---|---|
configName | string |
configValue | unknown |
Returns
Promise
<void
>
Inherited from
ConfigStoreBaseClass.setConfig
Defined in
core/dist/commonjs/core/ConfigStore/ConfigStoreBaseClass.impl.d.ts:69
setConfigImpl
▸ setConfigImpl(configName
, configValue
): Promise
<void
>
This method must be overwritten by actual store implementation.
Parameters
Name | Type |
---|---|
configName | string |
configValue | string |
Returns
Promise
<void
>
Overrides
ConfigStoreBaseClass.setConfigImpl