DEV Community

Mohan Sharma
Mohan Sharma

Posted on

How to add custom CA Cert in Lambda function

Steps

  1. Put certificate in PEM format at the following path python/certs/xyz.pem. Directory structure is important.
  2. Zip python directory and create lambda layer using this zip file.
  3. Create lambda function under VPC using the below code and attach lambda layer created at step 2. sample lambda code
  4. Set Environment variable in Lambda function. Key : REQUESTS_CA_BUNDLE Value: /opt/python/certs/xyz.pem
  5. Test the lambda function.

Top comments (0)