简体   繁体   English

所有区域中的AWS Cloudformation堆栈

[英]AWS Cloudformation stack in all regions

I am totally new to AWS CloudFormation templates, I am a python web developer. 我对AWS CloudFormation模板完全陌生,我是python Web开发人员。 But suddenly my manager asked me (on client's requirement) to check if - can we create a generic AWS CloudFormation template to create/update resources for all the regions across multiple accounts . 但是突然间,我的经理要求我(应客户要求)检查是否- 我们可以创建通用的AWS CloudFormation模板来为多个账户中的所有区域创建/更新资源

So, I googled it but I didn't get much idea about CloudFormation Region Mappings. 因此,我在Google上进行了搜索,但是对CloudFormation区域映射并没有太多的了解。 As its going difficult for me to understand Cloudformation completely in a short time period. 因为我很难在短时间内完全了解Cloudformation。

So, I'm curious is it possible? 所以,我很好奇,可能吗?

Example: Let us say if I have to create an S3 bucket in 3 accounts across all the regions. 示例:假设我必须在所有区域的3个帐户中创建一个S3存储桶。

{
"Resources" : {
    "some-bucket" : {
       "Type" : "AWS::S3::Bucket"
       }
    }
}

Can anyone guide me if that case is possible? 如果可能的话,有人可以指导我吗? If so 如果是这样的话

  • What can be the approach? 有什么办法?
  • Mapping all the regions in template would work? 在模板中映射所有区域会起作用吗?
  • Can we do it using python's troposphere?(Optional - As I would prefer to write the code in python) 我们可以使用python的对流层吗?(可选-因为我更喜欢用python编写代码)

There are multiple ways of doing it. 有多种实现方法。

Easiest way is to use StackSets . 最简单的方法是使用StackSets Using StackSets, you can create / manage CloudFormation Stacks across different regions. 使用StackSet,您可以跨不同区域创建/管理CloudFormation堆栈。

If you want to have finer control over the deployments, you can create stacks independently in different regions using CloudFormation APIs. 如果要更好地控制部署,则可以使用CloudFormation API在不同区域中独立创建堆栈。

SDK for all the AWS Services are available in a pip module called Boto3 . 用于所有AWS服务的SDK在称为Boto3的pip模块中可用 I have used this combination of Boto3 and Ansible a lot in my day-to-day activities and I had a pleasant experience using it. 我在日常活动中经常使用Boto3和Ansible的这种组合,并且在使用它方面获得了愉快的体验。

Hope this helps. 希望这可以帮助。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM