How to ensure backups are successfully persisted to S3 when using Ola Hallengren solution on AWS EC2 Instances
Have you tried using the AWSCLI? I have an Agent Job that runs a .bat after my backups are complete. The bat runs the sync command. I don't delete anything from S3, I simply let the CLI sync new or changed files up to my bucket. I then use bucket policies to manage the lifetime of my backups that are up there.
My bat script is below. You will need to provide your own paths. Don't forget to run AWS Configure to setup the CLI. I suggest creating a specific profile that has least privilege access to upload to S3. This is for Windows.
setlocal

set  tm=%time: =0%
set  tm=%tm:~0,2%_%tm:~3,2%_%tm:~6,2%
set dt=%date:~10,4%_%date:~4,2%_%date:~7,2%

echo &quot;Starting...&quot; &gt;&gt; &quot;L:\Logs\SyncBackups\s3SyncBak_%dt%_%tm%.txt&quot;

aws s3 sync &quot;B:\Database&quot; &quot;s3://MyBucketName/ProductionDatabaseBackups&quot; --exclude &quot;*&quot; --include &quot;*.bak&quot; --profile MyProfileName &gt;&gt; &quot;L:\Logs\SyncBackups\s3SyncBak_%dt%_%tm%.txt&quot;

echo &quot;Synced with no problem ...&quot; &gt;&gt; &quot;L:\Logs\SyncBackups\s3SyncBak_%dt%_%tm%.txt&quot;