Skip to content

Commit 819a247

Browse files
feat(aws-ssm): implement AWS SSM provider (#1221)
Signed-off-by: Giovanni De Giorgio <[email protected]> Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Todd Baert <[email protected]>
1 parent 80ec86b commit 819a247

26 files changed

+17964
-9423
lines changed

.github/component_owners.yml

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ components:
33
libs/hooks/open-telemetry:
44
- beeme1mr
55
- toddbaert
6+
libs/providers/aws-ssm:
7+
- gdegiorgio
68
libs/providers/config-cat:
79
- lukas-reining
810
- adams85

.release-please-manifest.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@
2020
"libs/providers/config-cat-web": "0.1.5",
2121
"libs/shared/config-cat-core": "0.1.1",
2222
"libs/providers/unleash-web": "0.1.1",
23-
"libs/providers/growthbook": "0.1.2"
23+
"libs/providers/growthbook": "0.1.2",
24+
"libs/providers/aws-ssm": "0.1.0"
2425
}

libs/providers/aws-ssm/.eslintrc.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"extends": ["../../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["*.json"],
19+
"parser": "jsonc-eslint-parser",
20+
"rules": {
21+
"@nx/dependency-checks": [
22+
"error",
23+
{
24+
"ignoredFiles": ["{projectRoot}/eslint.config.{js,cjs,mjs}"]
25+
}
26+
]
27+
}
28+
}
29+
]
30+
}

libs/providers/aws-ssm/README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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.
7+
8+
## Installation
9+
10+
```
11+
$ npm install @openfeature/aws-ssm-provider
12+
```
13+
14+
## Set AWS Provider
15+
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!
34+
35+
Create a new SSM Param called 'my-feature-flag' in your AWS Account and then retrieve it via OpenFeature Client!
36+
37+
```
38+
const featureFlags = OpenFeature.getClient();
39+
const flagValue = await featureFlags.getBooleanValue('my-feature-flag', false);
40+
console.log(`Feature flag value: ${flagValue}`);
41+
```
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": [["minify", { "builtIns": false }]]
3+
}

libs/providers/aws-ssm/jest.config.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: 'aws-ssm',
4+
preset: '../../../jest.preset.js',
5+
globals: {
6+
'ts-jest': {
7+
tsconfig: '<rootDir>/tsconfig.spec.json',
8+
},
9+
},
10+
transform: {
11+
'^.+\\.[tj]s$': 'ts-jest',
12+
},
13+
moduleFileExtensions: ['ts', 'js', 'html'],
14+
coverageDirectory: '../../../coverage/libs/providers/aws-ssm',
15+
testEnvironment: 'node',
16+
};

0 commit comments

Comments
 (0)