This project demonstrates how to fetch secrets securely from AWS Secrets Manager using AWS Lambda and Python.
- AWS Lambda
- AWS Secrets Manager
- IAM
- Python boto3 SDK
get-secret-function/
│
├── lambda_function.py
├── requirements.txt
└── README.mdThe Lambda function retrieves secrets from AWS Secrets Manager.
- Create a secret in AWS Secrets Manager
- Create Lambda function
- Attach IAM permission:
- SecretsManagerReadWrite
- Deploy code
- Test Lambda
{
"statusCode": 200,
"body": {
"message": "Secret fetched successfully"
}
}AWS Lambda project using AWS Secrets Manager and Python
b90d04f0b142fc03f4cb64fb308a0f4db7caafa0