Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 770
amahfouz Avatar asked Mar 31 '17 05:03

amahfouz


1 Answers

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

like image 117
Farid Nouri Neshat Avatar answered Oct 27 '22 00:10

Farid Nouri Neshat