Author Archives: cyruslab

[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 … Continue reading

Posted in Python, Scripting | Tagged , , , , , | Leave a comment

[python] Functions for aws automation

This post is a documentation of the functions/methods in the python script that will help to automate the AWS. Declaration The filter can be found in Automated Ramblings. Resource connection This function connects to the resource based on the one … Continue reading

Posted in Python, Scripting | Tagged , , , , , , | 1 Comment

[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 … Continue reading

Posted in Python | Tagged , | Leave a comment

[python]Check if subnet is within the range of a supernet

See this reference. I have found something really cool about the ipaddress module. I have a use case to help requester to decide which subnets to use. So here’s the thing…

Posted in Python, Scripting | Tagged | Leave a comment

[python]Update a list to a dictionary

the code below enumerate the list of vpc-id and make them into dictionary, the purpose is to make use of this dictionary to give a menu option for user.

Posted in Python | Tagged , | Leave a comment

[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 … Continue reading

Posted in Python | Tagged , , | Leave a comment

[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 … Continue reading

Posted in Python, Scripting | Tagged , , , , , | Leave a comment