0
votes

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)
1
stackset is what you're searching for aws.amazon.com/blogs/aws/… - Shachaf.Gortler

1 Answers

6
votes

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.