Skip to content

S3 Control operation (createMultiRegionAccessPoint) fails with missing x-amz-content-sha256 header #1187

@0marperez

Description

@0marperez

Describe the bug

When trying to create a multi-region-access-point using s3 control the operation fails with an exception.

Expected behavior

The operation should succeed without any exceptions

Current behavior

The operation fails with the exception:

Exception in thread "main" aws.sdk.kotlin.services.s3control.model.S3ControlException: Missing required header for this request: x-amz-content-sha256

Steps to Reproduce

Try to create a multi-region-access-point using s3 control with the AWS SDK for Kotlin.
The code snippet used:

fun main(): Unit = runBlocking {
    val s3Control = S3ControlClient {
        region = "us-west-2"
        logMode = LogMode.LogRequestWithBody + LogMode.LogResponse
    }

    s3Control.createMultiRegionAccessPoint(
        CreateMultiRegionAccessPointRequest{
            accountId = "..."
            details {
                name = "mrap-test"
                regions = listOf(
                    Region {
                        bucket = "..."
                        bucketAccountId = "..."
                    },
                    Region {
                        bucket = "..."
                        bucketAccountId = "..."
                    }
                )
            }
        }
    )
}

Possible Solution

Add the missing header

Context

No response

AWS Kotlin SDK version used

1.0.37

Platform (JVM/JS/Native)

JVM

Operating System and version

Mac OS Ventura 13.6.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions