Copy data from S3 into EFS with a Lambda function with AWS CDK in Python — AWS CDK
Copy files from S3 to EFS in your cluster using a Lambda function for fast access. Set up EFS and create your first access point with our guide.
Using EFS can be very useful when you have a cluster in ECS or EKS running with an EFS mounted into your scaling environment. But sometimes you need a way around to copy files from S3 storage into your EFS production environment to get speed for the application you are working on.
In that case, you can use the Lambda function for that, so when an S3 Object is created you get notified about the data and it will trigger the Lambda function you are creating to copy the S3 Object into the EFS mount.
I will learn you how you easily can get up and running with EFS (Elastic File System) and how you create your first access point and mount it to your Lambda function.
Do the EFS and EFS Access points ready for use
We need to create our EFS Volume on AWS, and I will place it inside the private subnet with NAT, I’m saying after 1 day the files are not used and sent to a cheaper storage layer, and if the file gets touched it is returned back to the…