AWS Lambda Container Deployment CLI with AI-powered code analysis
Project description
ACTIG Lambda Deployer
An intelligent AWS Lambda container deployment CLI that automates code analysis and deployment using AWS Bedrock Claude for AI-powered artifact generation.
Features
✨ AI-Powered Analysis: Uses AWS Bedrock Claude to analyze Lambda code and generate optimized deployment artifacts
🐳 Container Deployments: Automated Docker container builds and ECR repository management
🚀 Complete CI/CD Pipeline: Integrates CodeCommit, CodeBuild, and CloudFormation for end-to-end automation
📦 Artifact Generation: Automatically generates Dockerfile, buildspec.yml, and CloudFormation templates
🔧 Team Standards: Follows your team's build patterns and requirements
Installation
pip install actig-lambda-deployer
Prerequisites
- AWS CLI configured with appropriate permissions
- AWS Bedrock access with Claude models enabled
- Git configured for CodeCommit (if using CodeCommit)
- Docker (for local testing)
Quick Start
1. Prepare Your Lambda Function
Your Lambda function directory should contain:
- Python source files (
.py) requirements.txtfile (required)
Example structure:
my-lambda/
├── lambda_function.py
└── requirements.txt
2. Deploy Your Function
actig-lambda-deployer deploy ./my-lambda --function-name my-function
The tool will:
- Analyze your code using AI
- Generate optimized deployment artifacts
- Create CI/CD pipeline infrastructure
- Build and deploy your container image
- Deploy your Lambda function
3. Check Deployment Status
actig-lambda-deployer status my-function
Configuration
AWS Credentials
Configure AWS credentials using any standard method:
# Using AWS CLI
aws configure
# Using environment variables
export AWS_ACCESS_KEY_ID=your-key
export AWS_SECRET_ACCESS_KEY=your-secret
export AWS_DEFAULT_REGION=us-east-1
# Using AWS profiles
actig-lambda-deployer deploy ./my-lambda --function-name my-func --profile production
Bedrock Access
Ensure you have access to these Bedrock models:
anthropic.claude-3-5-sonnet-20240620-v1:0
Enable model access in the AWS Bedrock console.
Usage Examples
Basic Deployment
actig-lambda-deployer deploy ./src --function-name api-handler
Custom ECR Repository
actig-lambda-deployer deploy ./src --function-name api-handler --repository-name my-custom-repo
Dry Run (Preview Changes)
actig-lambda-deployer deploy ./src --function-name api-handler --dry-run
Different AWS Region
actig-lambda-deployer deploy ./src --function-name api-handler --region us-west-2
Debug Mode
actig-lambda-deployer deploy ./src --function-name api-handler --log-level DEBUG
CLI Reference
Commands
deploy- Analyze and deploy Lambda functionstatus- Check deployment status--help- Show help information
Global Options
--profile- AWS profile to use (default: default)--region- AWS region (default: us-east-1)--log-level- Logging level (DEBUG, INFO, WARNING, ERROR)
Deploy Options
--function-name- Lambda function name (required)--repository-name- ECR repository name (optional)--dry-run- Preview changes without deployment
Requirements File
Your requirements.txt must be present in the Lambda source directory. Example:
boto3>=1.26.0
requests>=2.31.0
pydantic>=1.10.0
Generated Artifacts
The tool automatically generates:
- Dockerfile - Optimized for Lambda container runtime
- buildspec.yml - CodeBuild configuration for CI/CD
- CloudFormation template - Infrastructure as code
These are created in your source directory and can be customized as needed.
AWS Resources Created
The deployment creates:
- ECR repository for container images
- CodeCommit repository for source code (optional)
- CodeBuild project for CI/CD pipeline
- IAM roles with minimal required permissions
- CloudFormation stack for Lambda function
- CloudWatch log groups
Troubleshooting
Common Issues
"requirements.txt not found"
# Ensure requirements.txt exists in your source directory
ls ./my-lambda/requirements.txt
"AWS credentials not configured"
# Configure AWS credentials
aws configure
# Or set environment variables
export AWS_PROFILE=your-profile
"Bedrock access denied"
- Enable model access in AWS Bedrock console
- Ensure your IAM user/role has Bedrock permissions
"Build failed with Docker errors"
- Check your requirements.txt for invalid packages
- Ensure all dependencies are compatible with Lambda runtime
Debug Mode
For detailed logging:
actig-lambda-deployer deploy ./src --function-name my-func --log-level DEBUG
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
- GitHub Issues: Report bugs or request features
- Documentation: Full documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file actig_lambda_deployer-0.1.0.tar.gz.
File metadata
- Download URL: actig_lambda_deployer-0.1.0.tar.gz
- Upload date:
- Size: 30.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c35277b244597ba266834c00a235f1ce2dad9f00300de70f3fdc84cab626cdeb
|
|
| MD5 |
934225f73cbc38307bcc4b8485ed78eb
|
|
| BLAKE2b-256 |
fd099279a87e070d0542327a12eac72883f5d70aae3bd5c5c735ba9cc5f61e7a
|
File details
Details for the file actig_lambda_deployer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: actig_lambda_deployer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b45054c502f73b5ee42ececbfc2c7ee8bc462cad28eff05272bb4dd4509110fc
|
|
| MD5 |
7f540ed86eaeaa59feec1ded0ed8dca3
|
|
| BLAKE2b-256 |
33e352e8a11e75a99751471266794586167a1032ada338b24abeabb7aaf7cd6e
|