Managing EC2 and VPC: AWS with Python and Boto3 Series

Learn how to implement EC2 and VPC resources on AWS using Python API and Boto3.

Managing EC2 and VPC: AWS with Python and Boto3 Series

Learn how to implement EC2 and VPC resources on AWS using Python API and Boto3.
Share the link to this page

About the Class

Do you want to learn how to implement VPC and EC2 resources with Python code on AWS? Do you want to launch EC2 Instances with Python code on AWS? Are you preparing for the AWS Solutions Architect Associate Exam and want to put your theory and skills into practice with VPC and EC2? This is the course for you.

In this course, we’ll start by taking a look at the tools and the environment that we need to work with AWS resources. We’ll be using Python 3 and as per the IDE I recommend you use PyCharm from Jetbrains. It has a free community edition even.

After I teach you how you can set up your environment on both macOS and Windows, we’ll create our credentials for AWS as being the AWS Access Key and AWS Secret Access Key for programmatic access to AWS resources. You’ll learn how you can set your AWS credentials globally on your computers using AWS CLI. Before jumping into the implementation, for one last tip, I’ll show you how you can have auto-complete capabilities on your PyCharm IDE with PyBoto3.

Once we’re ready with our environment setup, we’ll start implementing our solution on AWS. And remember we’ll do everything with Python code; not a single thing manually or by hand. We’ll start by creating a VPC. For our own VPC, we’ll provide CIDR IP block to isolate our resources within that VPC.

Then we will create two subnets; Public and Private. The public subnet will be where we will put our internet-facing resources like public EC2 instances and we will definitely launch an EC2 instance in it. To achieve this, we will create an internet gateway or IGW and attach it to our VPC. But of course, that is not enough. We will create a route table for public routes over the internet and also add our internet gateway to the route table to allow internet access to our public EC2 instance. We will also not forget to associate our public subnet with this public route table so it can be exclusively used by the public subnet and its subresources. And finally, we will modify our public subnet so it can automatically assign public IP addresses to the resources we will launch within this public subnet. That's the way we are going to achieve internet access to and from our public EC2 instance and again we will do all of that with our Python code.

Besides, we will create a private subnet for our internal resources like a private EC2 instance which will only be accessible through the private or public subnet; not open to the world. To achieve this, we will associate our default route table with our private subnet and then we will not add our internet gateway to this route table so it will basically not have any internet access. We will also not enable auto-assign public IP addresses on private subnet which is disabled by default. That's basically how we are going to disable internet traffic on our private EC2 instance again we will do all this with our Python code.

We will not stop there of course so before we launch our public EC2 instance, we will develop a startup bash script to automatically run when we launch our EC2 instance. In this script, we will first update our packages with yum package manager so we can stay up-to-date with the latest updates and security patches. Then we will install an HTTP server on it and make sure it's working by a startup check command. After we prepare our HTTP server, we will develop a simple HTML page as a greeting and we will write this page to disk to be served when we try to access our public EC2 instance. And remember, we will again do all of this with our Python code.

After finishing up launching our EC2 instances, we'll move on to learn how to describe EC2 instances on AWS in a detailed way; from their IP addresses to the subnet which they belong to. Then we'll learn how to manage EC2 instances in various ways. We'll stop, start and terminate EC2 instances and again the best part is we will do all of that with our Python code.

Lots of information, hands-on practice, and experience is waiting for you in this course on AWS. So, don't miss any more time and join me in this course to sharpen your skills on AWS using Python and Boto3.


Niyazi Erdogan

AWS Certified Solutions Architect, Software Engineer
Hi, I'm Niyazi Erdoğan. I'm a software engineer and AWS Certified Solutions Architect with over ten years of experience in various fields. I'm living in one of the most beautiful cities in the world, Istanbul. I'm a self-taught programmer and I've been programming since I was in middle-school. My experience ranges from embedded development to...


Niyazi Erdogan's School


  • You should have knowledge of Python at beginner level
  • You should have any Python Interpreter (default is fine but I recommend PyCharm)
  • You should have an AWS account (free tier available)

Class Contents

