amazon web services – .NET AWS SDK – Region missing in ARN for multi region access point

I am trying to write a simple .NET console app that puts an object into an AWS S3 bucket via a multi region access point. I get the following error: Amazon.Runtime.AmazonClientException: AWS region is missing in access point ARN

I’m using the v3.x AWS .NET SDK, and reasonably confident that IAM and S3 policies are correct because I can put objects via the CLI no problem. I’m sure I’m missing something totally obvious, but any help is appreciated.

using Amazon;
using Amazon.S3;
using Amazon.S3.Model;

string bucketName = "arn:aws:s3::<account id>:accesspoint/<mrap>";
string keyName = "some/path/test.txt";

AmazonS3Client client;
AmazonS3Config config = new AmazonS3Config();

config.UseArnRegion = false;
config.RegionEndpoint = RegionEndpoint.USWest2;

client = new AmazonS3Client(config);

PutObjectRequest request = new PutObjectRequest()
{
    ContentBody = "this is a test",
    BucketName = bucketName,
    Key = keyName
};

client.PutObjectAsync(request).Wait();

Read more here: Source link