To set up an AWS Lambda function, an Amazon S3 bucket, and an S3 trigger for the function using AWS CloudFormation, you can use the AWS::Lambda::Function, AWS::S3::Bucket, and AWS::Lambda::EventSourceMapping resources. Here is an example of how you might use these resources in a CloudFormation template: