This repository demonstrates how to set up, deploy, and observe an AWS Lambda function in a microservice architecture using AWS CDK with Python.
The repository article can be found here.
- Step 1: Setting Up and Structuring the AWS Lambda Project
- Step 2: Building and Deploying a Python Lambda Function Using Lambda Layers
- Step 3: Input Data Validation
- Step 4: Setting up Monitoring and Alarms
- Python 3.12+
- AWS CLI configured with appropriate permissions
- Node.js and npm (for AWS CDK)
- Poetry for Python dependency management
- Clone the repository:
git clone https://github.com/myarik/aws-cdk-python-demo.git
cd aws-cdk-python-demo
- Install the dependencies:
make dev
aws-cdk-python-demo/
├── app.py # CDK app entry point
├── infrastructure/ # CDK stack definitions
├── service/ # Lambda function code
├── tests/ # Test files
├── Makefile # Utility commands
├── README.md
└── pyproject.toml # Python project configuration
Run tests using:
make test
Deploy the stack:
make deploy
To destroy the stack:
make destroy