I am creating an AWS Lambda function that is runned monthly. Each month process some data and write that back to S3 Bucket.
Do you know how you can you write a file from AWS Lambda Java to a S3 bucket?
Yes, you have to create a text file in S3 bucket and take a reference of the following code to update the file contents as per your requirement.
AmazonS3 client = new AmazonS3Client();
/**
* @param bucketName
* The name of the bucket to place the new object in.
* @param key
* The key of the object to create.
* @param content
* The String to encode
*/
client.putObject("**Bucket Name**", "**File Name to write**", "updated string contents");
The same way you can write a file to S3 from any Java application. Use the AWS SDK for Java.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With