Automating AWS resources from the AWS CLI

When I first started with AWS, I created a quick and dirty script to create some AWS resources. I then discovered CloudFormation and never looked at the AWS CLI again apart from the odd command.

Sometimes it’s nice to have a quick way to spin up some resources without using Cloudformation, so I revisited my BASH script and tweaked it to make it more usable and configurable. This shell script will create the following resources in any AWS region:

  • VPC
  • Public and Private Subnets
  • Associated Public and Private Routing Tables
  • Internet Gateway attached to VPC and associated to Public Routing Table
  • Public IP issuance for EC2 instances in the public subnet
  • EC2 keypair
  • Security group and security group rules
  • EC2 instance

The README.md details usage etc. I’d welcome any feedback including bugs etc.

The code can be downloaded from my Github account here – https://github.com/deanflyer/vpc

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.