OpenFeature Python AWS Systems Manager Parameter Store Provider
Project description
OpenFeature AWS SSM Parameter Store Provider
This provider enables the use of AWS Systems Manager (SSM) Parameter Store as a backend for OpenFeature feature flags in Python.
Installation
pip install openfeature-provider-aws-ssm
For async support:
pip install openfeature-provider-aws-ssm[async]
Usage
Basic Usage
from openfeature import api
from openfeature.contrib.provider.awsssm import AwsSsmProvider
# Initialize the provider
provider = AwsSsmProvider()
# Set the provider
api.set_provider(provider)
# Get a client
client = api.get_client()
# Evaluate a flag
is_enabled = client.get_boolean_value("my-feature-flag", default_value=False)
With Configuration
from botocore.config import Config
from openfeature.contrib.provider.awsssm import (
AwsSsmProvider,
AwsSsmProviderConfig,
CacheConfig,
)
config = AwsSsmProviderConfig(
config=Config(
region_name="us-west-2",
retries={"max_attempts": 10, "mode": "standard"},
connect_timeout=5,
read_timeout=60,
),
enable_decryption=True, # For SecureString parameters
cache_config=CacheConfig(
cache_type="ttl",
size=1000,
ttl=300, # 5 minutes in seconds
),
)
provider = AwsSsmProvider(config=config)
api.set_provider(provider)
Async Usage
from openfeature import api
from openfeature.contrib.provider.awsssm import AwsSsmProvider
provider = AwsSsmProvider()
api.set_provider(provider)
client = api.get_client()
# Async flag evaluation
is_enabled = await client.get_boolean_value_async(
"my-feature-flag", default_value=False
)
Flag Key Mapping
Flag keys are mapped to SSM parameter names with the following rules:
- If the flag key starts with
/, it's used as-is - Otherwise, a leading
/is automatically prepended
Examples:
- Flag key
my-feature→ Parameter/my-feature - Flag key
/app/prod/feature→ Parameter/app/prod/feature
Flag Types
The provider supports all OpenFeature flag types:
| OpenFeature Type | SSM Parameter Value | Parsing Rules |
|---|---|---|
| Boolean | "true" or "false" |
Case-insensitive. Other values raise TypeMismatchError |
| String | Any string | Returned as-is |
| Integer | "42", "-10" |
Parsed with int(). Invalid values raise TypeMismatchError |
| Float | "3.14", "-2.5" |
Parsed with float(). Invalid values raise TypeMismatchError |
| Object | Valid JSON | Parsed as JSON object or array. Invalid JSON or primitives raise ParseError |
Configuration Options
AwsSsmProviderConfig
| Parameter | Type | Default | Description |
|---|---|---|---|
config |
botocore.config.Config |
None |
boto3 Config object (includes region_name, retries, timeouts, etc.) |
endpoint_url |
str |
None |
Custom SSM endpoint URL (for testing with LocalStack/moto) |
enable_decryption |
bool |
False |
Whether to decrypt SecureString parameters |
cache_config |
CacheConfig |
CacheConfig() |
Configuration for the local cache |
CacheConfig
The provider supports multiple caching strategies to optimize performance. To disable caching entirely, pass cache_config=None when creating the provider config.
| Parameter | Type | Default | Description |
|---|---|---|---|
cache_type |
Literal["lru", "ttl"] |
"lru" |
Type of cache: "lru" (size-based) or "ttl" (time-based) |
ttl |
int |
300 |
Time-to-live for cached items in seconds (only used with cache_type="ttl") |
size |
int |
1000 |
Maximum number of items in the cache |
Cache Types
"lru"(default): Least Recently Used cache with size-based eviction only. Cached values persist until evicted due to size limits."ttl": Time-To-Live cache with both time-based expiration AND size-based eviction. Cached values automatically expire after the configured TTL, even if space remains in the cache.
Cache Examples
# LRU cache (default) - size-based eviction only
cache_config=CacheConfig(cache_type="lru", size=500)
# TTL cache - expires after 60 seconds
cache_config=CacheConfig(cache_type="ttl", ttl=60, size=500)
# No caching - pass cache_config=None to the provider config
provider_config = AwsSsmProviderConfig(cache_config=None)
For more information on the Config object, see the boto3 configuration documentation.
License
Apache 2.0 - See LICENSE for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openfeature_provider_aws_ssm-0.1.1.tar.gz.
File metadata
- Download URL: openfeature_provider_aws_ssm-0.1.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15646a0f1cebb922aee30c7596dcdccad927ccc196c6f9aebe52e492a42491db
|
|
| MD5 |
a2715dd3acddc28dd25083031a6aa7f3
|
|
| BLAKE2b-256 |
800a88f3928b1587ad0b83998c80089bced9db2edac32fc644ce89f43e444834
|
Provenance
The following attestation bundles were made for openfeature_provider_aws_ssm-0.1.1.tar.gz:
Publisher:
release.yml on open-feature/python-sdk-contrib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openfeature_provider_aws_ssm-0.1.1.tar.gz -
Subject digest:
15646a0f1cebb922aee30c7596dcdccad927ccc196c6f9aebe52e492a42491db - Sigstore transparency entry: 957466732
- Sigstore integration time:
-
Permalink:
open-feature/python-sdk-contrib@80da6b94fe63690751ba4df7985c96d992582f68 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/open-feature
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@80da6b94fe63690751ba4df7985c96d992582f68 -
Trigger Event:
push
-
Statement type:
File details
Details for the file openfeature_provider_aws_ssm-0.1.1-py3-none-any.whl.
File metadata
- Download URL: openfeature_provider_aws_ssm-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26a36f005bc2b7c219e5c9117c74e3377482f6ba7151fb5856ec167527f0ab21
|
|
| MD5 |
0e258638899c2bb367572983063e197f
|
|
| BLAKE2b-256 |
8c5be205f6c4675a485dba987ba378f1fe0ee72811fa654587c7b560cafd976b
|
Provenance
The following attestation bundles were made for openfeature_provider_aws_ssm-0.1.1-py3-none-any.whl:
Publisher:
release.yml on open-feature/python-sdk-contrib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openfeature_provider_aws_ssm-0.1.1-py3-none-any.whl -
Subject digest:
26a36f005bc2b7c219e5c9117c74e3377482f6ba7151fb5856ec167527f0ab21 - Sigstore transparency entry: 957466743
- Sigstore integration time:
-
Permalink:
open-feature/python-sdk-contrib@80da6b94fe63690751ba4df7985c96d992582f68 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/open-feature
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@80da6b94fe63690751ba4df7985c96d992582f68 -
Trigger Event:
push
-
Statement type: