Import the default route table for a VPC into CloudFormation | by Teri Radichel | Cloud Security | December 2023

esteria.white

ACM.425 Using CreateChangeSet to import existing resources into your CloudFormation stacks

Part of my series on Automation of cybersecurity measures. AWS Organizations. I AM. Deploy a static website. THE Coded.

Free content on Cybersecurity Jobs | Register at Broadcast list

In the last article I briefly explored a feature announced at the last AWS re:Invent conference but I’m not sure if it works or even if and when it does, if it will meet my needs for what I will do in this post.

When you create a VPC, it has a route table and security group by default. I wish that wasn’t the case. I wish you could add them yourself with CloudFormation in a separate template after creating the VPC.

But maybe we could import them.

I showed how to import an existing organization into CloudFormation in this article.

Perhaps we can use similar code for the purpose of this article.

What I did was take my previous code for an AWS organization and converted it into a reusable function.

I replace all hardcoded variable values ​​for my organization with the passed parameters.

I created this common resource import function in:

/deploy/shared/functions.sh

This is what it looks like:

I fixed an issue above: making the category and resource type lowercase on final call.

I explained all of the above in more detail in my previous article on importing the organization. Read this article if you are unfamiliar with the code above.

This just shows you how I took this code and transformed it into a reusable function in my shared functions file.

Leave a comment