简体   繁体   English

当 EC2 实例和 S3 存储桶位于同一区域时,如果我们通过 EC2 实例从 S3 存储桶中获取数据,CloudFront 是否有用?

[英]Does CloudFront is useful if we fetch data from S3 bucket through EC2 Instance when EC2 Instance and S3 bucket are in Same Region?

For eg: -例如:-

Consider a scenario where I have a back-end service which takes dynamic data from RDS and static data (Audio/Video/pdf) from S3 Bucket.考虑一个场景,我有一个后端服务,它从 RDS 获取动态数据,从 S3 存储桶获取 static 数据(音频/视频/pdf)。

Back-End Service is deployed over an EC2 instance which internally uses AWS SDK to fetch static data from S3 Bucket.后端服务部署在 EC2 实例上,该实例在内部使用 AWS SDK 从 S3 存储桶中获取 static 数据。 Below is the flow:以下是流程:

User Request Data ---> AWS Route 53 ---?用户请求数据 ---> AWS Route 53 ---? ALB ---> Target EC2 Instance ---> Fetch Data from S3 Bucket. ALB ---> 目标 EC2 实例 ---> 从 S3 存储桶中获取数据。

Based on the above scenario if a user request is always going to route to EC2 Instance and EC2 Instance and S3 are in the same region then is there any need of configuring CloudFront in the flow?基于上述场景,如果用户请求总是要路由到 EC2 实例,而 EC2 实例和 S3 位于同一区域,那么是否需要在流程中配置 CloudFront?

Yes I strongly recommend to use CLoudfront with s3 for your static dat.是的,我强烈建议将 CLoudfront 与 s3 一起用于您的 static dat。

In fact this is one of the primary use case .事实上,这是主要用例之一。 This will also give you advantage not only in terms of latency and cost but also in terms of security because you can choose who can access content from your S3 using OAI ( origin access identity )这不仅会在延迟和成本方面给您带来优势,还会在安全性方面给您带来优势,因为您可以选择谁可以使用 OAI(原始访问身份)从您的 S3 访问内容

If you want to know more and understand how cloudfront can help you here is a dedicated blog from aws on this use case -> https://aws.amazon.com/blogs.networking-and-content-delivery/amazon-s3-amazon-cloudfront-a-match-made-in-the-cloud/如果您想了解更多信息并了解 cloudfront 如何为您提供帮助,请参阅 aws 关于此用例的专门博客 -> https://aws.amazon.com/blogs.networking-and-content-delivery/amazon-s3- amazon-cloudfront-a-match-made-in-the-cloud/

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

相关问题 我应该为我的文件使用 s3 存储桶还是应该只使用我的 ec2 实例 - Should I use an s3 bucket for my files or should I just stick to my ec2 instance AWS S3 存储桶策略应拒绝来自 ec2 的操作 - AWS S3 bucket policy should deny actions from ec2 无法在 AWS 上的 EC2 实例上从 S3 读取 csv 到 pyspark dataframe - Can't read csv from S3 to pyspark dataframe on a EC2 instance on AWS 无法从 EKS EC2 实例上运行的应用程序访问 s3,IAM 承担角色权限问题 - Cannot access s3 from application running on EKS EC2 instance, IAM assume role permissions issue 将文件从 S3 下载到远程 EC2 实例 Windows 的程序 - Program to downloading a file from S3 to remote EC2 Instance of Windows 我如何从特定的 ec2 实例获得对 s3 的 putobject 访问权限 - How can i get putobject access to s3 from specific ec2 instance 从 S3 备份恢复 Ec2(不是 RDS)上的 MariaDB - restore MariaDB on Ec2 (not RDS) from S3 backup Docker EC2中的容器无法通过AWS将数据写入AWS S3 SDK - Docker container in EC2 is unable to write data into AWS S3 through AWS SDK 将特定 S3 托管网站路径路由到 EC2 - Route specific S3 hosted website path to EC2 Cloudfront 的 Cloudformation S3 存储桶主体 - Cloudformation S3 bucket principal for Cloudfront
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM