Showing posts with label aws-interview-questions. Show all posts
Showing posts with label aws-interview-questions. Show all posts

Monday 20 August 2018

How to Setup Password Authentication For AWS ec2 Instances

How to Setup Password Authentication For AWS ec2 Instances

Set the password for root user

  1. Login to SSH using  .pem file
  2. Change user as root user.
    sudo su
  3. Go to ssh config file
    vi /etc/ssh/sshd_config
  4. Change the following var in ssh config
    PasswordAuthentication yes
    PermitRootLogin yes
  5. Change the Root password
    passwd root

    It will prompt the password, you need to provide the password two time.
  6. ReStart the server
    service sshd restart

Now, you can login to EC2 instance with password .

Note: we have set the password for root user not for ec2-user


Thursday 2 August 2018

AWS interview questions and answers for 2 year experienced

AWS interview questions and answers for 2 year experienced

Question: Difference between dedicated instance and dedicated host?
Dedicated Instances are EC2 instances that run in a VPC on hardware that's dedicated to a single customer and are physically isolated other AWS accounts. When you reboot the dedicated instance, you will get instance in same VPC but not the same instance.

Dedicated instance may share hardware with other instance of same account.

Dedicated Host gives you additional visibility and control over how instances are placed on a physical server, and you can consistently deploy your instances to the same physical server over time. When you reboot the dedicated host, you will get instance same instance in same VPC.


Question: What is a Load Balancer?
A Load Balancer is a device that distributes network or application traffic across a cluster of servers.



Question: What are different type Load Balancer?
  1. Application Load Balancer: An Application Load Balancer makes routing decisions at the application layer (HTTP/HTTPS), supports path-based routing.
  2. Network Load Balancer: A Network Load Balancer makes routing decisions at the transport layer (TCP/SSL). It can handle millions of requests per second. After the load balancer receives a connection, it selects a target from the target group for the default rule using a flow hash routing algorithm.
  3. Classic Load Balancer: A Classic Load Balancer makes routing decisions at either the transport layer (TCP/SSL) or the application layer (HTTP/HTTPS)



Question: From where we can access Elastic Load Balancing?
  1. AWS console
  2. AWS Command Line Interface (AWS CLI)
  3. AWS SDK
  4. Query API



Question:How does Elastic Load Balancing Works?
A load balancer accepts incoming traffic from clients and routes request to EC2 in one or more Availability Zones.

It also monitor the health of Ec2 instance and route only to the healthy instance.
You can configure one or more listener with using port and protocol, listener check for connection request.



Question: What are different type of database in AWS?
  1. RDS
    1. SQL
    2. MySQL
    3. PostgreSQL
    4. Orcle
    5. Aurora
    6. MariaDB
  2. DynamoDB
  3. Redshift



Question: what is Lightsail?
Lightsail is easiest way to launch and manage a virtual private server with AWS.
Lightsail plans include everything you need to jumpstart your project – a virtual machine, SSD-based storage, data transfer, DNS management, and a static IP – for a low, predictable price.


Question: What are Placement Groups?
Placement Groups are logical groupings of instances in the selected AWS region.
Used for launching cluster compute instance types. ( e.g. cc2.8xlarge) Cluster Compute Instances provide a large amount of CPU.


Question: What is Amazon S3 Transfer Acceleration?
Amazon S3 Transfer acceleration enables fast, easy, and secure transfers of files over long distances between your location and an S3 bucket location.
Steps to upload
  1. Enable S3 Transfer Acceleration for bucket
  2. Now you have separate URL for upload, at same page
  3. When you upload the files at nearest location, it will auto sync to bucket and disturibute to other location.



Question: When Amazon S3 Transfer Acceleration is beneficial?
When your location and your bucket location is too far.
For example:
You are mumbai region and bucket is in US east, in such type of case we can use it will upload files faster.


Question:Does Elastic load balancer have public IPV4 Address?
No, load balancer does not have public IPV4 address.


Question: What is Amazon RDS Multi-AZ?
Amazon RDS Multi-AZ deployments provide enhanced availability and durability for Database Instances, making them a workable for production database workloads.


