'Providing an S3 upload task with AWS creds?

I'm currently using a service connection for this:

- task: S3Upload@1
    inputs:
      regionName: 'us-east-1'
      bucketName: 'bucket'
      sourceFolder: '$(Build.ArtifactStagingDirectory)'
      globExpressions: '**'
      fileAcl: 'public-read'
      awsCredentials: 'Account'
    displayName: 'S3 Upload'

But, since my keys are rotating, which I found out the hard way, how would I go about using actual AWS access, secret and session keys inside the task? I'm already exporting them as variables for other stuff, just wondering if an S3 upload task can take them somehow?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source