AWS S3 upload without access and secret key in Java
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to upload a file to S3 without using my access and secret key from AWS server. AWS keys should be taken as default. However running the below command in server I can access it without providing any access and secret keys. aws s3 cp somefile.txt s3://somebucket/ From java code its not accessible since it was unable to load credentials. Below is my code. AmazonS3 s3client = new AmazonS3Client(new DefaultAWSCredentialsProviderChain()); 回答1: You can use the below Java code to get the s3client instance when you are trying to connect to S3