## What is AWS SSM? AWS Systems Manager (SSM) is a service provided by Amazon Web Services (AWS) that enables users to manage and automate operational tasks across their AWS infrastructure. One of its key components is AWS Systems Manager Parameter Store,
npm install @openfeature/aws-ssm-provider```
$ npm install @openfeature/aws-ssm-provider
``
OpenFeature.setProvider(
new AwsSsmProvider({
ssmClientConfig: {
region: 'eu-west-1', // Change this to your desired AWS region
// You can setup your aws credentials here or it will be automatically retrieved from env vars
// See https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html
},
// Use an LRUCache for improve performance and optimize AWS SDK Calls to SSM (cost awareness)
cacheOpts: {
enabled: true, // Enable caching
size: 1, // Cache size
ttl: 10, // Time-to-live in seconds
},
})
);
| Property | Type | Description | Default |
|-----------------|--------------------|----------------------------------------------|---------|
| ssmClientConfig | SSMClientConfig | AWS SSM Client configuration options. | See here |enableDecryption
| | boolean | Enable decryption for SecureString parameters | false |cacheOpts
| | LRUCacheConfig | Configuration for the local LRU cache. | See below |
| Property | Type | Description | Default |
|-----------|--------|------------------------------------------------|---------|
| enabled | boolean | Whether caching is enabled. | false |ttl
| | number | Time-to-live (TTL) for cached items (in ms). | 300000 (5 minutes) |size
| | number | Maximum number of items in the cache. | 1000 |
Open your AWS Management Console and go to AWS System Manager service
Go to Parameter Store
Create a new SSM Param called 'my-feature-flag' in your AWS Account and then retrieve it via OpenFeature Client!
`Feature flag value: ${flagValue}
const featureFlags = OpenFeature.getClient();
const flagValue = await featureFlags.getBooleanValue('my-feature-flag', false);
console.log();``