This is an example on how to create a lambda on aws with s3 bucket trigger by using Terraform.
- Setting the providers will allow flexibility in your code.
- Take advantage of
default tags
to automatically add tags to all resources that belong to the project.
- Set the bucket, all details are provided as comments.
- Use default code or extended code for the function, all details are provided as comments.
- Write your Lambda and push logs to cloudwatch, all details are provided as comments.
- Add th trigger with permissions for S3.
aws lambda invoke --region=your_region --function-name=function_name response.json
cat response.json
- Upload a photo to S3 and check the logs in cloudwatch.
- This is Part one/three of a bigger project for face recognition app. It will include Rekognition integration and Api.