TOP 50 Interview Questions on AWS Cloud Computing Services -EC2
1. What Is Amazon Ec2 Service ?
Amazon Elastic Compute Cloud (Amazon EC2) is an Amazon web service that provides resizable (scalable) computing capacity in the cloud. You can use Amazon EC2 to launch as many virtual servers you would like . In Amazon EC2 you’ll configure security and networking also as manage storage.Amazon EC2 service also helps in obtaining and configuring capacity using minimal friction.
2. What Are The Security Best Practices For Amazon Ec2 ?
For secure Amazon EC2 best practices, follow the subsequent steps:
- Use AWS identity and access management to regulate access to your AWS resources
- To access ports on your instance, restrict access by allowing only networks and trusted hosts
- Review the rules in your security groups regularly
- Only open up permissions that your require
- Disable password-based login, as an example , launched from your AMI Complete Amazon Web Services Tutorials
3. Explain Stopping, Starting, And Terminating An Amazon Ec2 Instance ?
Stopping and Starting an instance: When an instance is stopped, the instance performs a traditional shutdown then transitions to a stopped state. All of its Amazon EBS volumes remain attached, and you’ll start the instance again at a later time. You are not charged for extra instance hours while the instance is during a stopped state.
Terminating an instance: Instance performs a traditional shutdown, when an instance is terminated, then the Amazon EBS attached volumes are also deleted unless the volumes delete OnTermination attribute is about to false. The instance itself is additionally deleted, and you can’t start the instance again at a later time.
4. What Are Regions And Availability Zones In Amazon Ec2 ? Explain In Brief ?
Amazon EC2 is hosted in multiple locations world-wide. These locations are composed of Availability Zones and regions. Each region is a separate geographic area. Each region has multiple, isolated locations referred to as Availability Zones.
Each region is completely independent. Each Availability Zone is isolated, but the supply Zones during a region are connected through low-latency links. The following diagram illustrates the connection between regions and Availability Zones.
5. Explain How To Launch Ec2 Instance In An Availability Zone ?
Each region is totally independent and every Availability Zone is isolated. When you view your resources, you’ll only see the resources tied to the region you’ve got specified.
To launch an EC2 instance, you must select an AMI that’s in the same region (if the AMI is in another region then you can copy the AMI to the region you are using). Now choose an Availability Zone or let AWS for you. After creating the EC2 instance, it will show up in the selected Availability Zone.
6. What Is Amazon Ec2 Root Device Volume ?
When you launch an instance, the basis Device Volume contains the image wont to boot the instance.
- You can launch an instance from one among two sorts of AMIs:
- Instance store-backed AMI
- EBS based storage
7. What Is The Security Group In Amazon Ec2 ?
It acts as a firewall for associated instances, controlling both inbound and outbound traffic at the instance level.
8. What Are The Features Of Security Groups In Amazon Ec2 ?
Following are the features of the safety Group in Amazon EC2:
- We can add rules to a security group that enable us to attach to our instance from our IP address using SSH.
- Also add rules that allow outbound and inbound HTTP and HTTPS access from anywhere.
9. How To Create a Security Group In Amazon Ec2 ?
We can create a Security Group in Amazon EC2 using the Amazon EC2 console. To launch instances in multiple regions, we’ll have to create a Security Group in each region.
Following are the steps to make Security Group in Amazon EC2:
- Open the Amazon EC2 console.
- From the left navigation bar, select a neighborhood for the safety group.
- Click Security Groups in the navigation pane.
- Click Create Security Group.
- Enter a reputation for the new security group and an outline .
- In the VPC list, select your VPC.
- On the Inbound tab, click Add Rule for every new rule, then click Create.
10. How To Launch An Amazon Ec2 Instance ?
We can launch Linux/Windows Amazon EC2 instances using AWS Management Console.
Following are the steps to make Amazon EC2 instance:
- Open the Amazon EC2 console.
- From the console dashboard, choose Launch Instance.
- Choose an Amazon Machine Image (AMI).
- Choose an Instance Type.
- Click on Review and Launch to let the wizard complete the opposite configuration setting.
- Under Security Groups select a Security Group, on the Review Instance Launch page.
- Click on Launch on the Review Instance Launch.
- Select an Existing key pair when it prompts for a key pair.
- Click on View Instance to return to the console to see the instance is launching.
11. How To Connect To Your Amazon Ec2 Instance ?
There are several ways to attach to a Linux instance. One of the commonly used methods is to connect Linux instances from Windows local machines using PuTTY.
Following are the steps to attach to a Linux instance:
- Install PuTTY on your local machine.
- Get your instance ID.
- Get the public DNS name of the instance.
- Locate the private key.
- From your IP address to your instance enable inbound SSH traffic.
- Converting Your Private Key Using PuTTYgen.
- Starting a PuTTY Session.
- Now you are connected to your EC2 instance.
12. How To Add A Ebs Volume To Your Amazon Ec2 Instance ?
We can attach an EBS volume to at least one of our instances that’s within the same Availability Zone because the Volume.
Following are the steps to attach an EBS volume to an instance using console:
- Open the Amazon EC2 console.
- In the left navigation pane, choose Volumes.
- Select a volume and choose Attach Volume.
- Select the instance to which you would like to connect the quantity .
- Click on Attach.
- Now hook up with your instance and make the quantity available.
13. How To Clean Up Your Amazon Ec2 Instance And Volume ?
After we are finished with the instance we created, we can clean up by terminating the instance.
Below are the steps to terminate the EC2 instance:
- In the navigation pane, choose Instances. In the list of instances, select the instance.
- Choose Actions, then Instance State, then choose Terminate.
- Choose Yes,Terminate when prompted for confirmation.
14. What Are The Best Practices For Amazon Ec2 ?
To get the utmost enjoyment and satisfaction with Amazon EC2.
There are mainly four best practices:
- Security and Network Best Practices
- Storage
- Resource Management
- Backup and Recovery
15. What Is Amazon Machine Image And What Is The Relation Between Instance And Ami ?
Amazon Web Services provides several ways to access Amazon EC2, like web-based interface, AWS instruction Interface (CLI) and Amazon Tools for Windows Powershell. First, you would like to check in for an AWS account and you’ll access Amazon EC2.
Amazon EC2 provides a Query API. These requests are HTTP or HTTPS requests that use the HTTP verbs GET or POST and a question parameter named Action.
16. What Is Amazon Machine Image (ami) ?
An Amazon Machine Image (AMI) may be a template that contains a software configuration (for example, an OS , an application server, and applications). From an AMI, we launch an instance, which may be a copy of the AMI running as a virtual server within the cloud. Even we can launch multiple instances of an AMI.
17. What Is The Relation Between Instance And Ami ?
We can launch differing types of instances from one AMI. Instance type essentially determines hardware of the host computer which is used for your instance. Each instance type offers different memory and compute capabilities.
After we launch an instance, it’s sort of a traditional host, and that we can interact with it as we might do with any computer. We have complete control of our instances; we will use sudo to run commands that need root privileges.
18. How To Migrate An Instance To Another Availability Zone ?
You can migrate your EC2 instance from one Availability Zone to a different one .
Following are the steps to migrate an Instance to a different Availability Zone:
- Create an AMI from the running instance
- Launch an instance from the AMI that you simply just created, specify the new Availability Zone
- You can use an equivalent instance type because the original instance, or select a replacement instance type
- If the first instance has an associated Elastic IP address, then associate it with the new instance
- If the first instance may be a Reserved Instance, change the supply Zone for your reservation
19. What Is a Key Pair ?
To secure the login information for your instance AWS uses public-key cryptography. A Linux instance has no password; you employ a key pair to log in to your instance securely.
You specify the name of the key pair once you launch your instance, then provide the private key once you log in using SSH.
20. How To Create Key Pair ?
Using the Amazon EC2 console we can create one . To launch instances in multiple regions, we’ll have to create a key pair in each region.
Following are the steps to create Key Pair:
- Sign in to Amazon Web Service.
- Choose EC2 to open the Amazon EC2 console, from the AWS dashboard.
- From the navigation bar, select a neighborhood for the key pair.
- Click Key Pairs, In the left navigation pane, under NETWORK & SECURITY.
- Click Create Key Pair.
- Enter a reputation for the new key pair within the Key pair name field of the Create Key Pair panel , then click Create.
- Automatically The private key file was downloaded by your browser. The base file name is the name you specified because the name of your key pair, and therefore the file name extension is .pem.
21. What Is The Use Of Key Pair ?
Key pair is employed to log in to your instance securely. To secure the login information for your instance this is public-key cryptography.
22. How You’re Charged In Amazon Ec2? Explain In Detail ?
Charges vary upon AMIs backed and storage volumes.
- Instance storage is charged for: AMI storage + Instance usage
- AMIs backed by Amazon EBS storage charged for: Volume storage + Usage additionally to the AMI + instance usage
- When an Amazon EBS-backed instance is stopped, you’re not charged as an example usage, but you’re still charged for volume storage.
- AWS charges a full instance hour for each transition from a stopped state to a running state, albeit we transition the instance multiple times within one hour.
23. What Is The Size Limit For Amazon Ec2 Instance Store-backed Amis And Amazon Ebs-backed Amis ?
All AMIs are categorized as either backed by Amazon EBS or backed by instance stores.
Backed by Amazon EBS – means the basis device for an instance launched from the AMI is an Amazon EBS volume created from an Amazon EBS snapshot.
Backed by instance store – means the basis device for an instance launched from the AMI is an instance store volume created from a template stored in Amazon S3.
Amazon EBS – Backed is 16 TiB
Amazon Instance Store- Backed is 10 GiB
24. Can S3 Be Used With Ec2 Instances, If Yes, How ?
Yes, it is often used for instances with root devices backed by local instance storage. By using Amazon S3, developers have access to an equivalent highly reliable, scalable, fast, inexpensive data storage that Amazon uses to run its own global networks. Developers use the tools provided to load their Amazon Machine Images into Amazon S3 and to maneuver them between Amazon S3 and Amazon EC2, In order to execute systems within the Amazon EC2 environment.
Another use case might be for websites hosted on EC2 to load their static content from S3.
25. If you would like To Launch Amazon Elastic Compute Cloud (ec2) Instances And Assign Each Instance A Predetermined Private Ip Address you ought to ?
The best way of connecting to your cloud resources (for ex- ec2 instances) from your own data center (for eg- private cloud) may be a VPC. During which your instances are present once you connect your datacenter to the VPC, each instance is assigned a personal IP address which may be accessed from your datacenter. Hence, you’ll access your public cloud resources, as if they were on your own network.
26. Explain What Happens once you Reboot An Ec2 Instance ?
Rebooting an instance is like rebooting a PC. The hard disc isn’t affected. The contents of the hard disks are those before the reboot, you don’t return to the image’s original state.
Rebooting isn’t related to billing. Billing starts once you instantiate a picture and stops once you terminate it. Rebooting in between hasn’t any effect.
27. What Are Spot Instances In Amazon Ec2 ?
In Amazon EC2, we will even bid for getting a computing instance. Any instance procured by bidding may be a Spot Instance. Multiple users bid for an EC2 Instance. Once the price exceeds the cash price , the user with the very best bid gets it. As long as their price remains above the cash price , they will keep using it.
Spot price varies with the availability and demand. Once cash price exceeds price , the instances are going to be taken back from the user.
28. What Are the Most Features Of Classic Load Balancer In Ec2 ?
Some of the most features of Classic Load Balancer (CLB) in Amazon EC2 are as follows:
Health Check: supported the results of checkup , Classic Load Balancer can plan to route the traffic. If any instance has unhealthy results, CLB won’t route the traffic thereto instance.
Security: we will create security groups for CLB in Virtual Private Cloud (VPC). With these features, it’s easy to implement secure load balancing within a network.
High Availability: With CLB, we will distribute traffic among EC2 instances in single or multiple Availability Zones. This helps in providing a really high scale of availability for the incoming traffic.
Sticky Sessions: CLB also supports sticky sessions by using cookies. The sticky sessions confirm that the traffic from a user is usually routed to an equivalent instance in order that the user gets a seamless experience.
IPv6: CLB also supports Internet Protocol version 6.
Operational Monitoring: we will also perform operational monitoring CLB and collect statistics for the asking count, latency etc. These metrics are often monitored in CloudWatch.
29. What Are the most Features Of Application Load Balancer (alb) In Amazon Ec2 ?
Below are the some of the Main features of Application Load Balancer (ALB):
Content-Based Routing: In ALB, we will make use of content within the request to make a decision about the routing of an invitation to a selected service.
HTTP/2: ALB supports the remake of HTTP protocol. during this protocol, we will send multiple requests on an equivalent connection. It also supports TLS and header compression.
WebSockets: ALB supports WebSockets in EC2. A server can exchange real-time messages with the end-users with WebSockets.
Layer-7 Load Balancing: ALB also can load balance HTTP/HTTPS application with layer-7 specific features.
Delete Protection: ALB also provides a Delete Protection option by which we will prevent it from getting deleted by mistake.
Containerized Application Support: we will use ALB to load balance multiple containers across multiple ports on an equivalent EC2 instance.
30. What’s A Placement Group In Ec2 ?
AWS provides an option of making a Placement Group in EC2 to logically group the instances within one Availability Zone.
We get the advantages of low network latency and high network throughput by employing a Placement Group.
Placement Group may be a free option as of now. once we stop an instance, it’ll run within the same Placement Group and restart at a later point of your time .
The biggest limitation of Placement Group is that we cannot add Instances from multiple availability zones to at least one Placement Group.
31. What Types Of Issues Do You Face While Connecting To An Ec2 Instance ?
Below are the some of the possible connection issues with EC2 instance:
- Connection timeout
- Permission denied due to host key not found
- Unprotected private key file
- Permission denied due to user key not recognized by server
- No supported authentication method available
- Server refused the key AWS Video Training
32. What Are The Features Of The Amazon Ec2 Service ?
As the Amazon EC2 service may be a cloud service so it’s all the cloud features.
Amazon EC2 provides the following features:
- Virtual computing environment (known as instances)
- Amazon Machine Images (AMIs) may be a complete package that you simply need for your server (including the OS and extra software)
- Amazon EC2 provides various configurations of storage, memory, CPU, and networking capacity for your instances
- Secure login information for your instances using key pairs (AWS stores the general public key and you’ll store the private key during a secure place)
- Storage volumes of temporary data is deleted once you stop or terminate your instance (known as instance store volumes)
- Amazon EC2 provides persistent storage volumes
- A firewall that permits you to specify the protocols, ports, and source IP ranges which will reach your instances using security groups
- Static IP addresses for dynamic cloud computing
- Amazon EC2 provides metadata (known as tags)
33. Explain Storage For Amazon Ec2 Instance ?
It provides many data storage options for your instances. Each option features a unique combination of performance and sturdiness . These storages are often used independently or together to fit your requirements.
There are mainly four sorts of storages provided by AWS:
- Amazon EBS: Its durable, block-level storage volumes can be attached in running Amazon EC2 instances. It persists independently from the running lifetime of an Amazon EC2 instance. After an EBS volume is attached to an instance, you’ll use it like all other physical disk drives . Amazon EBS encryption feature supports encryption feature.
- Amazon EC2 Instance Store: Storage disk that is attached to the host computer is referred to as an instance store. It provides temporary block-level storage for Amazon EC2 instances. The data on an instance store volume persists only (sap training) during the lifetime of the associated Amazon EC2 instance; if you stop or terminate an instance, any data on instance store volumes is lost.
- Amazon S3: It provides access to reliable and cheap data storage infrastructure. Amazon S3 is designed to make web-scale computing easier by enabling you to retrieve and store at any time, any amount of knowledge, from within Amazon EC2 or anywhere on the web.
- Adding Storage: whenever you launch an instance from an AMI, a root memory device is made for that instance. The root memory device contains all the knowledge necessary else the instance. You can specify storage volumes additionally to the basis device volume once you create an AMI or launch an instance using block device mapping.
34. What are the different types of instances?
Following are the types of instances,
- General purpose
- Computer Optimized
- Storage Optimized
- Memory Optimized
- Accelerated Computing
35. What are reserved instances?
Reserved instances are the instance that you simply can reserve a hard and fast capacity of EC2 instances. In reserved instances you’ll need to get into a contract of 1 year or 3 years.
36. What are the cloudwatch metrics that are available for EC2 instances?
CPU utilization, CPUCreditBalance, CPUCreditUsage, Diskreads, Diskwrites, networkpacketsIn, networkpacketsOut, networkIn, networkOut.
37. What are the types of load balancers in EC2?
There are 3 types of load balancers,
- Application load balancer
- Network load balancer
- Classic load balancer
38. What are the main differences between EC2 and S3?
The differences between EC2 and S3 are.
EC2 | S3 |
It is a cloud web service | It is a data storage system |
It is used for hosting the web application | It is used for storing any amount of data |
It works as a huge computer machine | It is a REST interface. |
It can either run LINUX or Windows and will also handle PHP, Python, Apache and various other forms of databases. | It applies secure authentication keys such as HMAC-SHA1 |
39. Define T2 Instance?
T2 Instance is specifically designed to supply moderate baseline performance and therefore the ability to burst into the upper performance as per the wants of the workload.
40 Can you differentiate between a Spot instance and an On-Demand instance?
Both on-demand instances and spot instances are pricing models. A spot instance allows customers to get compute capacity with no upfront commitment. Moreover, the hourly rates for a spot instance are usually less than what has been set for on-demand instances.
The bidding price for a spot instance is known as the spot price. It fluctuates based on the supply and demand for spot instances. In case the spot price gets higher than a customer’s maximum specified price, the EC2 instance will shut down automatically.
41. What is the boot time for an instance store backed instance ?
The boot time for an Amazon Instance Store -Backed AMI is typically but 5 minutes.
42. Which instance will you employ for deploying a 4-node Hadoop cluster in AWS ?
We can use a c4.8x large instance or i2.large for this, but employing a c4.8x would require a far better configuration on PC.
43. What should be the instance’s tenancy attribute for running it on a single tenant hardware ?
The instance tenancy attribute must be set to a dedicated instance and other values might not be appropriate for this operation.
44. Is it possible to vertically scale on an Amazon Instance? If yes, how ?
Below are the steps to scale an Amazon Instance vertically –
- Spin up a bigger Amazon instance than the prevailing one.
- Pause the existing instance to remove the root ebs volume from the server and discard.
- A live running instance should stop and detach its root volume.
- Make a note of the unique device ID and fasten that root volume to the new server.
- Start the instance again.
45. Is it possible to cast-off S3 with EC2 instances ? If yes, how ?
It is possible to cast-off S3 with EC2 instances using root approaches backed by native occurrence storage.
46. How many EC2 instances can be used in a VPC ?
There is a limit of running up to a complete of 20 on-demand instances across the instance family , you’ll purchase 20 reserved instances and request spot instances as per your dynamic spot limit region.
47. Can you run multiple websites on an EC2 server using a single IP address?
To run multiple websites on EC2 more than one elastic IP is required.
48. Can you modify the private IP address of an EC2 instance while it is running in a VPC ?
It is not possible to change the primary private IP addresses. However, secondary IP addresses can be assigned, unassigned or moved between instances at any given point.
49. How can you safeguard EC2 instances running on a VPC ?
AWS Security groups associated with EC2 instances can help you safeguard EC2 instances running in a VPC by providing security at the protocol and port access level. You can configure both INBOUND and OUTBOUND traffic to enables secured access for the EC2 instance.AWS security groups are much similar to a firewall-they contain set of rules which filter the traffic coming into and out of an EC2 instance and deny any kind of unauthorized access to EC2 instances.
50. Mention the pricing models for EC2 Instances?
The various pricing models used for EC2 instances have been mentioned below:
- On-demand
- Reserved
- Spot
- Scheduled
- Dedicated