My Amazon S3 bucket's location is London so when I am trying upload document to this bucket I need to use Amazon.RegionEndpoint.EUWest2 as a region.
Amazon.S3.IAmazonS3 client;
using (client = Amazon.AWSClientFactory.CreateAmazonS3Client(_awsAccessKey, _awsSecretKey,Amazon.RegionEndpoint.EUWest1))
{
var request = new Amazon.S3.Model.PutObjectRequest()
{
};
client.PutObject(request);
}
But somehow I am not able to see any region with name EUWest2 only availble Europe regions are EUWest1 and EUCentral1. Because of this incorrect regions am getting error as
The bucket you are attempting to access must be addressed using the specified endpoint
What can be a reason for it, I am using AWSSDK.dll's 2.3.55.2 version. which I found latest today on Amazon S3 site.
I know this is a late reply but it may help someone.
I had the same problem and tried this method.
Instead of using RegionEndpoint.EUWEST... You can try using the GetBySystemName(string)
RegionEndpoint.GetBySystemName("eu-west-2")
Hope this helps
It just happens to me, the problem is that we have installed AWSSDK nugget instead of AWSSDK.Lambda nugget Desintalling AWSSDK (if needed) and installing AWSSDK.Lambda, should fix the error for you as did for me.