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.
40
views
Share the link to this page
Copied

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.

Author

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...

School

Niyazi Erdogan's School

Requirements

  • 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
$20
List Price:  $50
You save:  $30
€19.21
List Price:  €48.03
You save:  €28.81
£15.65
List Price:  £39.14
You save:  £23.48
CA$28.65
List Price:  CA$71.64
You save:  CA$42.98
A$32.03
List Price:  A$80.07
You save:  A$48.04
S$27.01
List Price:  S$67.52
You save:  S$40.51
HK$155.41
List Price:  HK$388.54
You save:  HK$233.12
CHF 17.70
List Price:  CHF 44.25
You save:  CHF 26.55
NOK kr225.38
List Price:  NOK kr563.46
You save:  NOK kr338.07
DKK kr143.46
List Price:  DKK kr358.65
You save:  DKK kr215.19
NZ$35.37
List Price:  NZ$88.44
You save:  NZ$53.06
د.إ73.45
List Price:  د.إ183.64
You save:  د.إ110.18
৳2,386.20
List Price:  ৳5,965.51
You save:  ৳3,579.31
₹1,707.95
List Price:  ₹4,269.89
You save:  ₹2,561.93
RM89.74
List Price:  RM224.35
You save:  RM134.61
₦30,911.99
List Price:  ₦77,279.99
You save:  ₦46,367.99
₨5,559.10
List Price:  ₨13,897.76
You save:  ₨8,338.66
฿683.40
List Price:  ฿1,708.50
You save:  ฿1,025.10
₺703.90
List Price:  ₺1,759.76
You save:  ₺1,055.85
B$127.52
List Price:  B$318.81
You save:  B$191.28
R375
List Price:  R937.52
You save:  R562.51
Лв37.60
List Price:  Лв94
You save:  Лв56.40
₩29,145.19
List Price:  ₩72,862.98
You save:  ₩43,717.78
₪72.98
List Price:  ₪182.47
You save:  ₪109.48
₱1,173.20
List Price:  ₱2,933
You save:  ₱1,759.80
¥3,143.49
List Price:  ¥7,858.74
You save:  ¥4,715.24
MX$403.28
List Price:  MX$1,008.21
You save:  MX$604.92
QR72.62
List Price:  QR181.55
You save:  QR108.93
P277.32
List Price:  P693.31
You save:  P415.99
KSh2,580.80
List Price:  KSh6,452
You save:  KSh3,871.20
E£1,016.68
List Price:  E£2,541.70
You save:  E£1,525.02
ብር2,542.43
List Price:  ብር6,356.09
You save:  ብር3,813.65
Kz18,240
List Price:  Kz45,600
You save:  Kz27,360
CLP$19,785.80
List Price:  CLP$49,464.50
You save:  CLP$29,678.70
CN¥145.98
List Price:  CN¥364.95
You save:  CN¥218.97
RD$1,216.34
List Price:  RD$3,040.86
You save:  RD$1,824.52
DA2,702.02
List Price:  DA6,755.06
You save:  DA4,053.03
FJ$46.37
List Price:  FJ$115.93
You save:  FJ$69.55
Q153.81
List Price:  Q384.52
You save:  Q230.71
GY$4,177.68
List Price:  GY$10,444.21
You save:  GY$6,266.53
ISK kr2,791
List Price:  ISK kr6,977.50
You save:  ISK kr4,186.50
DH201.36
List Price:  DH503.41
You save:  DH302.05
L368.41
List Price:  L921.04
You save:  L552.62
ден1,181.86
List Price:  ден2,954.66
You save:  ден1,772.79
MOP$159.74
List Price:  MOP$399.35
You save:  MOP$239.61
N$371.29
List Price:  N$928.23
You save:  N$556.93
C$734.76
List Price:  C$1,836.91
You save:  C$1,102.14
रु2,719.54
List Price:  रु6,798.87
You save:  रु4,079.32
S/74.35
List Price:  S/185.89
You save:  S/111.53
K81.04
List Price:  K202.61
You save:  K121.56
SAR75.10
List Price:  SAR187.75
You save:  SAR112.65
ZK552.61
List Price:  ZK1,381.54
You save:  ZK828.92
L95.68
List Price:  L239.21
You save:  L143.52
Kč483.63
List Price:  Kč1,209.09
You save:  Kč725.45
Ft7,896.53
List Price:  Ft19,741.34
You save:  Ft11,844.80
SEK kr217.64
List Price:  SEK kr544.11
You save:  SEK kr326.46
ARS$20,541.75
List Price:  ARS$51,354.38
You save:  ARS$30,812.63
Bs137.98
List Price:  Bs344.95
You save:  Bs206.97
COP$88,256.15
List Price:  COP$220,640.39
You save:  COP$132,384.23
₡10,138.79
List Price:  ₡25,346.97
You save:  ₡15,208.18
L507.34
List Price:  L1,268.35
You save:  L761.01
₲155,731.08
List Price:  ₲389,327.72
You save:  ₲233,596.63
$U888.82
List Price:  $U2,222.06
You save:  $U1,333.23
zł81.88
List Price:  zł204.71
You save:  zł122.83

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
0
Saves
40
Views
This class has not been saved

Sign Up

Share

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.