Creating EC2 instance in AWS

Creating EC2 instance in AWS

ยท

2 min read

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

Did you find this article valuable?

Support Sai Prajoth's blog by becoming a sponsor. Any amount is appreciated!

ย