[英]How to call s3 bucket from ECS container via aws sdk (java) by using IAM role
I need to read a file from s3 bucket from ECS container by using aws sdk.我需要使用 aws sdk 从 ECS 容器的 s3 存储桶中读取文件。 What are the best option available?.
什么是最好的选择? I tried initializing aws client with default aws creds give but that did not work.
我尝试使用默认的 aws creds 初始化 aws 客户端,但这不起作用。 I followed https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/ec2-iam-roles.html but InstanceProfileCredentialsProvider is also depreciated.
我跟着https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/ec2-iam-roles.html但 InstanceProfileCredentialsProvider 也被贬值了。
Try the below snippet to create an object and put the detail of the error you are getting尝试使用以下代码段创建 object 并输入您遇到的错误的详细信息
S3Client s3Client = S3Client.builder().region(<>).build();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.