Bug #109735 No way to set the Region for S3 backups
Submitted: 23 Jan 2023 10:21 Modified: 27 Jan 2023 11:55
Reporter: James Walker Email Updates:
Status: Analyzing Impact on me:
Category:MySQL Operator Severity:S3 (Non-critical)
Version:8.0.32-2.0.8 OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[23 Jan 2023 10:21] James Walker
There does not seem to be a way to set the AWS region to upload S3 backups to.

When manually setting the region by changing the endpoint URL (e.g. https://s3.eu-west-2.amazonaws.com), the backups terminate by complaining

> Failed to list objects using prefix 'mysql-default230123095935/': The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'eu-west-2' (400)

Putting `region = eu-west-2` into the data in the credentials secret has no effect.

I see this as a pretty glaring omission.

How to repeat:

Suggested fix:
Add a new option e.g. BackupProfile.storage.s3.region to set the AWS region to upload to.
[24 Jan 2023 7:54] James Walker
(Similarly, there's no way to set the region when restoring a backup from S3, using initDB.dump.storage.s3 either.)
[27 Jan 2023 11:55] James Walker
I've realised there is a workaround:

You can set backupProfile.dumpInstance.dumpOptions.s3Region which will get passed directly to the mysqlsh's utils.dump_instance() call.

But this doesn't feel particularly clear, and could with being called out in the docs at least.