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
import os | |
from aws_lambda_powertools.utilities.parameters import get_parameter | |
credentials = get_parameter(f"payment_credentials_{os.environ['ENVIRONMENT']}", transform="json", decrypt=True) | |
assert isinstance(credentials, dict) | |
payment_client = PaymentService(**credentials) | |
... | |
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
import os | |
from typing import Any, Callable, Dict | |
from aws_lambda_powertools import Logger, Metrics, Tracer | |
from aws_lambda_powertools.logging import correlation_paths | |
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 DynamoDBPersistenceLayer, IdempotencyConfig, idempotent | |
from aws_lambda_powertools.utilities.idempotency.exceptions import ( | |
IdempotencyAlreadyInProgressError, |
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
import json | |
import os | |
import time | |
from typing import Any, Callable, Dict | |
from aws_lambda_powertools import Logger, Metrics, Tracer | |
from aws_lambda_powertools.logging import correlation_paths | |
from aws_lambda_powertools.metrics import MetricUnit | |
from aws_lambda_powertools.middleware_factory import lambda_handler_decorator | |
from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEvent |
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
# cdk/Makefile | |
dev: | |
# Installs peotry and the dependencies | |
pip install --upgrade pip poetry | |
poetry install |
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
# Ensure we have the latest pip and pipenv | |
pip3 install --upgrade pip pipenv | |
# Setup new Python 3.8 project | |
pipenv --python 3.8 | |
# Install aws-lambda-powertools | |
pipenv install boto3 aws-lambda-powertools | |
# Install dev dependencies | |
pipenv install black pytest isort mypy --dev --pre |
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
import json | |
import os | |
import time | |
from typing import Any, Callable, Dict | |
from aws_lambda_powertools import Logger, Metrics, Tracer | |
from aws_lambda_powertools.logging import correlation_paths | |
from aws_lambda_powertools.metrics import MetricUnit | |
from aws_lambda_powertools.middleware_factory import lambda_handler_decorator | |
from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEvent |
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
import json | |
import os | |
import time | |
from typing import Any, Dict | |
from aws_lambda_powertools import Logger, Metrics, Tracer | |
from aws_lambda_powertools.logging import correlation_paths | |
from aws_lambda_powertools.metrics import MetricUnit | |
from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEvent | |
from aws_lambda_powertools.utilities.idempotency import DynamoDBPersistenceLayer, IdempotencyConfig, idempotent |
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
import json | |
import os | |
import time | |
from typing import Any, Dict | |
from aws_lambda_powertools import Logger, Metrics, Tracer | |
from aws_lambda_powertools.logging import correlation_paths | |
from aws_lambda_powertools.metrics import MetricUnit | |
from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEvent | |
from aws_lambda_powertools.utilities.typing import LambdaContext |
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
import json | |
import os | |
import time | |
from aws_lambda_powertools import Logger, Metrics, Tracer | |
from aws_lambda_powertools.logging import correlation_paths | |
from aws_lambda_powertools.metrics import MetricUnit | |
from aws_lambda_powertools.utilities.data_classes import APIGatewayProxyEvent | |
logger = Logger() |
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
import json | |
import time | |
from aws_lambda_powertools import Logger, Metrics, Tracer | |
from aws_lambda_powertools.logging import correlation_paths | |
from aws_lambda_powertools.metrics import MetricUnit | |
logger = Logger() | |
tracer = Tracer() | |
metrics = Metrics() |
NewerOlder