Amazon SQS旧版配置文件格式警告

Cal*_*ney 3 java amazon-web-services maven

我将消息发布到Amazon SQS队列.在启动时,我在日志中收到以下警告.

[http-nio-9090-exec-2][BasicProfileConfigLoader] The legacy profile format 
requires the 'profile ' prefix before the profile name. The latest code does 
not require such prefix, and will consider it as part of the profile name. 
Please remove the prefix if you are seeing this warning.
Run Code Online (Sandbox Code Playgroud)

我在Maven中使用以下版本的Amazon SQS:

    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-sqs</artifactId>
        <version>1.11.125</version>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

我怎么能摆脱这个警告?

E.J*_*nan 9

这很可能是指您的配置文件中包含部分aws凭据.你的机器上的位置取决于你使用的操作系统,但是在我的Mac上,它位于\ users\myname.aws\config中

旧格式是这样的(例如):

[profile <profilename>]
region=us-east-1
output=json
Run Code Online (Sandbox Code Playgroud)

现在应该看起来像这样:

[<profilename>]
region=us-east-1
output=json
Run Code Online (Sandbox Code Playgroud)

  • 从我的应用程序的角度来看,这也对我有用。但是,从 AWS CLI 命令 aws s3 ls 查找 profile 关键字。我仍在使用 AWS CLI 1.# 可能是问题所在,请注意。 (2认同)