[python]Start up script to create VPC to launch EC2

Use case This is an interactive start up script to do from creating VPC to launching EC2. This is a follow up from this post – Functions for aws automation, I have added a few more functions to make it complete. Demonstration This is the interactive script: These are the results in AWS console: VPC … Continue reading [python]Start up script to create VPC to launch EC2

Link: http://cyruslab.net/2019/05/11/pythonstart-up-script-to-create-vpc-to-launch-ec2/

[python]Creating security group and inbound rule

This is the extension of Functions of aws automation.I have added some methods to create security groups and apply rules. In addition to the functions/methods describe here, I have created 4 more methods to accomplish these: Security group creation Inbound rule creation to the security group. Demonstration create_security_group method This method create a security group … Continue reading [python]Creating security group and inbound rule

Link: http://cyruslab.net/2019/05/08/pythoncreating-security-group-and-inbound-rule/

[python]Finding your internet gateway id in aws

On previous post, I have this function: This function looks for the internet gateway id associated with your vpc id. Json response from describe_internet_gateways The below response is from the describe_internet_gateways method in boto3, here’s the code snippet: The below is a dictionary of two main keys – InternetGateways and ResponseMetadata. Now I am only … Continue reading [python]Finding your internet gateway id in aws

Link: http://cyruslab.net/2019/05/06/pythonfinding-your-internet-gateway-id-in-aws/

[python]Creating subnets based on VPC you have chosen

Background I am trying to test a few functions of my script for things that can be done after VPC was created. Things such as make subnet either public or private, attach IGW to route table. I have build up some general purpose functions so that I do not need to repeat the same thing … Continue reading [python]Creating subnets based on VPC you have chosen

Link: http://cyruslab.net/2019/05/06/pythoncreating-subnets-based-on-vpc-you-have-chosen/

[python]Get VPC ID

I am looking for a solution to get the vpcid so that i can start another script to add routes and subnets for the chosen vpc. See this post, which makes the below code possible. Results The json structure after the filter was applied The above json output is a list of two dictionaries. First … Continue reading [python]Get VPC ID

Link: http://cyruslab.net/2019/05/05/pythonget-vpc-id/

[python]Create VPC part 2

Background This post is an improvement to this. The goal is to: Create VPC. Create internet gateway. Attach internet gateway to vpc. Name the internet gateway and vpc. About parameters in create_tags This method accepts Resources of type list or tuple. Tags of type dictionary. The code works but is ugly and cannot scale, for … Continue reading [python]Create VPC part 2

Link: http://cyruslab.net/2019/05/05/pythoncreate-vpc-part-2/

[python]Naming the VPC

Background This is a follow up on previous post. The create_vpc does not have a parameter to name the VPC, instead another method create_tags is required for naming the VPC. From the documentation the create_tags takes in two arguments: Resources argument which is a list, in this context VPC id is the resource. Tags argument … Continue reading [python]Naming the VPC

Link: http://cyruslab.net/2019/05/05/pythonnaming-the-vpc/

[python]Create AWS VPC with boto3

Background This is a follow up on this post https://cyruslab.net/2018/10/19/pythontrying-out-aws-sdk/ back then I was only trying out… However I am beginning to take this seriously… as a hobby… Pre-requisites Setup awscli. The awscli is used to setup a default connection, by putting your access key id and secret key id, your preferred region and your … Continue reading [python]Create AWS VPC with boto3

Link: http://cyruslab.net/2019/05/05/pythoncreate-aws-vpc-with-boto3/