Monday, June 19, 2017

Questions and Answers


The AWS Policy Generator is a tool that enables you to create policies that control access to Amazon Web Services (AWS) products and resources. For more information about creating policies, see key concepts in Using AWS Identity and Access Management. Here are sample policies.


1. Does multiples ENI’s increase the availability of the machine.?

ANS: No, if instance fails all the ENIs attached to that instance would not be of any use. Multiple ENIs do not increase Availability or Bandwidth of the machine. Rather, they are there for the isolation purpose.

2. Normally in an ON-PREM INFRA, we used to have muti NIC for the webserver not to have a single point of failure in case of one NIC CARD fails? Where as in AWS its a virtual world and I assume its a managed service right? we don't have to worry about the Primary failing at all ?

ANS: On AWS, we handle that scenario via Auto-scaling Group. So that if a machine becomes unreachable, another instance takes its place.

3. The primary ENI can't be detached, Becoz that's the one which makes the instance to have a public and/or private IP right?

ANS: Not so. It is more of a restriction from AWS implementation perspective. In future, they might start allowing it (as you can detach ROOT EBS volume for a stopped machine).

4. Under health check, the ping target, I gave the path index.html. let's assume I have 2 instances and if I want the index.html to reside in a different location for all the 2 instance, let's assume for the 1st one, it's under var/www/HTML and for the second one if its under var/www ..does the ping target as the intelligence to check the file irrespective if its location?

ANS: Given the fact that all the instances behind an ELB are generally kept identical, the path of the file has to be same. Though, if you have some specific use-case for the above scenario, it could be achieved using Application Load Balancer. But, in Classic ELB, it has to be same path. 

5. So the best use case for multi eni would be, Where in a. In a single large instance with multi ENI, that one instance can be part of both private and public subnet b. Having said that, I can have web server facing the internet in the public ENI and the database also in the same instance in the private ENI and configure the security group accordingly.

ANS: Sorry, Incorrect! When you create ENI, you can see that its scope is a Subnet (same way scope of an EC2 is also Subnet). Hence, an EC2 and an ENI would be there only in one subnet (not two).
You can use multi ENI to give 2 different IPs to 2 different user groups. E.g. On an EC2 open port 8080 on IP1 and port 22 on IP2. Also, attach different security groups in above ENIs. Hence, the users would never know they are accessing the same machine.

6. So with multiNIC, I can have multiple websites on the same server, with each Nic attached to one website?

ANS: You can have multiple websites on one machine even without multi-NIC. Different webservers (like IIS) support the same.

7. you had mentioned that the ELB internally creates instances to manage traffic. Just to expand a little on this, So When this ELB creates the internal instance(i assume its not visible to us ) and it consumes the private IP's too right, Does the internal instance gets created per availability zone or per instance? Coz, I attach an ELB to the instance not to the A.Z ?right? I assume it's something like an agent which gets installed per instance and sort of polling the Domain LB? pls, correct my understanding?

ANS: Yes, those instances won't be visible to users as ELB is a managed service. These instances do use ENIs (and hence Private IPs) from the respective subnets. ELB creates one instance in every subnet (you choose while ELB creation). There is no agent running on your instances (e.g. web server). Also, you register your instances to an ELB and hence tell ELB that it could send traffic to these instances.

8. Under Load balancers / instances, down the page under availability zone, ELB had created 2 AZ's. whereas I had all 3 of my instances in the same A.Z, though I can edit it and remove the other A.Z, why does it create an another AZ reference point when all my instances are in only one AZ? 

ANS: While creating ELB, you can clearly choose which subnets you want it to handle. It is recommended that you give 2 subnets in 2 different AZs (based on principle of HA). ELB will launch an internal instance in the subnets you choose while creating ELB.

9. How to convert On-Demand instance into Reserved instance.

I understand that it's supposed to be simply a billing difference, however, the tool that AWS provides to purchase a reserved instance appears to want to create a new instance. It does not provide an interface to select an existing instance to change billing on.
Super-simple scenario. Consider a customer with a single micro EC2 instance that he wants to turn into a reserved instance. How do I do this?
The "Purchase Reserved Instances" wizard in the console appears to be creating a new instance--a new virtual server. It is asking questions like which platform, which availability zone, etc. I hope you can see that my assumption is that if I go through with an RI purchase, I'll end up with a new micro instance rather than simply telling AWS to bill me differently for my existing instance.
A reserved instance is actually just a reservation and no instance will be created when you purchase one. If you have an existing instance, you simply purchase a reservation matching that instance type, platform, and availability zone. Behind the scenes, the billing system is constantly looking at the running instances and your reservations. When there is a match (same type, platform, az), you automatically get the lower hourly rate.
If you go with a Heavy utilization reservation, you will however be charged for the full number of hours each month no matter if you have an instance or not. With Light and Medium, you are only charged when there is an instance up and running.
A reservation isn't tied to any particular instance, meaning that you can launch and terminate instances as you wish. You still work with EC2 in the exact same way as before.
Thank you. I understand now.
I think for the average dummy like me, the reserved instance purchase process feels too much like setting up a new instance. Easy to feel like I'm doing the wrong thing. Since it is important to select the correct instance type and AZ to get the expected benefit, it would be helpful if their process allowed you to select an existing instance to purchase a reserved instance that matches the instance type and AZ--especially since the one-time fee is non refundable.
Thanks!
Let say I got 3 servers and all of them are in the same AZ, same platform.
can I purchased 2 reserved instance then,
does it means that the 2 servers will be billed by the
reserved intance and the other server will be billed by on demand?
Yes. That's exactly what it means.


