Skip to content

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

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new AWSConfigStore(config): AWSConfigStore

Parameters

NameTypeDescription
configObject-
config.cacheTtl?numberCache time to live in ms
config.clientSSMClientConfigAWS client options
config.enableCache?booleanEnable cache
config.enableGet?booleanEnable generally get method
config.enableRemove?booleanEnable generally remove method
config.enableSet?booleanEnable generally set method
config.logLevel?LogLevelNameA log level for new logger if logger is not set
config.logger?LoggerA logger instance

Returns

AWSConfigStore

Overrides

ConfigStoreBaseClass.constructor

Defined in

aws-config-store/src/AWSConfigStore.impl.ts:30

Properties

cache

cache: ConfigStoreCacheMap

Inherited from

ConfigStoreBaseClass.cache

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

NameTypeDescription
cacheTtl?numberCache time to live in ms
clientSSMClientConfigAWS client options
enableCache?booleanEnable cache
enableGet?booleanEnable generally get method
enableRemove?booleanEnable generally remove method
enableSet?booleanEnable generally set method
logLevel?LogLevelNameA log level for new logger if logger is not set
logger?LoggerA logger instance

Inherited from

ConfigStoreBaseClass.config

Defined in

core/dist/commonjs/core/ConfigStore/ConfigStoreBaseClass.impl.d.ts:18


logger

logger: Logger

Inherited from

ConfigStoreBaseClass.logger

Defined in

core/dist/commonjs/core/ConfigStore/ConfigStoreBaseClass.impl.d.ts:17


name

name: string

Inherited from

ConfigStoreBaseClass.name

Defined in

core/dist/commonjs/core/ConfigStore/ConfigStoreBaseClass.impl.d.ts:19

Methods

destroy

destroy(): Promise<void>

Returns

Promise<void>

Inherited from

ConfigStoreBaseClass.destroy

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

NameType
ConfigNamesextends string[]

Parameters

NameType
...configNamesConfigNames

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

NameType
ConfigNamesextends string[]

Parameters

NameTypeDescription
...configNamesConfigNameslist 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

NameType
configNamestring

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

NameType
configNamestring

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

NameType
configNamestring
configValueunknown

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

NameType
configNamestring
configValuestring

Returns

Promise<void>

Overrides

ConfigStoreBaseClass.setConfigImpl

Defined in

aws-config-store/src/AWSConfigStore.impl.ts:66