-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ran Isenberg
committed
Jan 13, 2023
1 parent
4310bcc
commit bcb1dac
Showing
4 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"christmas_discount": { | ||
"default": false, | ||
"rules": { | ||
"enable discount during christmas": { | ||
"when_match": true, | ||
"conditions": [ | ||
{ | ||
"action": "SCHEDULE_BETWEEN_DATETIME_RANGE", | ||
"key": "CURRENT_DATETIME", | ||
"value": { | ||
"START": "2022-12-25T12:00:00", | ||
"END": "2022-12-31T23:59:59", | ||
"TIMEZONE": "America/New_York" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from aws_lambda_powertools.utilities.feature_flags import AppConfigStore, FeatureFlags | ||
|
||
app_config = AppConfigStore(environment="dev", application="product-catalogue", name="features") | ||
|
||
feature_flags = FeatureFlags(store=app_config) | ||
|
||
|
||
def lambda_handler(event, context): | ||
# Get customer's tier from incoming request | ||
xmas_discount = feature_flags.evaluate(name="christmas_discount", default=False) | ||
|
||
if xmas_discount: | ||
# Enable special discount on christmas: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters