Skip to main content

Command Palette

Search for a command to run...

Creating EC2 instance in AWS

Published
โ€ข2 min read
Creating EC2 instance in AWS
S

I am a Blockchain web developer and DevOps enthusiast, pursuing my B.Tech at IIT Hyderabad. I'm an open-source enthusiast. I write, I code, and write about the code.

Creation of an EC2 instance in AWS

We've covered the fundamentals of virtualization and virtual machines, and now it's time to dive into creating our own virtual machines!

There are two approaches to consider when making a virtual machine:

1. ๐Œ๐š๐ง๐ฎ๐š๐ฅ ๐‘๐ž๐ช๐ฎ๐ž๐ฌ๐ญ: We can start by exploring the AWS platform (though the process is similar for other platforms). AWS offers a range of services, each with its own terminology. In AWS, a virtual machine is referred to as an EC2 Instance, and storage is called an S3 instance.

2. ๐—ฆ๐—ฐ๐—ฟ๐—ถ๐—ฝ๐˜ ๐—ฅ๐—ฒ๐—พ๐˜‚๐—ฒ๐˜€๐˜: If we need to create multiple instances, repeating the manual process can be inefficient. This is where scripting comes in. By writing a script, we can automate the instance request process.

AWS provides APIs for various services, including the AWS EC2 Instance. These APIs handle requests and grant access to virtual machines. To generate a response from the API, the request must meet certain criteria:

1. The request needs to be ๐—ฉ๐—ฎ๐—น๐—ถ๐—ฑ, following all the API's standard expectations.
2. The request needs to be ๐—”๐˜‚๐˜๐—ต๐—ผ๐—ฟ๐—ถ๐˜‡๐—ฒ๐—ฑ, meaning the user should have access to AWS.
3. The request needs to be ๐—”๐˜‚๐˜๐—ต๐—ฒ๐—ป๐˜๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐—ฑ, ensuring that the user is authorized to create the EC2 instance.

DevOps Engineer writes a script that interacts with the AWS EC2 API. The script here is a request so it has to abide by the specified criteria.

There are several ways to write the script:

- ๐—”๐—ช๐—ฆ ๐—–๐—Ÿ๐—œ: Using the AWS Command Line Interface.
- ๐—”๐—ช๐—ฆ ๐—”๐—ฃ๐—œ (Python Boto3 module): Leveraging the Python Boto3 module to interact with AWS.
- ๐—”๐—ช๐—ฆ ๐—–๐—™๐—ง: Employing AWS CloudFormation Templates.
- ๐—–๐——๐—ž: Utilizing the AWS Cloud Development Kit.
- ๐—ง๐—ฒ๐—ฟ๐—ฟ๐—ฎ๐—ณ๐—ผ๐—ฟ๐—บ: Leveraging the power of Terraform.

By automating the script, we can make the process faster, more efficient, and error-free.

Join us in the DevOps Learning journey with the hashtags:

#SaiProDevOpsLearning #DevOpsWithSaiPro

S
SaiPro2y ago

Good

S
Spr2y ago

Intresting

K
Kaushik2y ago

Which platform you use for making the cover pages ?

S

Figma

S
Sai2y ago

I got my account suspended for a bill, I didn't deactivate it after using

S
Sri vidya2y ago

I'm following the series dude

S

Tq Vidya

N

Make sure that we deactivate the Instance or else the Amazon will send a hefty bill

S

True

R
RaghaB2y ago

Insightful

S
sai 1872y ago

You should have added some pics dude

N

Yeahhh

S

Will do that

DevOps Learning Series

Part 6 of 17

Learn DevOps basics, principles, and best practices through shared code and open contributions in this informative series.

Up next

Understanding Shell Scripting & Commands

A Shell scripting guide