Question: How does Amazon RDS Multi-AZ?
In case of Multi-AZ DB Instance, Amazon RDS automatically creates a primary DB Instance and synchronously replicates the data in a different Availability Zone.
Each instance runs on its own physically distinct, independent infrastructure, and is engineered to be highly reliable.
In case of multi az, there is always single endpoint for db connections.


Question: What is Amazon RDS Read Replicas?
Read Replicas makes it easy to elastically scale out beyond the capacity of a single DB instance for read-heavy database workloads.


Question: What is the difference between the Multi-AZ deployment and Read Replica in AWS RDS?
Multi-AZ offer where you get standby replica of your RDS in a different Availability Zone which will substitute automatically your primary database in case of its maintenance, failure or AZ failure.
You can't access individual instance, only primary database can access.(But in case of failure, you can access individual instance)

In case of RDS Read Replicas, we can access individual instance. In case of failure, you can make other read replica as primary.


Question: What is Amazon DynamoDB?
Amazon DynamoDB is a fully managed NoSQL database service that supports key-value and document data structures as part of the Amazon Web Services.


Use Cases
  1. Serverleas web application
  2. Microservices data store
  3. Mobile backends



Question: What is Instance Store volume?
An instance store is a temporary storage type located on disks that are physically attached to a host machine.

In this type storage, the data is not persistently stored. Once an instance is terminated or stopped, all of its data is lost.
Instance store volumes are ideal for temporary backup, and for storing an application’s cache, logs.




Question: What are different types of Instance Store Volume Types
  1. Ephemeral
  2. Non-Volatile Memory
  3. TRIM



Question: What are difference Instance Store-Backed vs AWS EBS-Backed?
instance store-backed volumes are a good option when you need storage with very low latency.
When we Instance store devices, stop or terminate an instance, every block of storage in the instance store is reset.



Question: What are limitations of Instance Store Volumes?
  1. Support C3, G2, HI1, I2, I3, M3, R3, and X1 instance families
  2. Data in the instance store can be lost if the underlying disk drive fails.
  3. Instance store devices have only root volume, which can’t be extended
  4. It's not possible to resize instance-backed root volumes on the fly
  5. Taking a snapshot or AMI of an instance store volume is not as straightforward as taking snapshot of EBS volume.


Wednesday 25 July 2018

AWS interview questions and answers for 1 year experienced

AWS interview questions and answers for 1 year experienced

Question: What is the difference between Amazon S3 and Amazon EC2 instance?
Amazon S3: It is just storage service where you can upload photo, video, audio, pdf etc any type of files upto 5 terabytes (5Tb).
It store data as a object, you can't install any software like MS office, VLC player, Adobe etc.

You can import/export data from/to S3 and also can access via cloudfront.

EC2 instance: Launching a EC2 instance is similar a create virtual computer (windows, linux) where you can install software unlike S3. You can customize the configuration like volume(storage), RAM, CPU etc.


Question: How to copy files from one bucket to another?
  1. Login to SSH using ip address and ppk file.
  2. Make sure, it have AWS S3 access privilege
  3. Now just execute following command
    aws s3 sync s3://source-bucket s3://destination-bucket --exclude *.tmp
    



Question: Can we change the availability zone of an existing EC2 t1.micro instance?
No, you can not do.
for this, you need to launch new instance from existing instance.



Question: What is Availability Zones?
Amazon EC2 is hosted in world-wide.
These locations are composed of regions and Availability Zones.
Each region has multiple, isolated locations known as Availability Zones.


Question: How to move files directly from one S3 account to another?
Bucket Explorer works on Mac
S3 Browser works on windows.



Question: AWS Difference between a snapshot and AMI?
A snapshot is of an EBS volume where you save at a certain point of time.
An AMI is similar, but its for the EC2 instances themselves. you can create a AMI but can't do snapshot.


Question: What is the maximum length of a filename in S3?
1024 characters.



Question: How to move a domain from Godaddy to AWS Route 53? =>Login on your aws console
=>Click on Route 53
=>Create Hosted Zone
=>Select your new created host title
=>click "Go to Record Sets", take note of the nameservers;

=>Login on your Godaddy account
=>Select your domain
=>Go to Nameservers and click SetNameservers;
=>paste all the four you took from Go to Record Sets;


