This file contains hidden or 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
import json | |
import time | |
from aws_lambda_powertools import Logger, Tracer | |
from aws_lambda_powertools.logging import correlation_paths | |
logger = Logger() | |
tracer = Tracer() | |
This file contains hidden or 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
import json | |
import time | |
from aws_lambda_powertools import Logger | |
from aws_lambda_powertools.logging import correlation_paths | |
logger = Logger() | |
def create_payment(payment): |
This file contains hidden or 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
import json | |
import os | |
import time | |
from typing import Callable | |
from aws_lambda_powertools import Logger, Tracer | |
from aws_lambda_powertools.utilities.typing import LambdaContext | |
from aws_lambda_powertools.middleware_factory import lambda_handler_decorator | |
from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEvent | |
from aws_lambda_powertools.utilities.idempotency import ( |
This file contains hidden or 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
import json | |
import time | |
def create_payment(payment): | |
order_key = payment["order_key"] | |
print(f"Order key:", order_key) | |
# Simulate failure | |
if "FAILURE" in order_key: |
NewerOlder