{"id":7512,"date":"2018-06-01T23:03:17","date_gmt":"2018-06-01T15:03:17","guid":{"rendered":"http:\/\/rmohan.com\/?p=7512"},"modified":"2018-06-01T23:22:36","modified_gmt":"2018-06-01T15:22:36","slug":"amazon-web-services-aws","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7512","title":{"rendered":"Amazon Web Services (AWS)"},"content":{"rendered":"<h2>Amazon Web Services (AWS)<\/h2>\n<ul>\n<li>Extensive set of cloud services available via the Internet<\/li>\n<li>On-demand, virtually endless, elastic resources<\/li>\n<li>Pay-per-use with no up-front costs (with optional commitment)<\/li>\n<li>Self-serviced and programmable<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/aws_list_of_services.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7513\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/aws_list_of_services.png\" alt=\"\" width=\"1339\" height=\"818\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_list_of_services.png 1339w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_list_of_services-300x183.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_list_of_services-768x469.png 768w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_list_of_services-1024x626.png 1024w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_list_of_services-150x92.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_list_of_services-400x244.png 400w\" sizes=\"(max-width: 1339px) 100vw, 1339px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><a href=\"http:\/\/aws.amazon.com\/ec2\/\" rel=\"nofollow\">Elastic Compute Cloud (EC2)<\/a><\/h2>\n<ul>\n<li>One of the core services of AWS<\/li>\n<li>Virtual machines (or\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/Instances.html\" rel=\"nofollow\"><em>instances<\/em><\/a>) as a service<\/li>\n<li>Dozens of\u00a0<a href=\"http:\/\/aws.amazon.com\/ec2\/instance-types\/\" rel=\"nofollow\"><em>instance types<\/em><\/a>\u00a0that vary in performance and cost<\/li>\n<li>Instance is created from an\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/AMIs.html\" rel=\"nofollow\"><em>Amazon Machine Image (AMI)<\/em><\/a>, which in turn can be created again from instances<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/aws_map_regions.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7517\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/aws_map_regions.png\" alt=\"\" width=\"901\" height=\"418\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_map_regions.png 901w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_map_regions-300x139.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_map_regions-768x356.png 768w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_map_regions-150x70.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_map_regions-400x186.png 400w\" sizes=\"(max-width: 901px) 100vw, 901px\" \/><\/a> <a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/aws_map_regions_eu.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7518\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/aws_map_regions_eu.png\" alt=\"\" width=\"719\" height=\"519\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_map_regions_eu.png 719w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_map_regions_eu-300x217.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_map_regions_eu-150x108.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/aws_map_regions_eu-400x289.png 400w\" sizes=\"(max-width: 719px) 100vw, 719px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/using-regions-availability-zones.html\" rel=\"nofollow\">Regions and Availability Zones (AZ)<\/a><\/p>\n<p>Notes: We will only use Ireland (eu-west-1) region in this workshop. See also\u00a0<a href=\"http:\/\/www.enterprisetech.com\/2014\/11\/14\/rare-peek-massive-scale-aws\/\" rel=\"nofollow\">A Rare Peek Into The Massive Scale of AWS<\/a>.<\/p>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-networking-in-aws\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#networking-in-aws\" aria-hidden=\"true\"><\/a>Networking in AWS<\/h2>\n<ul>\n<li>Regions and availability zones<\/li>\n<li><a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/using-network-security.html\" rel=\"nofollow\"><em>Security groups<\/em><\/a>\u00a0provide port-level firewalls to instances<\/li>\n<li>More detailed IP subnetting with\u00a0<a href=\"http:\/\/aws.amazon.com\/vpc\/\" rel=\"nofollow\">Virtual Private Cloud (VPC)<\/a><\/li>\n<\/ul>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-exercise-launch-an-ec2-instance\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#exercise-launch-an-ec2-instance\" aria-hidden=\"true\"><\/a>Exercise: Launch an EC2 instance<\/h2>\n<ol>\n<li>Log-in to\u00a0<a href=\"https:\/\/gofore-crew.signin.aws.amazon.com\/console\" rel=\"nofollow\">gofore-crew.signin.aws.amazon.com\/console<\/a><\/li>\n<li>Switch to\u00a0<strong>Ireland<\/strong>\u00a0region and go to EC2 dashboard<\/li>\n<li>Launch a new EC2 instance according instructor guidance<\/li>\n<\/ol>\n<ul>\n<li>In\u00a0<em>&#8220;Configure Instance Details&#8221;<\/em>, pass a\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/user-data.html\" rel=\"nofollow\"><em>User Data<\/em><\/a>\u00a0script under\u00a0<em>Advanced<\/em><\/li>\n<li>In\u00a0<em>&#8220;Configure Security Group&#8221;<\/em>, use a recognizable, unique name<\/li>\n<\/ul>\n<pre><code>\r\n#!\/bin\/sh\r\n# When passed as User Data, this script will be run on boot\r\ntouch \/new_empty_file_we_created.txt\r\necho \"It works!\" &gt; \/it_works.txt\r\n<\/code><\/pre>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-exercise-ssh-into-the-instance\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#exercise-ssh-into-the-instance\" aria-hidden=\"true\"><\/a>Exercise: SSH into the instance<\/h2>\n<p>SSH into the instance (find the IP address in the EC2 console)<\/p>\n<pre><code># Windows Putty users must convert key to .ppk (see notes)\r\nssh -i your_ssh_key.pem ubuntu@instance_ip_address\r\n<\/code><\/pre>\n<p>View instance metadata<\/p>\n<pre><code>curl http:\/\/169.254.169.254\/latest\/meta-data\/\r\n<\/code><\/pre>\n<p>View your\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/user-data.html\" rel=\"nofollow\"><em>User Data<\/em><\/a>\u00a0and find the changes your script made<\/p>\n<pre><code>curl http:\/\/169.254.169.254\/latest\/user-data\/\r\nls -la \/\r\n<\/code><\/pre>\n<p>Notes: You will have to reduce keyfile permissions\u00a0<code>chmod og-xrw mykeyfile.pem<\/code>. If you are on Windows and use Putty, you will have to convert the .pem key to .ppk key using\u00a0<a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\" rel=\"nofollow\">puttygen<\/a>\u00a0(Conversions -&gt; Import key -&gt; *.pem file -&gt; Save private key. Now you can use your *.ppk key with Putty: Connection -&gt; SSH -&gt; Auth -&gt; Private key file)<\/p>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-exercise-security-groups\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#exercise-security-groups\" aria-hidden=\"true\"><\/a>Exercise: Security groups<\/h2>\n<p>Setup a web server that hosts the id of the instance<\/p>\n<pre><code>mkdir ~\/webserver &amp;&amp; cd ~\/webserver\r\ncurl http:\/\/169.254.169.254\/latest\/meta-data\/instance-id &gt; index.html\r\npython -m SimpleHTTPServer\r\n<\/code><\/pre>\n<p>Configure the security group of your instance to allow inbound requests to your web server from\u00a0<strong>anywhere<\/strong>. Check that you can access the page with your browser.<\/p>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-exercise-security-groups-1\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#exercise-security-groups-1\" aria-hidden=\"true\"><\/a>Exercise: Security groups<\/h2>\n<p>Delete the previous rule. Ask a neighbor for the name of their security group, and allow requests to your server from your\u00a0<strong>neighbor&#8217;s security group<\/strong>.<\/p>\n<p>Have your neighbor access your web server from his\/her instance.<\/p>\n<pre><code># Private IP address of the web server (this should work)\r\ncurl 172.31.???.???:8000\r\n# Public IP address of the web server (how about this one?)\r\ncurl 52.??.???.???:8000\r\n<\/code><\/pre>\n<p>&#8212;<\/p>\n<p>Speaking of IP addresses, there is also\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/elastic-ip-addresses-eip.html\" rel=\"nofollow\">Elastic IP Address<\/a>. Later on, we will see use cases for this, as well as better alternatives.<\/p>\n<p>Also, notice the monitoring metrics. These come from CloudWatch. Later on, we will create alarms based on the metrics.<\/p>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-elastic-block-store-ebs\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#elastic-block-store-ebs\" aria-hidden=\"true\"><\/a><a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/AmazonEBS.html\" rel=\"nofollow\">Elastic Block Store (EBS)<\/a><\/h2>\n<ul>\n<li>Block storage service (virtual hard drives) with speed and encryption options<\/li>\n<li>Disks (or\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/EBSVolumes.html\" rel=\"nofollow\"><em>volumes<\/em><\/a>) are attached to EC2 instances<\/li>\n<li><a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/EBSSnapshots.html\" rel=\"nofollow\"><em>Snapshots<\/em><\/a>\u00a0can be taken from volumes<\/li>\n<li>Alternative to EBS is ephemeral\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/InstanceStorage.html\" rel=\"nofollow\"><em>instance store<\/em><\/a><\/li>\n<\/ul>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-ec2-cost\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#ec2-cost\" aria-hidden=\"true\"><\/a>EC2 cost<\/h2>\n<ul>\n<li>Instances are billed every starting\u00a0<a href=\"http:\/\/aws.amazon.com\/ec2\/pricing\/\" rel=\"nofollow\"><em>instance-hour<\/em><\/a><\/li>\n<li>Purchasing options of\u00a0<a href=\"http:\/\/aws.amazon.com\/ec2\/purchasing-options\/\" rel=\"nofollow\"><em>On-Demand Instances<\/em>,\u00a0<em>Reserved Instances<\/em>,\u00a0<em>Spot Instances<\/em><\/a><\/li>\n<li>Storage costs for volumes, snapshots and images<\/li>\n<li>Traffic costs (more the further the traffic is towards the Internet)<\/li>\n<\/ul>\n<hr \/>\n<h1><a id=\"user-content-identity-and-access-management\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#identity-and-access-management\" aria-hidden=\"true\"><\/a>Identity and Access Management<\/h1>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-identity-and-access-management-iam\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#identity-and-access-management-iam\" aria-hidden=\"true\"><\/a><a href=\"http:\/\/aws.amazon.com\/iam\/\" rel=\"nofollow\">Identity and Access Management (IAM)<\/a><\/h2>\n<ul>\n<li>Manage AWS user\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/IAM\/latest\/UserGuide\/Using_ManagingLogins.html\" rel=\"nofollow\"><em>credentials<\/em><\/a>\u00a0for Web console and API access<\/li>\n<li>Fine-grained access\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/IAM\/latest\/UserGuide\/policies.html\" rel=\"nofollow\"><em>policies<\/em><\/a>\u00a0to services and resources<\/li>\n<li><a href=\"http:\/\/docs.aws.amazon.com\/IAM\/latest\/UserGuide\/roles-toplevel.html\" rel=\"nofollow\"><em>Roles<\/em><\/a>\u00a0allow applications and external services to access resources<\/li>\n<li>Also\u00a0<a href=\"http:\/\/aws.amazon.com\/iam\/details\/mfa\/\" rel=\"nofollow\"><em>Multi-Factor Authentication (MFA)<\/em><\/a>\u00a0and\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/STS\/latest\/UsingSTS\/Welcome.html\" rel=\"nofollow\"><em>Security Token Service (STS)<\/em><\/a><\/li>\n<\/ul>\n<p>Notes: Always use roles inside instances (do not store credentials there), or\u00a0<a href=\"http:\/\/www.browserstack.com\/attack-and-downtime-on-9-November\" rel=\"nofollow\">something bad<\/a>\u00a0might happen.<\/p>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-quiz-users-on-many-levels\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#quiz-users-on-many-levels\" aria-hidden=\"true\"><\/a>Quiz: Users on many levels<\/h2>\n<p>Imagine running a content management system, discussion board or blog web application in EC2. How many\u00a0<strong>different types<\/strong>of user accounts you might have?<\/p>\n<hr \/>\n<h1><a id=\"user-content-virtual-private-cloud\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#virtual-private-cloud\" aria-hidden=\"true\"><\/a>Virtual Private Cloud<\/h1>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-virtual-private-cloud-vpc\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#virtual-private-cloud-vpc\" aria-hidden=\"true\"><\/a><a href=\"http:\/\/docs.aws.amazon.com\/AmazonVPC\/latest\/UserGuide\/VPC_Introduction.html\" rel=\"nofollow\">Virtual Private Cloud (VPC)<\/a><\/h2>\n<ul>\n<li>Heavy-weight virtual IP networking for EC2 and RDS instances. Integral part of modern AWS, all instances are launched into VPCs (<em>not true for\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/using-vpc.html\" rel=\"nofollow\">EC2-classic<\/a><\/em>)<\/li>\n<li>An AWS root account can have many VPCs, each in a specific region<\/li>\n<li>Each VPC is divided into\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AmazonVPC\/latest\/UserGuide\/VPC_Subnets.html\" rel=\"nofollow\"><em>subnets<\/em><\/a>, each bound to an availability zone<\/li>\n<li>Each instance connects to a subnet with a\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/using-eni.html\" rel=\"nofollow\"><em>Elastic Network Interface<\/em><\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/acl.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7519\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/acl.png\" alt=\"\" width=\"705\" height=\"642\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/acl.png 705w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/acl-300x273.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/acl-150x137.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/acl-400x364.png 400w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><\/a> <a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/VPC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7520\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/VPC.png\" alt=\"\" width=\"608\" height=\"500\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/VPC.png 608w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/VPC-300x247.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/VPC-150x123.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/VPC-400x329.png 400w\" sizes=\"(max-width: 608px) 100vw, 608px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/docs.aws.amazon.com\/AmazonVPC\/latest\/UserGuide\/VPC_Scenario2.html\" rel=\"nofollow\">VPC with Public and Private Subnets<\/a><\/p>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-access-control-lists\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#access-control-lists\" aria-hidden=\"true\"><\/a>Access Control Lists<\/h2>\n<ul>\n<li>Network\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AmazonVPC\/latest\/UserGuide\/VPC_ACLs.html\" rel=\"nofollow\"><em>Access Control List (ACL)<\/em><\/a>\u00a0provide a second layer of security<\/li>\n<li>See\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AmazonVPC\/latest\/UserGuide\/VPC_Security.html#VPC_Security_Comparison\" rel=\"nofollow\">Comparison of Security Groups and Network ACLs<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/acl2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7522\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/acl2.png\" alt=\"\" width=\"705\" height=\"642\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/acl2.png 705w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/acl2-300x273.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/acl2-150x137.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/acl2-400x364.png 400w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h1><a href=\"http:\/\/docs.aws.amazon.com\/AutoScaling\/latest\/DeveloperGuide\/WhatIsAutoScaling.html\" rel=\"nofollow\">Auto Scaling<\/a><\/h1>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/provisioning_elastic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7524\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/provisioning_elastic.png\" alt=\"\" width=\"1012\" height=\"317\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/provisioning_elastic.png 1012w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/provisioning_elastic-300x94.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/provisioning_elastic-768x241.png 768w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/provisioning_elastic-150x47.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/provisioning_elastic-400x125.png 400w\" sizes=\"(max-width: 1012px) 100vw, 1012px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Provisioning capacity as needed<\/p>\n<p>&#8212;<\/p>\n<ul>\n<li>Changing the instance type is vertical scaling (<em>scale up, scale down<\/em>)<\/li>\n<li>Adding or removing instances is horizontal scaling (<em>scale out, scale in<\/em>)<\/li>\n<li>1 instance 10 hours = 10 instances 1 hour<\/li>\n<\/ul>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-auto-scaling-instances\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#auto-scaling-instances\" aria-hidden=\"true\"><\/a>Auto Scaling instances<\/h2>\n<ul>\n<li><a href=\"http:\/\/docs.aws.amazon.com\/AutoScaling\/latest\/DeveloperGuide\/LaunchConfiguration.html\" rel=\"nofollow\"><em>Launch Configuration<\/em><\/a>\u00a0describes the configuration of the instance. Having a good AMI and bootstrapping is crucial.<\/li>\n<li><a href=\"http:\/\/docs.aws.amazon.com\/AutoScaling\/latest\/DeveloperGuide\/AutoScalingGroup.html\" rel=\"nofollow\"><em>Auto Scaling Group<\/em><\/a>\u00a0contains instances whose lifecycles are automatically managed by CloudWatch alarms or schedule<\/li>\n<li><a href=\"http:\/\/docs.aws.amazon.com\/AutoScaling\/latest\/DeveloperGuide\/scaling_typesof.html\" rel=\"nofollow\"><em>Scaling Plan<\/em><\/a>\u00a0refers when scaling happens and what triggers it.<\/li>\n<\/ul>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-scaling-plans\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#scaling-plans\" aria-hidden=\"true\"><\/a><a href=\"http:\/\/docs.aws.amazon.com\/AutoScaling\/latest\/DeveloperGuide\/scaling_typesof.html\" rel=\"nofollow\">Scaling Plans<\/a><\/h2>\n<ul>\n<li>Maintain current number of instances<\/li>\n<li>Manual scaling by user interaction or via API<\/li>\n<li>Scheduled scaling<\/li>\n<li><a href=\"http:\/\/docs.aws.amazon.com\/AutoScaling\/latest\/DeveloperGuide\/as-scale-based-on-demand.html\" rel=\"nofollow\">Dynamic Auto Scaling<\/a>. A\u00a0<em>scaling policy<\/em>\u00a0describes how the group scales in or out. You should always have policies for both directions.\u00a0<a href=\"http:\/\/docs.aws.amazon.com\/AutoScaling\/latest\/DeveloperGuide\/Cooldown.html\" rel=\"nofollow\"><em>Policy cooldowns<\/em><\/a>\u00a0control the rate in which scaling happens.<\/li>\n<\/ul>\n<p>&#8212;<\/p>\n<p><a href=\"https:\/\/camo.githubusercontent.com\/983c11d97ed5bff5ac0c6d400a80efe842e9e7c6\/687474703a2f2f646f63732e6177732e616d617a6f6e2e636f6d2f4175746f5363616c696e672f6c61746573742f446576656c6f70657247756964652f696d616765732f61732d6c6966656379636c652d62617369632d6469616772616d2e706e67\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/camo.githubusercontent.com\/983c11d97ed5bff5ac0c6d400a80efe842e9e7c6\/687474703a2f2f646f63732e6177732e616d617a6f6e2e636f6d2f4175746f5363616c696e672f6c61746573742f446576656c6f70657247756964652f696d616765732f61732d6c6966656379636c652d62617369632d6469616772616d2e706e67\" alt=\"Auto Scaling Group Lifecycle\" data-canonical-src=\"http:\/\/docs.aws.amazon.com\/AutoScaling\/latest\/DeveloperGuide\/images\/as-lifecycle-basic-diagram.png\" \/><\/a><\/p>\n<p><a href=\"http:\/\/docs.aws.amazon.com\/AutoScaling\/latest\/DeveloperGuide\/AutoScalingGroupLifecycle.html\" rel=\"nofollow\">Auto Scaling Group Lifecycle<\/a><\/p>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-elastic-load-balancer\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#elastic-load-balancer\" aria-hidden=\"true\"><\/a><a href=\"http:\/\/aws.amazon.com\/elasticloadbalancing\/\" rel=\"nofollow\">Elastic Load Balancer<\/a><\/h2>\n<ul>\n<li>Route traffic to an Auto Scaling Group (ASG)<\/li>\n<li>Runs health checks to instances to decide whether to route traffic to them<\/li>\n<li>Spread instances over multiple AZs for higher availability<\/li>\n<li>ELB scales itself. Never use ELB IP address. Pre-warm before flash traffic.<\/li>\n<\/ul>\n<p>&#8212;<a href=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/ELB.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-7526\" src=\"http:\/\/rmohan.com\/wp-content\/uploads\/2018\/06\/ELB.png\" alt=\"\" width=\"681\" height=\"659\" srcset=\"https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/ELB.png 681w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/ELB-300x290.png 300w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/ELB-150x145.png 150w, https:\/\/mohan.sg\/wp-content\/uploads\/2018\/06\/ELB-400x387.png 400w\" sizes=\"(max-width: 681px) 100vw, 681px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h1>Public networking<\/h1>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-route-53\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#route-53\" aria-hidden=\"true\"><\/a><a href=\"http:\/\/aws.amazon.com\/route53\/\" rel=\"nofollow\">Route 53<\/a><\/h2>\n<ul>\n<li>Domain Name System (DNS)<\/li>\n<li>Manage\u00a0<em>DNS records<\/em>\u00a0of\u00a0<em>hosted zones<\/em><\/li>\n<li>Round Robin, Weighted Round Robin and Latency-based routing<\/li>\n<\/ul>\n<p>&#8212;<\/p>\n<h2><a id=\"user-content-cloudfront\" class=\"anchor\" href=\"https:\/\/github.com\/gofore\/aws-training\/tree\/master\/docs\/02-compute#cloudfront\" aria-hidden=\"true\"><\/a><a href=\"http:\/\/aws.amazon.com\/cloudfront\/\" rel=\"nofollow\">CloudFront<\/a><\/h2>\n<ul>\n<li>Content Delivery Network (CDN)<\/li>\n<li>Replicate static content from S3 to edge locations<\/li>\n<li>Also supports dynamic and streaming content<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Amazon Web Services (AWS) Extensive set of cloud services available via the Internet On-demand, virtually endless, elastic resources Pay-per-use with no up-front costs (with optional commitment) Self-serviced and programmable <\/p>\n<p>&nbsp;<\/p>\n<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p> Elastic Compute Cloud (EC2) One of the core services of AWS Virtual machines (or instances) as a service Dozens of instance types [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7512"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7512"}],"version-history":[{"count":4,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7512\/revisions"}],"predecessor-version":[{"id":7527,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7512\/revisions\/7527"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}