Question: How to transfer files between from AWS ec2 to S3
aws s3 cp myfolder s3://mybucket/myfolder --recursive



Question: How to transfer files between from S3 to EC2
aws s3 cp s3://mybucket/myfolder myfolder  --recursive



Question: Question: What is private hosted zone?
A private hosted zone is a container that holds information about how you want Amazon Route 53 to respond to DNS queries for a domain



Question: What is the AWS Storage Gateway service?
The AWS Storage Gateway service enables hybrid storage between on-premises environments and the AWS Cloud.


Tuesday 24 July 2018

AWS Interview Questions and Answers

AWS interview questions and answers

Question: What are different http status code?
    [100] => Continue
    [101] => Switching Protocols
    [200] => OK
    [201] => Created
    [202] => Accepted
    [203] => Non-Authoritative Information
    [204] => No Content
    [205] => Reset Content
    [206] => Partial Content
    [300] => Multiple Choices
    [301] => Moved Permanently
    [302] => Found
    [303] => See Other
    [304] => Not Modified
    [305] => Use Proxy
    [307] => Temporary Redirect
    [400] => Bad Request
    [401] => Unauthorized
    [402] => Payment Required
    [403] => Forbidden
    [404] => Not Found
    [405] => Method Not Allowed
    [406] => Not Acceptable
    [407] => Proxy Authentication Required
    [408] => Request Timeout
    [409] => Conflict
    [410] => Gone
    [411] => Length Required
    [412] => Precondition Failed
    [413] => Request Entity Too Large
    [414] => Request-URI Too Long
    [415] => Unsupported Media Type
    [416] => Requested Range Not Satisfiable
    [417] => Expectation Failed
    [500] => Internal Server Error
    [501] => Not Implemented
    [502] => Bad Gateway
    [503] => Service Unavailable
    [504] => Gateway Timeout
    [505] => HTTP Version Not Supported
    [509] => Bandwidth Limit Exceeded



Question: How to safely upgrade an Amazon EC2 instance from t1.micro to large?
Create a snapshot of your current image
Once snopshot done, then new to launch new instance.
Simply launch it as a large instance at that point.



Question: How to get the instance id from within an ec2 instance?
Login to EC2,and execute following command
wget -q -O - http://169.254.169.254/latest/meta-data/instance-id



Question: How to setup up FTP on Amazon Cloud Server?
https://stackoverflow.com/questions/7052875/setting-up-ftp-on-amazon-cloud-server



Question: What data is stored in Ephemeral Storage of Amazon EC2 instance?
When you mount your EBS volume at /myNewWebsite, then anything not in /myNewWebsite will be lost.


Question: Difference between EC2 and Elastic Beanstalk?
EC2
EC2 service that allows you to create a Ec2 instance in the AWS. You pay by the hour. you can create n instance and do the setting for each instance.

Elastic Beanstalk
Elastic Beanstalk is one layer of abstraction away from the EC2 layer.
In Beanstalk will setup an "environment" for you that can contain a number of EC2 instances, an optional database, as well as a few other AWS components such as a Elastic Load Balancer, Auto-Scaling Group, Security Group etc.



Question: What is difference between Lightsail and EC2?
EC2
EC2 service that allows you to create a Ec2 instance in the AWS. You pay by the hour. you can create n instance and do the setting for each instance.

Lightsail
Lightsail is designed to be the easiest way to launch and manage a virtual private server with AWS.
Lightsail plans include everything you need to start for your project – a virtual machine, SSD-based storage, data transfer, DNS management, and a static IP – for a low, predictable price.



Question: How to make clone of EC2?
You make an AMI of an existing instance, and then launch other instances using that AMI.



Question: .htaccess not working apache with my EC2 instance?
  1. Login to SSH
  2. Configure Apache mod_rewrite a2enmod rewrite
  3. add the following code to /etc/apache2/sites-available/default
    AllowOverride All
  4. Restart apache
    /etc/init.d/apache2 restart



Question: What happens when I reboot an EC2 instance?
Its similar as we reboot the system. None of data is deleted.
As per cost, no change in cost as they start charging when start instance and stop when terminate the instance.



