AWS-Day6-Assignment
What is AWS CLI? Give the procedure to install CLI on Windows and Linux Machines.
The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.
How to Download and Install the AWS CLI for Windows
1. Open your favorite web browser, and visit the AWS CLI page on the Amazon website- https://aws.amazon.com/cli/
2. Navigate to the section labeled Window (right panel), and click the 64-bit hyperlink under Windows to download the latest MSI installer for AWS CLI.
3. Once downloaded, double-click on the MSI installer file to launch the AWS CLI installation wizard
4. Complete the installation process by clicking next and finish.
5. Finally, open Command Prompt as administrator and run the following command to verify the installation was successful.
How to Download and Install the AWS CLI for Linux
Step 1: Download the AWC CLI installation files using curl.
curl "awscli.amazonaws.com/awscli-exe-linux-x86_6.." -o "awscliv2.zip"
Step 2: Unzip the files. Ensure you have
unzip
utility installed on your system.unzip awscliv2.zip
Step 3: Install aws-cli using the following command.
sudo ./aws/install
The above command creates a symlink named
aws
in the/usr/local/bin
directory and adds the AWS CLI executable to the to/usr/local/aws-cli
location.Step 4: Verify the installation by checking the AWS CLI version.
aws --version
Create an EC2 instance using CLI for the below specifications.
a) Amazon Linux AMI, Keypair, VPC and Subnet, with an EIP attached to it.
b) Give the command to create an EC2, and show the same on AWS Console.
Give the command to describe all the EC2 instances in your AWS Account.
aws ec2 describe-instances
Give the command to describe a Security Group that is already created in your account.
aws ec2 describe-security-groups --group-ids sg-903004f8
What is AWS CloudFormation? What are the benefits of AWS CloudFormation?
AWS CloudFormation is a service that helps you model and set up your AWS resources so that you can spend less time managing those resources and more time focusing on your applications that run in AWS. You create a template that describes all the AWS resources that you want (like Amazon EC2 instances or Amazon RDS DB instances), and CloudFormation takes care of provisioning and configuring those resources for you. You don't need to individually create and configure AWS resources and figure out what's dependent on what; CloudFormation handles that.
Benefits of AWS CloudFormation
Reduced time spent on resource management
Increased efficiency and consistency
Infrastructure as code
Improved collaboration and documentation
Easy updates
Auditing and change management
Security
What is Infrastructure as Code and its Benefits?
Infrastructure as Code (IaC) is the managing and provisioning of infrastructure through code instead of through manual processes. With IaC, configuration files are created that contain your infrastructure specifications, which makes it easier to edit and distribute configurations.
Benefits
Consistent configurations.
Decreased risk.
Stronger security & faster recovery.
Faster deployment.
Improved accountability.
Increased operational efficiency.
Financial savings.
What is AWS CloudFormation Template?
AWS CloudFormation simplifies provisioning and management on AWS. You can create templates for the service or application architectures you want and have AWS CloudFormation use those templates for quick and reliable provisioning of the services or applications (called “stacks”). You can also easily update or replicate the stacks as needed.
Using CloudFormation(YAML templates) create an EC2 instance in an existing VPC and Subnet. Identify details of Events and Resources created on CloudFormation.
Using CloudFromation create a new VPC, Public and Private Subnet, Route tables.
Using CloudFormation (JSON templates) create an EC2 instance in an existing VPC and subnet.