AWS DataSync doesn’t have a built-in feature to delete source files from S3 after a transfer is complete. As DataSync is primarily designed for use cases like disaster recovery, where retaining the source data is normal. However, you can set up a custom solution by using DataSync's logging capabilities to handle deletions for successfully transferred files.
You just need to enable detailed logging in your DataSync task and direct the logs to CloudWatch. Then, create a Lambda function that triggers whenever a new log entry is added. This function can parse the logs to identify files that were successfully transferred and delete them from the source S3 bucket. This approach ensures only confirmed files are removed.