amazon-web-services - 为 S3 存储桶中的特定文件夹创建 CloudFormation 堆栈

标签 amazon-web-services amazon-s3 aws-cloudformation

我使用云形成服务尝试了图像调整大小功能。创建堆栈时要求选择我们的 s3 存储桶。创建堆栈后,它给出了 cloud-front ApiEndpoint 但它是从 s3 存储桶的根目录给出的。

例如: s3存储桶路径:https://surathbucket1.s3.ap-south-1.amazonaws.com/png.png

堆栈的云前端路径:https://d1njf1ibm6jv3d.cloudfront.net/png.png

我需要为 s3 存储桶中的特定文件夹而不是根目录创建堆栈。

例如: s3存储桶路径:https://surathbucket1.s3.ap-south-1.amazonaws.com/test/png.png

堆栈的云前端路径:https://d1njf1ibm6jv3d.cloudfront.net/png.png

我使用此模板来创建堆栈 https://docs.aws.amazon.com/solutions/latest/serverless-image-handler/template.html

谁知道答案请帮帮我。谢谢

最佳答案

S3 中不存在文件夹这样的对象类型。只有一个对象本身,其前缀为例如 test/。因此,在您的情况下,对象的名称应该是 test/png.png

查看文档:https://docs.aws.amazon.com/AmazonS3/latest/user-guide/using-folders.html

关于amazon-web-services - 为 S3 存储桶中的特定文件夹创建 CloudFormation 堆栈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64249486/

相关文章:

amazon-web-services - Docker 容器似乎是 'inherit' 主机 ec2 的实例配置文件。如何?

amazon-web-services - 连接被拒绝 : Server unavailable in Solace broker even after increase the Connection Scaling Tier

amazon-web-services - AWS 自动扩展

python-3.x - 从 lambda 函数调用 cloudformation

amazon-web-services - 将授权添加到使用 amplify cli 创建的函数

amazon-web-services - TypeError : Unable to modify PDF file, 确保输出文件目标可用且不 protected

json - 以 json 漂亮格式检索 aws s3 存储桶策略

amazon-web-services - 无法使用 boto3 执行 s3 复制

amazon-web-services - 在 AWS S3 受让人列表中添加所有者名称

amazon-web-services - 重用现有资源作为cloudformation中的参数