1

I have upgraded awsjavasdk jar from 1.9.34 to 1.11.618 version.

I am facing Credential should be scoped to a valid region, not 'eu-west-1' issue when ever running the code.

pri
  • 83
  • 2
  • 10
  • Deprecated code: AmazonCloudFrontClient cloudfront = new AmazonCloudFrontClient(); cloudfront.setEndpoint(endPoint); cloudfront.setRegion(region); – pri Sep 17 '19 at 12:31
  • added below code in pace of deprcated code : AmazonCloudFront cloudfront = AmazonCloudFrontClientBuilder.standard() .withEndpointConfiguration(new EndpointConfiguration(endPoint, Regions.EU_WEST_1.getName())).build(); – pri Sep 17 '19 at 12:32
  • 1
    try changing the region in the config file in aws cli. – Althaf1467 Mar 13 '20 at 13:15

1 Answers1

0

According to some other posts I found, sometimes services are "regionless" and prefer us-east-1 as the region, even though the resources are in other regions.

Ref: https://forums.aws.amazon.com/thread.jspa?messageID=821713 AWS Cloudfront: Credential should be scoped to a valid region

In my case, I was working with Route53 resources in Dublin, and setting the region to us-east-1 in the CLI command fixed the problem.

Paula T
  • 1,212
  • 11
  • 13