【问题标题】:AWS Cloudformation Template - Set Region in S3 BucketAWS Cloudformation 模板 - 在 S3 存储桶中设置区域
【发布时间】:2017-01-28 00:00:37
【问题描述】:

我正在尝试在特定区域 (us-west-2) 创建一个 s3 存储桶。 使用 Cloudformation 模板似乎无法做到这一点。 有任何想法吗?我没有使用我读到的 service-region-hash 约定明确命名它。

 Template:
 {
     "AWSTemplateFormatVersion": "2010-09-09",
     "Resources": {
       "S3Bucket": {
         "Type": "AWS::S3::Bucket",
         "Properties": {
           "AccessControl": "PublicReadWrite",
         }
       }
     },
     "Outputs": {
       "BucketName": {
         "Value": {
           "Ref": "S3Bucket"
         },
         "Description": "Name of the sample Amazon S3 bucket with a lifecycle configuration."
       }
     }
   }

【问题讨论】:

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


    【解决方案1】:

    如果您想在特定区域创建 s3 存储桶,您需要从该区域运行 Cloudformation JSON 模板。

    cloudFormation 的端点 URL 基于区域(https://aws.amazon.com/cloudformation/faqs/?nc1=h_ls#regionshttp://docs.aws.amazon.com/general/latest/gr/rande.html#cfn_region),您不能像今天那样交叉检查区域。

    我看到它已经在 aws 支持线程上讨论过几次,所以将来可能会做一些事情

    存储桶是在 1 个区域内创建的,当您需要访问它时,您需要将该区域传递给 s3 端点。

    如果您想启用跨区域复制,您可以使用 ReplicationConfiguration 属性从云形成模板中执行此操作

    【讨论】:

    • 谢谢@frédéric-henri。因此,为了进行跨区域复制,操作是将其放入脚本运行器并将其分解为两个模板。
    • 好吧,没有跨区域复制是另一回事 - 它是 Json 的可用属性 - 请参阅编辑
    • 据我所知,json 的可用属性实际上并没有设置角色和存储桶。我试图加载 json 并得到 bucket must already exist 错误。似乎这只是 api 管理的指导。
    猜你喜欢
    • 2021-05-06
    • 2018-04-22
    • 2020-03-03
    • 1970-01-01
    • 2021-09-23
    • 1970-01-01
    • 2021-08-08
    • 2020-01-17
    • 2023-04-11
    相关资源
    最近更新 更多