【问题标题】:Credential should be scoped to a valid region, not 'eu-west-1' using aws java sdk 1.11.618凭证的范围应为有效区域,而不是使用 aws java sdk 1.11.618 的“eu-west-1”
【发布时间】:2020-01-18 07:39:55
【问题描述】:

我已将 awsjavasdk jar 从 1.9.34 升级到 1.11.618 版本。

我面临的凭据应该是有效区域,而不是运行代码时出现的“eu-west-1”问题。

【问题讨论】:

  • 不推荐使用的代码:AmazonCloudFrontClient cloudfront = new AmazonCloudFrontClient(); cloudfront.setEndpoint(endPoint); cloudfront.setRegion(region);
  • 按照已弃用的代码添加以下代码:AmazonCloudFront cloudfront = AmazonCloudFrontClientBuilder.standard() .withEndpointConfiguration(new EndpointConfiguration(endPoint, Regions.EU_WEST_1.getName())).build();
  • 尝试在 aws cli 中更改配置文件中的区域。

标签: amazon-web-services aws-java-sdk


【解决方案1】:

根据我发现的其他一些帖子,有时服务是“无区域的”并且更喜欢 us-east-1 作为区域,即使资源位于其他区域。

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

就我而言,我在都柏林使用 Route53 资源,并在 CLI 命令中将区域设置为 us-east-1 解决了问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-27
    • 1970-01-01
    • 2017-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多