Question: What is difference between Fixed Performance / Burstable Performance Instances?
AWS EC2 has 2 different type of instances: Fixed Performance Instances(for example M3, C3 etc) and Burstable Performance Instances (For example T2).

Fixed Performance Instances provides a consistent CPU performance whereas Burstable Performance Instances provide a baseline CPU performance under normal workload and when the workload increase on server then increase the CPU performance.



Question: What is CPU Credit?
CPU Credit regulates the amount of "CPU performance" can be increased under workload.
You can spend this CPU Credit to increase the CPU performance during the Burst period.
100% of CPU performance for 5 minutes, you will spend 5(i.e. 5*1.0) CPU Credit.


Question: What is CPU Credit Balance?
is simply the amount of CPU Credit available in your account at any moment.


Wednesday 18 July 2018

AWS Tutorial Terminology page 8

AWS Tutorial Terminology page 8

Question: What is Amazon Resource Names (ARNs)?
Amazon Resource Names (ARNs) uniquely identify AWS resources across all of AWS resources, such as in IAM policies, Amazon Relational Database Service (Amazon RDS) tags.


Question: Give few sample of ARN Format?

arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment


arn:aws:iam::123456789012:user/David


arn:aws:rds:eu-west-1:123456789012:db:mysql-db


arn:aws:s3:::my_corporate_bucket/exampleobject.png



Question: Explain syntax of ARN Format?
arn:partition:service:region:account-id:resource

arn:It is static
partition: Standard AWS regions the partition is aws.
service: The service namespace that identifies the AWS product like Amazon S3, IAM, or Amazon RDS.
region: Region of the service like west-1, west-2,
account: Account id from where its generated.
resource: The content of this part of the ARN varies by service. It often includes an indicator of the type of resource.



Question: What is Elastic ip address?
An Elastic IP address is a static IPv4 address designed for dynamic cloud computing.
An Elastic IP address is associated with your AWS account.


Question: What is public hosted zone?
A public hosted zone is a container that holds information about how you want to route traffic on the internet for a domain, such as example.com


Question: What is private hosted zone?
A private hosted zone is a container that holds information about how you want Amazon Route 53 to respond to DNS queries for a domain


Question: What is Amazon RDS Read Replicas?
Amazon RDS Read Replicas provide enhanced performance and durability for database which makes elastically scale out beyond the capacity constraints of a single DB instance for read-heavy database workloads.


You can create one or more replicas and serve high-volume application read traffic from multiple copies of your data.
Read replicas are available in Amazon RDS for MySQL, MariaDB, and PostgreSQL as well as Amazon Aurora.



Question: What is Amazon RDS Multi-AZ Deployments?
Amazon RDS Multi-AZ deployments provide enhanced availability and durability for Database (DB) Instances, making them a natural fit for production database workloads. When you provision a Multi-AZ DB Instance, Amazon RDS automatically creates a primary DB Instance and synchronously replicates the data to a standby instance in a different Availability Zone (AZ). Each AZ runs on its own physically distinct, independent infrastructure, and is engineered to be highly reliable.


Question: What AWS Key Management Service (KMS)?
KMS is a managed service where you can create and control the encryption keys used to encrypt your data, and uses FIPS 140-2 validated hardware security modules. KML is integrated with most other AWS services to help you protect the data you store with these services.


Question: What is difference between Amazon S3, EBS and EFS ?
Amazon S3: Amazon S3 stores data as objects. Each object in the storage contains a header with associated sequence of bytes from 0 byte to 5 TB.
EBS: EBS stores data as blocks of the same size and organizes as similar to a traditional file system, you can use it with EC2 instance.
EFS: EBS may be good for setting up a drive for virtual machines and and S3 is good for storage and EFS is good for both.

Amazon S3 Amazon EBS Amazon EFS
Can be publicly accessible
Web interface
Object Storage
Scalable
Slower than EBS and EFS
Accessible only via the given EC2 Machine
File System interface
Block Storage
Hardly scalable
Faster than S3 and EFS
Accessible via several EC2 machines and AWS services
Web and file system interface
Object storage
Scalable
Faster than S3, slower than EBS
Good for storing backups Is meant to be EC2 drive Good for shareable applications and workloads