简体   繁体   中英

AWS Cloudformation stack in all regions

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 .

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.

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.

{
"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)

There are multiple ways of doing it.

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

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

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.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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