amahfouz
amahfouz

Reputation: 2398

Credential should be scoped to a valid region, not 'us-west-1' using AWS SES

Trying a send an email using SES using the us-west-2 service endpoint. My account is in us-west-1 so I specified that as the signing region:

    AmazonSimpleEmailServiceClientBuilder builder 
         = AmazonSimpleEmailServiceClientBuilder.standard();
    builder.setEndpointConfiguration
        (new EndpointConfiguration("email.us-west-2.amazonaws.com", "us-west-1"));

I am getting this error:

com.amazonaws.services.simpleemail.model.AmazonSimpleEmailServiceException: Credential should be scoped to a valid region, not 'us-west-1'. (Service: AmazonSimpleEmailService; Status Code: 403; Error Code: SignatureDoesNotMatch;

Any help appreciated.

EDIT Note that the signing region (where my account is) is us-west-1, whereas the endpoint is in us-west-2 as it should be. Could there be something I need to do in the AWS console first, like validate an email or something?

Upvotes: 15

Views: 28849

Answers (1)

Farid Nouri Neshat
Farid Nouri Neshat

Reputation: 30430

It simply looks like you can't use one region with endpoint of another region.

Upvotes: 3

Related Questions