我有一个springboot应用程序,该应用程序连接到aws sns。我想在本地进行测试,所以我使用了localstack。它不起作用,因为我的应用程序无法以任何方式进行身份验证。我在Windows Host上运行它,然后尝试了
导出环境变量
添加到Java System.setProperties
添加/.aws/credetntials文件
但是这种方式都不起作用。如何在Windows主机上执行此操作?也许我将这些文件放在错误的目录中
Exception in thread "pool-3-thread-1" com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain: [com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@653f6eff: Unable to load credentials from service endpoint, com.amazonaws.auth.profile.ProfileCredentialsProvider@4299dc98: Unable to load credentials into profile [default]: AWS Access Key ID is not specified.]
at com.amazonaws.auth.AWSCredentialsProviderChain.getCredentials(AWSCredentialsProviderChain.java:136)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.getCredentialsFromContext(AmazonHttpClient.java:1186)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.runBeforeRequestHandlers(AmazonHttpClient.java:776)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:726)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:719)