Automation In AWS
We can categorize automation in DevOps like you use any service that is used to automate things
**what is AWS CLI?**
first, let's look at the use of AWS. How you can use AWS?
1) Web UI:- It’s very simple you will be able to see all the features and you can do whatever you want to Like launch 2–3 instances together.
2) Automation:- We can write customized code in order to do things like using python (SDK) software development kit.
3) AWS CLI:- We launch the instance using command or we do everything we can do on web UI through code.
First, let's see how we can launch an instance using GUI then we will see how can we do it using Command Line
1) Select the AMI that we want to launch
2) Select the type of instance.
3) Select the Number of instances, subnets, and networks.
5) Select the security group
6)Select the key name and launch the instance.
Let’s start with a very basic example of how to launch the AWS instance using our own customized command.
First, you need to install the AWS CLI and you need to configure it. As I am the root user I am making one IAM (identity power management) and creating an IAM user and we will Launch the instance using that credentials.
Install AWS cli
pip install awscli
login by the credentials of IAM created above
So what our required goal is to launch an AWS instance using the Command line. For that, we are required to collect all the information required for launching the instance.
AMI name = amazon Linux
instance type = 12.micro
count = 1
subnet = subnet-88…
Storage root = 8gb
Security group = sg-…..
Key Name = Sample
Now We need to make customized all the things each one represents.
You can use commands like help forward with the thing that you required.
So you can search man pages and make your command So here is the command which can be used to launch the instance.
aws ec2 run-instances
— image-id ami-oe306
— instance-type t2.micro
— count 1
— subnet-id subnet-884872..
— security-group-ids sg-02fb
— key-name sample
So now you are ready with your own command to launch the instance now without using the GUI