所有区域中的AWS Cloudformation堆栈 [英] AWS Cloudformation stack in all regions

查看:263
本文介绍了所有区域中的AWS Cloudformation堆栈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对AWS CloudFormation模板完全陌生,我是python Web开发人员。但是突然间,我的经理要求我(应客户要求)检查-我们是否可以创建通用的AWS CloudFormation模板来为多个账户中的所有区域创建/更新资源

I am totally new to AWS CloudFormation templates, I am a python web developer. 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.

因此,我用Google对其进行了搜索,但对CloudFormation区域映射并没有太多的了解。因为我很难在短时间内完全了解Cloudformation。

So, I googled it but I didn't get much idea about CloudFormation Region Mappings. As its going difficult for me to understand Cloudformation completely in a short time period.

所以,我很好奇吗?

示例:
让我们说一下我必须在所有区域的3个帐户中创建一个S3存储桶。

Example: Let us say if I have to create an S3 bucket in 3 accounts across all the regions.

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

如果可能的话,有人可以指导我吗?如果是这样

Can anyone guide me if that case is possible? If so


  • 可以采取什么方法?

  • 映射模板中的所有区域是否可行?

  • 我们可以使用python的对流层吗?(可选-因为我更喜欢编写代码在python中)

推荐答案

有多种方法。

最简单的方法是使用堆栈集。使用StackSet,您可以跨不同区域创建/管理CloudFormation堆栈。

Easiest way is to use StackSets. Using StackSets, you can create / manage CloudFormation Stacks across different regions.

如果您希望更好地控制部署,则可以使用CloudFormation API在不同区域独立创建堆栈。

If you want to have finer control over the deployments, you can create stacks independently in different regions using CloudFormation APIs.

所有AWS服务的SDK在名为 Boto3 的pip模块中可用。 。我在日常活动中经常使用Boto3和Ansible的这种组合,并且在使用它方面获得了愉快的体验。

SDK for all the AWS Services are available in a pip module called Boto3. 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.

希望这会有所帮助。

这篇关于所有区域中的AWS Cloudformation堆栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