简体   繁体   English

如何从单个 docker 容器与多个 S3 存储桶进行交互?

[英]How to interact with multiple S3 bucket from a single docker container?

I have a case of making multiple s3 buckets interact with each other from a docker container.我有一个使多个 s3 存储桶从 docker 容器相互交互的案例。 For example I have an s3 bucket named ABCD and another named EFGH.例如,我有一个名为 ABCD 的 s3 存储桶和另一个名为 EFGH 的存储桶。 Now I want to build a docker container inside which I need to copy data from ABCD to EFGH or in general do all the read write operations.现在我想构建一个 docker 容器,我需要在其中将数据从 ABCD 复制到 EFGH,或者通常执行所有读写操作。 I have role based access to these buckets as well as I have credentials like aws acess keys available.我对这些存储桶具有基于角色的访问权限,并且我拥有可用的 aws 访问密钥等凭证。 I am able to do this from my local machine but now need it to be done from the container我可以从我的本地机器上执行此操作,但现在需要从容器中完成

Using access keys in your container is a very bad approach, you should never use this.在您的容器中使用访问密钥是一种非常糟糕的方法,您永远不应该使用它。

In your case, I would suggest, deploying your docker using ECS by creating a task definition that uses your docker image, and in your task definition, you can give the task execution role permissions to use your S3 buckets.在你的情况下,我建议,通过创建一个使用你的 docker 图像的任务定义,使用 ECS 部署你的 docker,并且在你的任务定义中,你可以授予task execution role使用你的 S3 存储桶的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以将数据从多个 S3 存储桶复制到单个 S3 存储桶吗? - Can I replicate data from Multiple S3 buckets to a single S3 bucket? 如何将多个s3 bucket资源导入到单个terraform资源名称 - how to import multiple s3 bucket resources to single terraform resource name 我们如何在单个 S3 存储桶中托管多个 HTML 文件以获取每个文件的单独 URL? - How do we host multiple HTML files in a single S3 bucket to get separate URLs for each file? 如何仅从具有 S3 url 的 s3 存储桶中删除多个选定文件? - How do i delete multiple selected Files only from a s3 bucket which has S3 url? 如何将指定字节范围内的多个对象从 S3 存储桶复制/移动到另一个存储桶? - How can I copy/move multiple objects from a S3 bucket within specified byte-ranges to another bucket? 如何通过 API 从 S3 存储桶下载私有文件 - How to dowload a private file from S3 bucket through API 如何从 amazon s3 存储桶中删除文件? - how to delete files from amazon s3 bucket? 如何从 S3 存储桶计算 Lambda 中图像的像素面积? - How to calculate pixel area of an image in Lambda from an S3 bucket? S3 存储桶策略多个条件 - S3 bucket policy multiple conditions 如何使用 Glue 作业将 JSON 从 s3 转换为 CSV 文件并将其保存在同一个 s3 存储桶中 - How to convert JSON to CSV file from s3 and save it in same s3 bucket using Glue job
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM