| Command | Mô tả |
|---|---|
sam local invoke | Run Lambda locally |
sam local start-api | Local API Gateway |
sam local start-lambda | Local Lambda endpoint |
sam local generate-event | Generate sample events |
sam validate | Validate template |
sam build | Build dependencies |
sam build
sam local generate-event apigateway aws-proxy > events/api.json
sam local invoke MyFunction -e events/api.json
sam local start-api --port 3000
Browser-based shell environment trong AWS Console, pre-configured với AWS CLI và common tools.
| Feature | Mô tả |
|---|---|
| Pre-installed | AWS CLI, Python, Node.js, pip, npm, git |
| Storage | 1 GB persistent storage per region |
| Credentials | Tự động dùng console login credentials |
| Cost | Free (no additional charges) |
| Timeout | Session expires sau 20 min idle |
| File transfer | Upload/download files (max 1GB) |
# CloudShell — no credential setup needed
aws lambda invoke --function-name my-function \
--payload '{"key": "value"}' output.json
# Test API Gateway
curl https://api-id.execute-api.region.amazonaws.com/dev/orders
# Quick DynamoDB check
aws dynamodb scan --table-name Orders --max-items 5
# Invoke deployed Lambda
aws lambda invoke --function-name my-function \
--payload '{"key": "value"}' output.json
# Test API Gateway
curl https://api-id.execute-api.region.amazonaws.com/dev/orders
Exam Tip: sam local invoke = local test. aws lambda invoke = test deployed function. Console test events for quick validation.