Skip to content

Commit 02c1886

Browse files
committed
docs: explain provider usage in README
Signed-off-by: Giovanni De Giorgio <[email protected]>
1 parent b760f97 commit 02c1886

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

libs/providers/aws-ssm/README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,41 @@
1-
# aws-ssm Provider
1+
# AWS SSM Provider
2+
3+
## What is AWS SSM?
4+
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, which allows users to store, retrieve, and manage configuration data and secrets securely.
5+
SSM Parameter Store can be used to manage application configuration settings, database connection strings, API keys, and other sensitive information. It provides integration with AWS Identity and Access Management (IAM) to control access and encryption through AWS Key Management Service (KMS).
6+
The aws-ssm provider for OpenFeature allows applications to fetch feature flag configurations from AWS SSM Parameter Store, enabling centralized and dynamic configuration management.
27

38
## Installation
49

510
```
611
$ npm install @openfeature/aws-ssm-provider
712
```
813

9-
## Building
14+
## Set AWS Provider
1015

11-
Run `nx package providers-aws-ssm` to build the library.
16+
```
17+
OpenFeature.setProvider(
18+
new AwsSsmProvider({
19+
ssmClientConfig: {
20+
region: 'eu-west-1', // Change this to your desired AWS region
21+
// You can setup your aws credentials here or it will be automatically retrieved from env vars
22+
// See https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html
23+
},
24+
// Use an LRUCache for improve performance and optimize AWS SDK Calls to SSM (cost awareness)
25+
cacheOpts: {
26+
enabled: true, // Enable caching
27+
size: 1, // Cache size
28+
ttl: 10, // Time-to-live in seconds
29+
},
30+
})
31+
);
32+
```
33+
## Retrieve Feature Flag!
1234

13-
## Running unit tests
35+
Create a new SSM Param called 'my-feature-flag' in your AWS Account and then retrieve it via OpenFeature Client!
1436

15-
Run `nx test providers-aws-ssm` to execute the unit tests via [Jest](https://jestjs.io).
37+
```
38+
const featureFlags = OpenFeature.getClient();
39+
const flagValue = await featureFlags.getBooleanValue('my-feature-flag', false);
40+
console.log(`Feature flag value: ${flagValue}`);
41+
```

0 commit comments

Comments
 (0)