I am a bit new to AWS / Lambda from the technical side so I have a scenario adn I wanted your help.
I have a file that drops daily, I only care about the file on th
Your Lambda function, in whatever language, will use S3-SDK to deal with files in S3 bucket(s). With S3, files (objects) cannot be rename, but what you can do is copy to another name (object key), and delete the old file.
How to copy file on S3
AmazonS3 s3client = new AmazonS3Client(new ProfileCredentialsProvider());
s3client.copyObject(sourceBucketName, sourceKey,
destinationBucketName, destinationKey);
http://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectUsingJava.html
How to delete file on S3
AmazonS3 s3Client = new AmazonS3Client(new ProfileCredentialsProvider());
try {
s3Client.deleteObject(new DeleteObjectRequest(bucketName, keyName));
} catch (AmazonServiceException ase) {
System.out.println("Caught an AmazonServiceException.");
System.out.println("Error Message: " + ase.getMessage());
System.out.println("HTTP Status Code: " + ase.getStatusCode());
System.out.println("AWS Error Code: " + ase.getErrorCode());
System.out.println("Error Type: " + ase.getErrorType());
System.out.println("Request ID: " + ase.getRequestId());
} catch (AmazonClientException ace) {
System.out.println("Caught an AmazonClientException.");
System.out.println("Error Message: " + ace.getMessage());
}
http://docs.aws.amazon.com/AmazonS3/latest/dev/DeletingOneObjectUsingJava.html
What you probably have to do is to list objects in the bucket within particular folder, then find your target files (files that are modified/created on particular date/time?), then do whatever you need to do with it, if not copy possibly involve reading up the file, edit it then re-upload to S3.