Skip to content

Commit b9a1d54

Browse files
Alexheitorlessa
Alex
andauthored
docs(feature-flags): create concrete documentation (#594)
Co-authored-by: heitorlessa <lessa@amazon.co.uk>
1 parent 7b3b032 commit b9a1d54

File tree

7 files changed

+621
-27
lines changed

7 files changed

+621
-27
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ A suite of Python utilities for AWS Lambda functions to ease adopting best pract
2525
* **[Event source data classes](https://awslabs.github.io/aws-lambda-powertools-python/latest/utilities/data_classes/)** - Data classes describing the schema of common Lambda event triggers
2626
* **[Parser](https://awslabs.github.io/aws-lambda-powertools-python/latest/utilities/parser/)** - Data parsing and deep validation using Pydantic
2727
* **[Idempotency](https://awslabs.github.io/aws-lambda-powertools-python/latest/utilities/idempotency/)** - Convert your Lambda functions into idempotent operations which are safe to retry
28+
* **[Feature Flags](./utilities/feature_flags.md)** - A simple rule engine to evaluate when one or multiple features should be enabled depending on the input
2829

2930
### Installation
3031

Diff for: aws_lambda_powertools/utilities/feature_flags/appconfig.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(
2121
environment: str,
2222
application: str,
2323
name: str,
24-
cache_seconds: int,
24+
max_age: int = 5,
2525
sdk_config: Optional[Config] = None,
2626
envelope: Optional[str] = "",
2727
jmespath_options: Optional[Dict] = None,
@@ -36,8 +36,8 @@ def __init__(
3636
AppConfig application name, e.g. 'powertools'
3737
name: str
3838
AppConfig configuration name e.g. `my_conf`
39-
cache_seconds: int
40-
cache expiration time, how often to call AppConfig to fetch latest configuration
39+
max_age: int
40+
cache expiration time in seconds, or how often to call AppConfig to fetch latest configuration
4141
sdk_config: Optional[Config]
4242
Botocore Config object to pass during client initialization
4343
envelope : Optional[str]
@@ -49,7 +49,7 @@ def __init__(
4949
self.environment = environment
5050
self.application = application
5151
self.name = name
52-
self.cache_seconds = cache_seconds
52+
self.cache_seconds = max_age
5353
self.config = sdk_config
5454
self.envelope = envelope
5555
self.jmespath_options = jmespath_options

Diff for: aws_lambda_powertools/utilities/feature_flags/feature_flags.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, store: StoreProvider):
2424
environment="test",
2525
application="powertools",
2626
name="test_conf_name",
27-
cache_seconds=300,
27+
max_age=300,
2828
envelope="features"
2929
)
3030

Diff for: docs/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ aws serverlessrepo list-application-versions \
212212
[Event source data classes](./utilities/data_classes.md) | Data classes describing the schema of common Lambda event triggers
213213
[Parser](./utilities/parser.md) | Data parsing and deep validation using Pydantic
214214
[Idempotency](./utilities/idempotency.md) | Idempotent Lambda handler
215+
[Feature Flags](./utilities/feature_flags.md) | A simple rule engine to evaluate when one or multiple features should be enabled depending on the input
215216

216217
## Environment variables
217218

Diff for: docs/media/feat_flags_evaluation_workflow.png

69 KB
Loading

0 commit comments

Comments
 (0)