How to use AWS CLI within AWS Lambda?

Viewed 33

I want to Copy data from an S3 bucket in one account and Region to another account and Region which is why I want to use AWS CLI to be triggered by an entry to the source s3 bucket and the lambda function can then use AWS CLI to run aws s3 sync

So I tried using the techniques given here: https://bezdelev.com/hacking/aws-cli-inside-lambda-layer-aws-s3-sync/

Basically

  1. Install AWS CLI in a local virtual environment
  2. Package AWS CLI and all its dependencies to a zip file
  3. Create a Lambda Layer

However even after I add the layer I still see the error ModuleNotFoundError: No module named 'awscli'

0 Answers
Related