One-time Fee
List Price:  $50
You save:  $30
List Price:  €46.89
You save:  €28.13
List Price:  £40.42
You save:  £24.25
List Price:  CA$68.77
You save:  CA$41.26
List Price:  A$77.93
You save:  A$46.75
List Price:  S$68.06
You save:  S$40.83
List Price:  HK$391.57
You save:  HK$234.94
CHF 18.21
List Price:  CHF 45.52
You save:  CHF 27.31
NOK kr220.35
List Price:  NOK kr550.89
You save:  NOK kr330.53
DKK kr140.03
List Price:  DKK kr350.09
You save:  DKK kr210.05
List Price:  NZ$84.91
You save:  NZ$50.95
List Price:  د.إ183.63
You save:  د.إ110.18
List Price:  ৳5,475.37
You save:  ৳3,285.22
List Price:  ₹4,168.52
You save:  ₹2,501.11
List Price:  RM239.20
You save:  RM143.52
List Price:  ₦64,850
You save:  ₦38,910
List Price:  ₨13,884.68
You save:  ₨8,330.81
List Price:  ฿1,840.02
You save:  ฿1,104.01
List Price:  ₺1,624.28
You save:  ₺974.56
List Price:  B$260.15
You save:  B$156.09
List Price:  R964.74
You save:  R578.84
List Price:  Лв91.64
You save:  Лв54.98
List Price:  ₩68,724.75
You save:  ₩41,234.85
List Price:  ₪188.05
You save:  ₪112.83
List Price:  ₱2,878.64
You save:  ₱1,727.18
List Price:  ¥7,731.25
You save:  ¥4,638.75
List Price:  MX$855.02
You save:  MX$513.01
List Price:  QR182.03
You save:  QR109.22
List Price:  P692.93
You save:  P415.76
List Price:  KSh6,560.60
You save:  KSh3,936.36
List Price:  E£2,416.50
You save:  E£1,449.90
List Price:  ብር2,834.76
You save:  ብር1,700.85
List Price:  Kz41,850
You save:  Kz25,110
List Price:  CLP$47,619.04
You save:  CLP$28,571.42
List Price:  CN¥361.96
You save:  CN¥217.17
List Price:  RD$2,968.75
You save:  RD$1,781.25
List Price:  DA6,729.65
You save:  DA4,037.79
List Price:  FJ$113.87
You save:  FJ$68.32
List Price:  Q388.03
You save:  Q232.81
List Price:  GY$10,438.11
You save:  GY$6,262.87
ISK kr2,825
List Price:  ISK kr7,062.50
You save:  ISK kr4,237.50
List Price:  DH505.42
You save:  DH303.25
List Price:  L895.50
You save:  L537.30
List Price:  ден2,887.16
You save:  ден1,732.29
List Price:  MOP$402.51
You save:  MOP$241.50
List Price:  N$958.63
You save:  N$575.18
List Price:  C$1,848
You save:  C$1,108.80
List Price:  रु6,663.55
You save:  रु3,998.13
List Price:  S/186.14
You save:  S/111.68
List Price:  K190.02
You save:  K114.01
List Price:  SAR187.57
You save:  SAR112.54
List Price:  ZK1,280.96
You save:  ZK768.57
List Price:  L233.47
You save:  L140.08
List Price:  Kč1,184.97
You save:  Kč710.98
List Price:  Ft18,496.50
You save:  Ft11,097.90
SEK kr218.27
List Price:  SEK kr545.68
You save:  SEK kr327.40
List Price:  ARS$43,562.50
You save:  ARS$26,137.50
List Price:  Bs345.48
You save:  Bs207.29
List Price:  COP$195,993.62
You save:  COP$117,596.17
List Price:  ₡25,055.05
You save:  ₡15,033.03
List Price:  L1,231.71
You save:  L739.02
List Price:  ₲369,103.14
You save:  ₲221,461.88
List Price:  $U1,919.71
You save:  $U1,151.82
List Price:  zł202.24
You save:  zł121.34

What's Included

Language: English
Level: All levels
Skills: Subnets, VPCs, AWS, EC2 Instances, Boto3, Python, EC2
Age groups: All ages
Duration: 4 hours 31 minutes
59 Videos
24 Documents
This class has not been saved

Sign Up


Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.