{"id":2697,"date":"2018-02-03T20:02:31","date_gmt":"2018-02-03T20:02:31","guid":{"rendered":"http:\/\/blog.paranoidprofessor.com\/?p=2697"},"modified":"2018-06-13T18:25:11","modified_gmt":"2018-06-13T18:25:11","slug":"aws-setting-up-ec2","status":"publish","type":"post","link":"https:\/\/blog.paranoidprofessor.com\/index.php\/2018\/02\/03\/aws-setting-up-ec2\/","title":{"rendered":"AWS &#8211; Setting up EC2"},"content":{"rendered":"<h2>Elastic compute cloud<\/h2>\n<p>A EC2 &#8211; an elastic compute cloud &#8211; is just a simple virtual machine.\u00a0 Amazon does have a lot of really interesting ways of using virtual machines to solve problems.\u00a0 The first step is to create an EC2 instance.\u00a0 The steps to do this are as follows.<\/p>\n<div style=\"margin-left: 1cm;\">\n<ul>\n<li>Choose an AMI<\/li>\n<li>Choose an instance type<\/li>\n<li>Configure instance<\/li>\n<li>Add storage<\/li>\n<li>Add tags<\/li>\n<li>Configure Security group<\/li>\n<li>Review<\/li>\n<li>Generate key pair<\/li>\n<\/ul>\n<\/div>\n<h2>Choose an AMI<\/h2>\n<p>Amazon give the acronym AMI to represent all of the machine images that you can choose.\u00a0 Of course Amazon has their own Linux distribution but they also have a lot of other popular distributions available as well.<\/p>\n<div style=\"margin-left: 1cm;\">\n<ul>\n<li>Redhat<\/li>\n<li>SUSE<\/li>\n<li>Ubuntu<\/li>\n<li>Windows 2016 server<\/li>\n<\/ul>\n<\/div>\n<p>You can select whichever distribution you feel the most comfortable with.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2702\" src=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-01-ec2-launch-select-ami.png\" alt=\"\" width=\"1238\" height=\"742\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-01-ec2-launch-select-ami.png 1238w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-01-ec2-launch-select-ami-300x180.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-01-ec2-launch-select-ami-768x460.png 768w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-01-ec2-launch-select-ami-1024x614.png 1024w\" sizes=\"(max-width: 1238px) 100vw, 1238px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Choose an instance type<\/h2>\n<p>The next step is to select the resources that should be made available to the machine.\u00a0 The resources is all the same as for a physical computer.\u00a0 This is the number of cpu&#8217;s, or virtual cpu&#8217;s, the memory and disk space.\u00a0 I have chosen a small machine for testing.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2704\" src=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-02-ec2-launch-select-ami.png\" alt=\"\" width=\"1265\" height=\"513\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-02-ec2-launch-select-ami.png 1265w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-02-ec2-launch-select-ami-300x122.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-02-ec2-launch-select-ami-768x311.png 768w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-02-ec2-launch-select-ami-1024x415.png 1024w\" sizes=\"(max-width: 1265px) 100vw, 1265px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Configure instance<\/h2>\n<p>The next step is to select your vpc and which subnet (assuming more than one exists).\u00a0 Assuming you correctly did all of your steps correctly in creating it your virtual machine will get a public IP.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2705\" src=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-03-ec2-launch-select-configure.png\" alt=\"\" width=\"886\" height=\"700\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-03-ec2-launch-select-configure.png 886w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-03-ec2-launch-select-configure-300x237.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-03-ec2-launch-select-configure-768x607.png 768w\" sizes=\"(max-width: 886px) 100vw, 886px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Add storage<\/h2>\n<p>Your EC2 will already have a drive assigned to it.\u00a0 This is also were you could add additional volumes.\u00a0 I haven&#8217;t actually needed any permanent storage for my tests so I left the default for this, however, in the future I will write up an example adding additional storage.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2706\" src=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-04-ec2-launch-add-storage.png\" alt=\"\" width=\"1050\" height=\"325\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-04-ec2-launch-add-storage.png 1050w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-04-ec2-launch-add-storage-300x93.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-04-ec2-launch-add-storage-768x238.png 768w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-04-ec2-launch-add-storage-1024x317.png 1024w\" sizes=\"(max-width: 1050px) 100vw, 1050px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Add tags<\/h2>\n<p>This is a totally optional step.\u00a0 You can create a number of tags that will be displayed with your machine.\u00a0 I believe that these tags will also be on your billing statement.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2707\" src=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-05-ec2-launch-add-tags.png\" alt=\"\" width=\"1048\" height=\"307\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-05-ec2-launch-add-tags.png 1048w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-05-ec2-launch-add-tags-300x88.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-05-ec2-launch-add-tags-768x225.png 768w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-05-ec2-launch-add-tags-1024x300.png 1024w\" sizes=\"(max-width: 1048px) 100vw, 1048px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Configure Security group<\/h2>\n<p>At this point it is either possible to create a new security group or select the one that was created while creating your VPC.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2708\" src=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-06-ec2-launch-security-group.png\" alt=\"\" width=\"1130\" height=\"500\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-06-ec2-launch-security-group.png 1130w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-06-ec2-launch-security-group-300x133.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-06-ec2-launch-security-group-768x340.png 768w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-06-ec2-launch-security-group-1024x453.png 1024w\" sizes=\"(max-width: 1130px) 100vw, 1130px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Review<\/h2>\n<p>With these few steps done Amazon gives you a chance to review all of your settings before actually committing to this EC2 instance.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2709\" src=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-07-ec2-launch-review.png\" alt=\"\" width=\"1121\" height=\"930\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-07-ec2-launch-review.png 1121w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-07-ec2-launch-review-300x249.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-07-ec2-launch-review-768x637.png 768w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-07-ec2-launch-review-1024x850.png 1024w\" sizes=\"(max-width: 1121px) 100vw, 1121px\" \/><\/p>\n<h2><\/h2>\n<h2>Generate key pair<\/h2>\n<p>Oddly enough I would have thought that this step would have been before the review.\u00a0 The only way to connect to your machine is with a public \/ private key pair.<\/p>\n<p>This will be the only opportunity to download the key pair so you should save it in a good location.\u00a0 While creating other EC2 instances it is possible to either create another new pair or use an existing key pair.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2710\" src=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-08-ec2-launch-keypair.png\" alt=\"\" width=\"708\" height=\"522\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-08-ec2-launch-keypair.png 708w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-08-ec2-launch-keypair-300x221.png 300w\" sizes=\"(max-width: 708px) 100vw, 708px\" \/><\/p>\n<p>At this point when you press the &#8220;Launch Instances&#8221; button the EC2 instance is created.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2711\" src=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-09-ec2-launch-launched-status.png\" alt=\"\" width=\"1124\" height=\"730\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-09-ec2-launch-launched-status.png 1124w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-09-ec2-launch-launched-status-300x195.png 300w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-09-ec2-launch-launched-status-768x499.png 768w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-09-ec2-launch-launched-status-1024x665.png 1024w\" sizes=\"(max-width: 1124px) 100vw, 1124px\" \/><\/p>\n<p>Pressing the instances button will bring up the dashboard.<\/p>\n<p>&nbsp;<\/p>\n<h2>Dashboard<\/h2>\n<p>The dashboard will show all of the running, stopped or terminated instances.\u00a0 The terminated instances will be displayed for a short period of time and then eventually will be removed.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-2712\" src=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-10-ec2-launch-dashboard.png\" alt=\"\" width=\"867\" height=\"938\" srcset=\"https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-10-ec2-launch-dashboard.png 867w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-10-ec2-launch-dashboard-277x300.png 277w, https:\/\/blog.paranoidprofessor.com\/wp-content\/uploads\/2017\/11\/aws-10-ec2-launch-dashboard-768x831.png 768w\" sizes=\"(max-width: 867px) 100vw, 867px\" \/><\/p>\n<h2>Summary<\/h2>\n<p>Once your instance shows up on the dashboard as running you can then connect to it.\u00a0 Simply ssh to your virtual machine using your private key.\u00a0 In this example the machine name is rather a mouthful.<\/p>\n<p style=\"margin-left: 1cm;\">ec2-13-59-244-104-us-east-2.compute.amazonaws.com<\/p>\n<p>However, Amazon does make it easy to connect to your machine, well, if you happen to be using linux or unix.\u00a0 Simply select your machine and choose &#8220;connect&#8221; from the actions button at the top of the screen.\u00a0 This will bring up a dialog showing the actual command that you need to use to connect to the machine.<\/p>\n<pre>ssh -i\u00a0 \"apacheAMI.pem\" root@ec2-13-59-244-104-us-east-2.compute.amazonaws.com<\/pre>\n<p>If you are not actually using some flavor of unix you will need to do a few other small changes in order to connect to your machine, but Amazon is good enough to have a web page that <a href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/putty.html?icmpid=docs_ec2_console\" target=\"_blank\" rel=\"noopener\">documents this process<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Elastic compute cloud A EC2 &#8211; an elastic compute cloud &#8211; is just a simple virtual machine.\u00a0 Amazon does have a lot of really interesting ways of using virtual machines to solve problems.\u00a0 The first step is to create an &hellip; <a href=\"https:\/\/blog.paranoidprofessor.com\/index.php\/2018\/02\/03\/aws-setting-up-ec2\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[95,90,85],"_links":{"self":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/2697"}],"collection":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/comments?post=2697"}],"version-history":[{"count":9,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/2697\/revisions"}],"predecessor-version":[{"id":2895,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/posts\/2697\/revisions\/2895"}],"wp:attachment":[{"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/media?parent=2697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/categories?post=2697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.paranoidprofessor.com\/index.php\/wp-json\/wp\/v2\/tags?post=2697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}