Thursday, June 15, 2017

Elastic Cache

What is Elastic Cache


Elastic Cache is a web service that helps in improving web application performance. Allowing you to retrieve the data from fast managed-in cache instead of relying on DB every time.

Advantages of Elastic Cache

a) Reduces load on DB's
b) speed up application response

c) Using this we can save money by offloading some DB activities.

Features of Elastic Cache

a)  Elastic cache has Automatic failure deduction and recovery
b) No minimum fee and no upfront cost  is charged and charges are based on demand usage
c) Free tier is available for testing with a limit of 750 micro node hours for a year.
d) Can be launched in multi AZ

Available Elastic cache engines

As of now Two types of open source engine's are available 
a) Memcached
b) Redis

Redis - adavnced tracking, counting session management and tracking.
memached - simple caching

How to Connect

Note the endpoint of cache cluster in Elastic cache home page.

Can connect from EC2 running on same VPC. Default port for redis 6379
To ineract use telent
telnet <cache name> port name
then can run redis commands

Elastic Beanstalk

Beanstalk is a Platform As A Service solution

With Elastic bean stalk you can quickly deploy and manage application in the cloud.

You simply upload the application, elastic beanstalk automatically handles deployment, capacity provisioning, auto scaling, load balancing and application health monitoring

By default your application is available publicly at myapp.elasticbeanstalk.com for anyone to access

You can move multiple versions of your applications running at same time

You can create upto 75 applications and 1000  application versions by default upto 200 environments across all of your application

You can use elasticbeanstlak  to deploy app in multiple available zones. 
It uses worker environment tier.
With beanstalk you can choose loggin access, OS
Beanstalk runs on amazon linux and window 2012 r2 ami
It takes few minutes to create to run your application

No additional charges for amazon elastic beanstalk you pay only for AWS resources. Actually used to store & run your application. Very easy to deploy With 

Tuesday, June 13, 2017

What is the Difference between SES and SNS

To send emails through SNS, the email address must be subscribed to an SNS topic. Subscribing an email address to a topic requires opt-in confirmation from the owner of the email address. SNS is orientated toward broadcast (This will create a new list of broadcast recipients. When you send a message to the Broadcast List, it will send to all recipients in the list. The recipients will receive the message as a normal message. When they reply, it will appear as a normal message in your Chats screen; their reply will not be sent to other recipients in the Broadcast List.) Applications (known as publishers) can generate broadcasts to simply send events not knowing who, if anyone, will get them. Receivers (known as subscribers) that want the information subscribe to specific messages via filters. If the message matches a filter, the subscriber is activated (if it’s not already running) and notified of the messages. sending, while SES can support point-to-point sending and has no support for broadcast today. More information about SNS subscription is available in the SNS API reference. By comparison, SES can send to any email address with no prior confirmation.

SES provides full support for a rich email experience, such as HTML, links, and embedded images. SNS allows you to publish notifications across multiple protocols, such as HTTP, SQS, and email. Because SNS is opt-in only, it is easier for us to ensure good email deliverability with SNS, and we can pass this cost saving onto our customers: SNS has a lower price per email than SES.

Thursday, June 8, 2017

Points to be considered to migrate an application from On Premises to AWS

Below are some of the tips how to Design an application migration and which component has to placed in which level below are some of the tips for the same

1) If it is publicly accessed web application then we need to design in such a way that initial request is hitting Route 53 then to ELB

Request will hit Route53 from there request will be forwarded to ELB

2) Number of Subnet's to be created

a) Management subnet, ( Antivirus, to check valid Request), 

In Management subnet we will have all management related activities like antivirus, firewall... Even we can place ELB will be in management subnet.

b) Web Subnet

Where web application resides. This subnet can either be public or priavte based on application. Inbound rule for this subnet will be like  all traffic from management

c) Application Subnet 

Where the actual application resides. Inbound for this subnet will be like all traffic from web subnet  and outbound will be like all traffic to web and data db subnet

d) DB subnet 

Ports for application for DB will be different, so it is better to create a seperate subnet for DB. Because opening the ports for application in Security group will open the port to DB instances as well. So it is better to create different subnet. Inbound - only from application

Available tools to migrate.

racemi - migration 80 mb chunks, during migration it will create a timestamp replica for disk
migration


Sunday, June 4, 2017

Datacenter to Cloud migration TIPS

Points to be noted to migrate a Server to cloud

1) On Server front

We need to make a note of below details before creating an instance in cloud.

a) CPU
b) Memory
c) Disk
d) NFS/CIFS (shared) volume
e) List of process
f)  Process wise memory
g) port details (iptables)
h) environment
i)  Cluster

2) Application Details

technology stack
internal/external users
how user authentication
cluster
Is technlogy stack upgradable

3) Network Details

Load balancer,
connection between any management subnet
generic n/w arch

4) Managment Details

what antivirus (for license purpose)
AD DNS details
Firewall details