Skip to content

Commit ebaee78

Browse files
pdevaclaude
andauthored
Support --xa-s3 suffix for S3 Express One Zone bucket access points (#663)
AWS recently introduced a new `--xa-s3` suffix for S3 Express One Zone directory buckets (in addition to the existing `--x-s3` suffix). `parse_bucket_az` only recognized `--x-s3`, causing a `ZoneSuffix` error for buckets using the new suffix. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7ded938 commit ebaee78

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/aws/builder.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,10 @@ impl AmazonS3Builder {
12611261
///
12621262
/// <https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html>
12631263
fn parse_bucket_az(bucket: &str) -> Option<&str> {
1264-
Some(bucket.strip_suffix("--x-s3")?.rsplit_once("--")?.1)
1264+
let base = bucket
1265+
.strip_suffix("--x-s3")
1266+
.or_else(|| bucket.strip_suffix("--xa-s3"))?;
1267+
Some(base.rsplit_once("--")?.1)
12651268
}
12661269

12671270
/// Encryption configuration options for S3.
@@ -1787,8 +1790,11 @@ mod tests {
17871790
let cases = [
17881791
("bucket-base-name--usw2-az1--x-s3", Some("usw2-az1")),
17891792
("bucket-base--name--azid--x-s3", Some("azid")),
1793+
("bucket-base-name--use1-az4--xa-s3", Some("use1-az4")),
1794+
("bucket-base--name--azid--xa-s3", Some("azid")),
17901795
("bucket-base-name", None),
17911796
("bucket-base-name--x-s3", None),
1797+
("bucket-base-name--xa-s3", None),
17921798
];
17931799

17941800
for (bucket, expected) in cases {

0 commit comments

Comments
 (0)