﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Noah-文章分类-AWS</title><link>http://www.blogjava.net/Noah/category/55306.html</link><description>&lt;span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri" lang="ZH-CN"&gt;不是经典我不发&lt;/span&gt;</description><language>zh-cn</language><lastBuildDate>Thu, 19 Apr 2018 03:51:43 GMT</lastBuildDate><pubDate>Thu, 19 Apr 2018 03:51:43 GMT</pubDate><ttl>60</ttl><item><title>make application more distributed by issuing an Amazon S3 bucket event notification to an Amazon SNS topic</title><link>http://www.blogjava.net/Noah/articles/433175.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 03:30:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433175.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433175.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433175.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433175.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433175.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: In this exercise, you will make your application more distributed by issuing an Amazon S3 bucket event notification to an Amazon SNS topic whenever a photo is uploaded to the bucket. This triggers the...&nbsp;&nbsp;<a href='http://www.blogjava.net/Noah/articles/433175.html'>阅读全文</a><img src ="http://www.blogjava.net/Noah/aggbug/433175.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 11:30 <a href="http://www.blogjava.net/Noah/articles/433175.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> create an AWS Lambda function to make the application a distributed system</title><link>http://www.blogjava.net/Noah/articles/433174.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 03:26:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433174.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433174.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433174.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433174.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433174.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: In this exercise, you will create an AWS Lambda function to make the application a distributed system. This means that the photo labels being processed by Amazon Rekognition will now be processed in a...&nbsp;&nbsp;<a href='http://www.blogjava.net/Noah/articles/433174.html'>阅读全文</a><img src ="http://www.blogjava.net/Noah/aggbug/433174.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 11:26 <a href="http://www.blogjava.net/Noah/articles/433174.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>use AWS X-Ray to collect diagnostics information</title><link>http://www.blogjava.net/Noah/articles/433173.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 03:23:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433173.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433173.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433173.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433173.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433173.html</trackback:ping><description><![CDATA[<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this exercise, you will analyze and collect diagnostics information related to your application with AWS X-Ray. With AWS X-Ray, you can understand how your application and its underlying services are performing to identify and troubleshoot the root cause of performance issues. AWS X-Ray traces user requests as they travel through your entire application. It then aggregates the data generated by the individual services and resources that make up your application, providing you with a trace map of how your application is performing.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: Make sure to sign in to your AWS account with the AWS IAM user<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edXProjectUser</strong><span>&nbsp;</span>credentials.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>To begin, follow the steps below.</p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>1. Start the RDS database instance</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Relational Database Service</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Amazon RDS dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the left navigation pane, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instances</strong>. From the list of instances, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-photos-db</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">At the top, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instance actions</strong>, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Start</strong>.</li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>2. Download and explore the exercise code.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the command below in your AWS Cloud9 terminal to make sure you are in the ~/environment directory of your AWS Cloud9 instance. 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">cd ~/environment</code></li><li style="margin-bottom: 0.7em; line-height: 1.4em">In your AWS Cloud9 environment, download the exercise code by typing the command below in the terminal.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">wget<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://us-west-2-tcdev.s3.amazonaws.com/courses/AWS-100-ADG/v1.0.0/exercises/ex-xray.zip">https://us-west-2-tcdev.s3.amazonaws.com/courses/AWS-100-ADG/v1.0.0/exercises/ex-xray.zip</a></code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Unzip the exercise code .zip file by typing the command below in your AWS Cloud9 terminal.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">unzip ex-xray.zip</code></p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'>The contents of the .zip file should be extracted to a folder with a similar name. You can view the folder on the left tree view.</p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise-xray/FlaskApp/application.py</strong><span>&nbsp;</span>file and explore the code. Notice that the AWS X-Ray libraries, such as aws_xray_sdk.core, xray_recorder, and XRayMiddleware, are now being imported in the application.py file. AWS X-Ray is configured with XRayMiddleware to gather tracing information for different services and report the information back into the AWS cloud.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise-xray/util.py file</strong>. Notice that there is a<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">@xray_recorder.capture()<span>&nbsp;</span></strong>decorator, which captures the time needed to resize the uploaded photo to a desired size. This information is reported back to the AWS cloud.</li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>3. Download and run the AWS X-Ray daemon on your AWS Cloud9 instance.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">Go to the AWS X-Ray daemon documentation link below:<span>&nbsp;</span><br style="line-height: 1.4em" /><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html" target="&#8221;_blank&#8221;">https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html</a></li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the documentation page, scroll down until you see a link to<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Linux (executable)-aws-xray-daemon-linux-2.x.zip (sig)</strong>. Right-click the link and copy the link address.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In your AWS Cloud9 instance terminal, type the command below to go to your home directory.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">cd ~</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">wget</strong><span>&nbsp;</span>and paste the AWS X-Ray daemon hyperlink address that you copied. The command should look like the example below.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">wget<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://s3.dualstack.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-linux-2.x.zip">https://s3.dualstack.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-linux-2.x.zip</a></code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Unzip the AWS X-Ray daemon by typing the command below. Make sure that the name of the .zip file matches the one in the command below.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">unzip aws-xray-daemon-linux-2.x.zip</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Run the AWS X-Ray daemon by typing the command below.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">./xray</code></p></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>4. Run the exercise code and test the application.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">To run the exercise code, you will need to point the Run Configuration to the correct exercise folder. In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Python3RunConfiguration</strong><span>&nbsp;</span>pane at the bottom, in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Command</strong><span>&nbsp;</span>text box, type the text shown below and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Run</strong>.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">exercise-xray/FlaskApp/application.py</code></p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'>A message like the one below should appear.</p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">Running on http://0.0.0.0:5000/</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em"><strong style="font-weight: bold; line-height: 1.4em">Make sure to establish an SSH tunnel to your AWS Cloud9 instance</strong>. You may refer to the steps in the previous exercise for creating an SSH tunnel.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Open<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="http://localhost:5000/" target="_blank">http://localhost:5000</a>, log in to the application with your credentials, and upload a photo. Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">My photos</strong><span>&nbsp;</span>at the top-right corner of the application. You should see your uploaded photo.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Go to your AWS Cloud9 instance terminal and notice that the AWS X-Ray daemon is sending diagnostics information to your AWS account. You should see information as shown in the screenshot below.</li><img style="max-width: 100%; border-top: 0px; border-right: 0px; vertical-align: middle; border-bottom: 0px; border-left: 0px; line-height: 1.4em" src="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/Images/XRayTerminalInfo.jpg"  alt="" /></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>5. Explore the diagnostics information collected by AWS X-Ray.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">X-Ray</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">AWS X-Ray dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">If you are using AWS X-Ray for the first time, you may have to click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Get Started</strong><span>&nbsp;</span>and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Cancel</strong><span>&nbsp;</span>to exit the wizard.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Service map</strong><span>&nbsp;</span>in the left navigation menu. The service map has information about AWS services communicating with each other and the processing time each service needs.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the left side, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Traces</strong>. You should see response times and time taken by each component in the application.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Trace list</strong><span>&nbsp;</span>at the bottom, click the trace item where the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Method</strong><span>&nbsp;</span>column contains<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">POST</strong>. You should see timing information for all the calls made in your application, as shown in the screenshot below. This particular trace information should be about the POST made to the application to upload a photo. Notice the time needed for Amazon S3, Amazon RDS and Amazon Rekognition to process the photo. You can also see the time needed to resize the image against the resize_image label.<img style="max-width: 100%; border-top: 0px; border-right: 0px; vertical-align: middle; border-bottom: 0px; border-left: 0px; line-height: 1.4em" src="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/Images/XRayTraceInfo.jpg"  alt="" /></li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'>With this diagnostics information, you can now find out which component in your application is taking longer to process.</p></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>Optional Challenge 1</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>AWS X-Ray allows us to add searchable annotations to the trace segment. For more information, see<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-python-segment.html#xray-sdk-python-segment-annotations" target="_blank">Recording Annotations with the X-Ray SDK for Python</a>.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>The code below will pick up the current X-Ray segment from the xray_recorder.</p><code style="font-size: 20px; font-family: monospace, serif;background: rgb(255,255,255); white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 0px; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.4em; padding-right: 0px; text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial"><pre style="word-wrap: break-word; font-size: 1em; font-family: monospace, serif; white-space: pre-wrap; color: rgb(49,49,49); margin: 1em 0px; line-height: 1.4em">from aws_xray_sdk.core import xray_recorder
...
document = xray_recorder.current_segment()
</pre></code><span style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; float: none; font-weight: 400; color: rgb(34,34,34); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></span>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Inside the homepage route, can you add an annotation to the current segment containing the user's nickname? When this is reported back to AWS Cloud9, you will be able to search traces by username.</p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>Optional Challenge 2</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>AWS X-ray will capture and report exceptions. Can you add some code to create an exception - for example, a new route that simply divides a number by zero? Run this new code with X-Ray configured. You will see the stack trace captured and viewable in the X-Ray console.</p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>6. Stop the Amazon RDS database instance.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In order to keep your AWS account bill to a minimum, consider stopping the Amazon RDS instance and then starting it again when needed. Follow the steps below to stop the Amazon RDS database instance.</p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, go to the Amazon RDS dashboard.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the left navigation pane, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instances</strong>. From the list of instances, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-photos-db</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">At the top, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instance actions</strong>, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Stop</strong>. A prompt will appear. Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Yes, stop now</strong>.</li></ul><img src ="http://www.blogjava.net/Noah/aggbug/433173.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 11:23 <a href="http://www.blogjava.net/Noah/articles/433173.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>using Amazon Cognito</title><link>http://www.blogjava.net/Noah/articles/433172.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 03:22:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433172.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433172.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433172.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433172.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433172.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: In this exercise, you will add a sign-up/sign-in component to your application by using Amazon Cognito. After setting up Amazon Cognito, the photos will get stored to/retrieved from the user created i...&nbsp;&nbsp;<a href='http://www.blogjava.net/Noah/articles/433172.html'>阅读全文</a><img src ="http://www.blogjava.net/Noah/aggbug/433172.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 11:22 <a href="http://www.blogjava.net/Noah/articles/433172.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>deploy the application to two Amazon EC2 instances</title><link>http://www.blogjava.net/Noah/articles/433171.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 03:20:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433171.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433171.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433171.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433171.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433171.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: In this exercise, you will deploy the application to two Amazon EC2 instances to make the application highly available. You will also create and configure an Application Load Balancer to route the web...&nbsp;&nbsp;<a href='http://www.blogjava.net/Noah/articles/433171.html'>阅读全文</a><img src ="http://www.blogjava.net/Noah/aggbug/433171.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 11:20 <a href="http://www.blogjava.net/Noah/articles/433171.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>create an Amazon RDS database instance</title><link>http://www.blogjava.net/Noah/articles/433170.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 03:18:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433170.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433170.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433170.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433170.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433170.html</trackback:ping><description><![CDATA[<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this exercise, you will create an Amazon RDS database instance and store the Amazon S3 object key for the photo and photo labels in the database. This way, you are storing your data in a more structured format and making the application scalable.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: Make sure to sign in to your AWS account with the AWS IAM user<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edXProjectUser</strong><span>&nbsp;</span>credentials.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>To get started, follow the instructions below.</p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>1. Create an Amazon RDS database instance.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will create an Amazon RDS instance with the properties shown below to store photos and labels. If you are familiar with Amazon RDS, you may want to attempt to complete this section before reading the step-by-step instructions.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Region: Oregon (us-west-2)<br style="line-height: 1.4em" />Amazon RDS Instance type: MySQL (free tier eligible)<br style="line-height: 1.4em" />Name of DB instance: edx-photos-db<span>&nbsp;</span><br style="line-height: 1.4em" />Master username: master<span>&nbsp;</span><br style="line-height: 1.4em" />Master user password: Type a master user password and write it down for later use.<br style="line-height: 1.4em" />VPC: edx-build-aws-vpc<span>&nbsp;</span><br style="line-height: 1.4em" />Database name: Photos<br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Important: Make a note of the database endpoint.</strong></p><br /><details style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(34,34,34); font-style: normal; text-align: left; orphans: 2; widows: 2; display: block; letter-spacing: normal; line-height: 1.4em; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial' open=""> 
<div id="details-content">
<ul style="color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 1em; margin: 1em 0px; list-style: disc none outside; line-height: 1.4em; padding-right: 0px"><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Relational Database Service</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Amazon RDS dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Make sure you are still in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Oregon</strong><span>&nbsp;</span>AWS Region.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the left navigation menu, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instances</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch DB instance</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Scroll down to the bottom and select the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Only enable options eligible for RDS free usage tier<span>&nbsp;</span></strong>option.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Scroll back to the top and select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">MySQL</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Leave the default selections and scroll down to<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Settings</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">DB instance identifier</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-photos-db</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Master username</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">master</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Type a<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">password</strong><span>&nbsp;</span>for the master user and confirm the password.<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Make a note</strong><span>&nbsp;</span>of the password for later use.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Network &amp; Security<span>&nbsp;</span></strong>section, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-build-aws-vpc</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Scroll down to<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Database options</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Database name</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Photos</strong>.<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Make a note</strong><span>&nbsp;</span>of the database name for later use.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Leave the rest of the default settings, scroll down to the bottom and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch DB instance</strong>.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: It should take about five minutes for the instance to launch.</p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">View DB instance details</strong><span>&nbsp;</span>to go to the DB instance details page.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">After the instance launches, scroll down to the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Connect</strong><span>&nbsp;</span>section and make a note of the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Endpoint</strong><span>&nbsp;</span>for later use.<span>&nbsp;</span><br style="line-height: 1.4em" />The endpoint will look like this:<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">sample.cppyk3cpwnox.us-west-2.rds.amazonaws.com</strong>.</li></ul></div></details>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>2. Modify the security group of the Amazon RDS database.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will modify the security group of the Amazon RDS instance to the security group of the AWS Cloud9 instance.</p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">On the Amazon RDS database instance page, scroll down to the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Details</strong><span>&nbsp;</span>section.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Under<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Security and network</strong>, click the security group. The security group should have a name like<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">rds-launch-wizard-xxx</strong>. A new page displaying the security group you just clicked should open.</li><li style="margin-bottom: 0.7em; line-height: 1.4em"><strong style="font-weight: bold; line-height: 1.4em">Make a note</strong><span>&nbsp;</span>of the security group ID. You will need it in subsequent exercises.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the bottom pane, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Inbound</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Edit</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Source</strong><span>&nbsp;</span>textbox, delete the existing text and type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">sg</strong>. A list of security groups will appear. Select the security group that contains your AWS Cloud9 environment name.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Save</strong>.</li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>3. Download the exercise code .zip file and unzip it to your AWS Cloud9 environment.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will download the exercise code .zip file and unzip it to your AWS Cloud9 environment. If you feel familiar with the AWS Cloud9 environment from the previous few exercises, you may want to attempt to complete this section before reading the step-by-step instructions.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Exercise code:<span>&nbsp;</span><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">wget<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/ex-rds.zip">https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/ex-rds.zip</a></code><span>&nbsp;</span><br style="line-height: 1.4em" />Unzip command:<span>&nbsp;</span><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">unzip ex-rds.zip</code></p><br /><details style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(34,34,34); font-style: normal; text-align: left; orphans: 2; widows: 2; display: block; letter-spacing: normal; line-height: 1.4em; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial' open=""> 
<div id="details-content">
<ul style="color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 1em; margin: 1em 0px; list-style: disc none outside; line-height: 1.4em; padding-right: 0px"><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the command below in your AWS Cloud9 terminal to make sure you are in the ~/environment directory of your AWS Cloud9 instance. 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">cd ~/environment</code></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the command below in your AWS Cloud9 terminal to download the Python code for the Amazon RDS database component.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">wget<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/ex-rds.zip">https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/ex-rds.zip</a></code></p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'>On the left tree view, you should see the exercise code .zip file named<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">ex-rds.zip</strong>.</p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Unzip the exercise code zip file by typing the command below on your Cloud9 terminal.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">unzip ex-rds.zip</code></p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'>The contents of the .zip file should be extracted to a folder with a similar name. You can view the folder on the left tree view.</p></ul></div></details>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>4. Explore the exercise code.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In your AWS Cloud9 environment, on the left tree view, notice the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise-rds/SetupScripts/database_create_tables.py</strong><span>&nbsp;</span>file. This script creates the database tables needed for the application. The photo table stores the photos and labels information. The web_user is a restricted privilege user who has access solely to the photos table. The web application is configured to use the web_user and not the master user.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise-rds/FlaskApp/database.py</strong><span>&nbsp;</span>file and explore the code for adding a photo to the database and fetching it back from the database.</li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>5. Run the database script.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">To run the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">database_create_tables.py<span>&nbsp;</span></strong>script, type the command below in your AWS Cloud9 terminal window.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">python3 exercise-rds/SetupScripts/database_create_tables.py</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">You should see a prompt on the screen to configure the database information. Follow the prompts and enter the information as shown below.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Database host</strong>: Paste the database endpoint you noted earlier.<br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Database user</strong>: master<br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Database password</strong>: Type the password for the master user.<br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Database name</strong>: Photos<br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">web_user password</strong>: Type a password for the web_user.<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Make a note</strong><span>&nbsp;</span>of the web_user password for later use.<br style="line-height: 1.4em" />
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'>You should see a message that a web_user is created with the required access granted to it.</p></li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>6. Configure environment variables and run and test the code.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">For the code to run successfully, you will need to configure the environment variables with the database details. Under the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">FlaskApp</strong><span>&nbsp;</span>folder, open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">config.py</strong><span>&nbsp;</span>file. Notice that the config.py file is now updated with the database-related environment variables.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In your AWS Cloud9 environment, on the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Run Configuration</strong><span>&nbsp;</span>pane at the bottom, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">ENV</strong><span>&nbsp;</span>on the right side. You should see a small list showing the previously configured environment variables.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">To configure the database environment variables, type the environment variable<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Name</strong><span>&nbsp;</span>and<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Value</strong><span>&nbsp;</span>as shown in the table below: 
<table style="font-size: 16px; border-top: black 1px solid; border-right: black 1px solid; width: 1059px; border-collapse: collapse; table-layout: auto; border-bottom: black 1px solid; margin: 20px 0px; border-spacing: 0px; border-left: black 1px solid; line-height: 1.4em">
<tbody style="line-height: 1.4em">
<tr style="line-height: 1.4em">
<td style="font-size: 14px; border-top: rgb(200,200,200) 1px solid; border-right: rgb(200,200,200) 1px solid; vertical-align: top; border-bottom: rgb(200,200,200) 1px solid; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; margin: 20px 0px; border-left: rgb(200,200,200) 1px solid; line-height: 1.4em; padding-right: 10px" width="162"><strong style="font-weight: bold; line-height: 1.4em">Name</strong></td>
<td style="font-size: 14px; border-top: rgb(200,200,200) 1px solid; border-right: rgb(200,200,200) 1px solid; vertical-align: top; border-bottom: rgb(200,200,200) 1px solid; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; margin: 20px 0px; border-left: rgb(200,200,200) 1px solid; line-height: 1.4em; padding-right: 10px" width="262"><strong style="font-weight: bold; line-height: 1.4em">Value</strong></td></tr>
<tr style="line-height: 1.4em">
<td style="font-size: 14px; border-top: rgb(200,200,200) 1px solid; border-right: rgb(200,200,200) 1px solid; vertical-align: top; border-bottom: rgb(200,200,200) 1px solid; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; margin: 20px 0px; border-left: rgb(200,200,200) 1px solid; line-height: 1.4em; padding-right: 10px" width="162">DATABASE_HOST</td>
<td style="font-size: 14px; border-top: rgb(200,200,200) 1px solid; border-right: rgb(200,200,200) 1px solid; vertical-align: top; border-bottom: rgb(200,200,200) 1px solid; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; margin: 20px 0px; border-left: rgb(200,200,200) 1px solid; line-height: 1.4em; padding-right: 10px" width="262">Database endpoint you noted earlier</td></tr>
<tr style="line-height: 1.4em">
<td style="font-size: 14px; border-top: rgb(200,200,200) 1px solid; border-right: rgb(200,200,200) 1px solid; vertical-align: top; border-bottom: rgb(200,200,200) 1px solid; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; margin: 20px 0px; border-left: rgb(200,200,200) 1px solid; line-height: 1.4em; padding-right: 10px" width="162">DATABASE_USER</td>
<td style="font-size: 14px; border-top: rgb(200,200,200) 1px solid; border-right: rgb(200,200,200) 1px solid; vertical-align: top; border-bottom: rgb(200,200,200) 1px solid; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; margin: 20px 0px; border-left: rgb(200,200,200) 1px solid; line-height: 1.4em; padding-right: 10px" width="262">web_user</td></tr>
<tr style="line-height: 1.4em">
<td style="font-size: 14px; border-top: rgb(200,200,200) 1px solid; border-right: rgb(200,200,200) 1px solid; vertical-align: top; border-bottom: rgb(200,200,200) 1px solid; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; margin: 20px 0px; border-left: rgb(200,200,200) 1px solid; line-height: 1.4em; padding-right: 10px" width="162">DATABASE_PASSWORD</td>
<td style="font-size: 14px; border-top: rgb(200,200,200) 1px solid; border-right: rgb(200,200,200) 1px solid; vertical-align: top; border-bottom: rgb(200,200,200) 1px solid; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; margin: 20px 0px; border-left: rgb(200,200,200) 1px solid; line-height: 1.4em; padding-right: 10px" width="262">Password for the web_user you noted earlier</td></tr>
<tr style="line-height: 1.4em">
<td style="font-size: 14px; border-top: rgb(200,200,200) 1px solid; border-right: rgb(200,200,200) 1px solid; vertical-align: top; border-bottom: rgb(200,200,200) 1px solid; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; margin: 20px 0px; border-left: rgb(200,200,200) 1px solid; line-height: 1.4em; padding-right: 10px" width="162">DATABASE_DB_NAME</td>
<td style="font-size: 14px; border-top: rgb(200,200,200) 1px solid; border-right: rgb(200,200,200) 1px solid; vertical-align: top; border-bottom: rgb(200,200,200) 1px solid; padding-bottom: 10px; padding-top: 10px; padding-left: 10px; margin: 20px 0px; border-left: rgb(200,200,200) 1px solid; line-height: 1.4em; padding-right: 10px" width="262">Photos</td></tr></tbody></table>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: Make sure to delete any white space inserted while copy/pasting.</p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">To run the code, you will need to point the Run Configuration to the correct exercise folder. On<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Python3RunConfiguration</strong><span>&nbsp;</span>pane at the bottom, in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Command</strong><span>&nbsp;</span>textbox, type the text shown below and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Run</strong><span>&nbsp;</span>on the left side.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">exercise-rds/FlaskApp/application.py</code></p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'>You should see a message like this one:</p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">Running on http://0.0.0.0:5000</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">To test the code, go to your browser and type the IP address of the AWS Cloud9 environment. At the end of the IP address, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">:5000</strong><span>&nbsp;</span><br style="line-height: 1.4em" />You should see the application running on port 5000.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Home</strong><span>&nbsp;</span>and upload a photo. You should see the photo and the Amazon Rekognition labels generated for the photo.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Home</strong>. You should see a table with the thumbnail for the photo and the label information. This information is being fetched from the database.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Try uploading a few more photos and watch as the table on the Home page is populated with the information saved in the database.</li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>Optional Challenge</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>There is a command line mysql client on your Cloud9 instance.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>The mysql client takes parameters for the database host and user. A "-p" switch tells the client to prompt you for a password. To connect to your RDS database, run the command below (replace DATABASE_HOST with your RDS database endpoint).</p><code style="font-size: 20px; font-family: monospace, serif;background: rgb(255,255,255); white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 0px; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.4em; padding-right: 0px; text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial">mysql -h DATABASE_HOST -u web_user -p</code> 
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Can you<span>&nbsp;</span><em style="font-style: italic; line-height: 1.4em">SELECT</em><span>&nbsp;</span>the contents of the photo table?</p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>7. Stop the Amazon RDS database instance.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>To keep your AWS account bill to a minimum, consider stopping the Amazon RDS instance and then starting it again when needed. Follow the steps below to stop the Amazon RDS database instance.</p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Relational Database Service</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Amazon RDS dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the left navigation pane, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instances</strong>. From the list of instances, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-photos-db</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">At the top, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instance actions -&gt; Stop</strong>. You will get a prompt. Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Yes, stop now</strong>.</li></ul><img src ="http://www.blogjava.net/Noah/aggbug/433170.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 11:18 <a href="http://www.blogjava.net/Noah/articles/433170.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>adding the Amazon Rekognition component</title><link>http://www.blogjava.net/Noah/articles/433169.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 03:16:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433169.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433169.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433169.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433169.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433169.html</trackback:ping><description><![CDATA[<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this exercise, you will extend the application by adding the Amazon Rekognition component. As soon as you upload a photo to your Amazon S3 bucket, Amazon Rekognition processes the photo and identifies objects, people, text, scenes, and activities in the photo and labels it accordingly.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: Make sure to sign in to your AWS account with the AWS IAM user<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edXProjectUser</strong><span>&nbsp;</span>credentials.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>To get started, follow the instructions below.</p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>1. Download the exercise code .zip file to your AWS Cloud9 environment.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the command below in your AWS Cloud9 terminal to make sure you are in the ~/environment directory of your AWS Cloud9 instance. 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">cd ~/environment</code></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the command below in your AWS Cloud9 terminal to download the python code for the Amazon Rekognition component.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">wget<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/ex-rekognition.zip">https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/ex-rekognition.zip</a></code></p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'>On the left tree view, you should see the exercise code .zip file named<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">ex-rekognition.zip</strong>.</p></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>2. Unzip the exercise code .zip file.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">Unzip the exercise code .zip file by typing the command below on your AWS Cloud9 terminal.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">unzip ex-rekognition.zip</code></p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'>The contents of the .zip file should be extracted to a folder with a similar name. You can view the folder on the left tree view.</p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">You may want to close any tabs that remain open from previous exercises.</li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>3. Explore the exercise code.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">Open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise-rekognition/FlaskApp/application.py</strong><span>&nbsp;</span>file.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Homepage route function</strong>, notice that a Boto 3 client for Amazon Rekognition is created. The image uploaded in the Amazon S3 bucket is passed to the detect_labels API, which returns a list of labels processed by Amazon Rekognition. These labels are then populated on the UI.</li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>4. Run and test the code.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">To run the application.py code, on the top menu bar, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Run -&gt; Run Configurations -&gt; Python3RunConfiguration</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em"><strong style="font-weight: bold; line-height: 1.4em">Important</strong>: Notice that the run configuration runs the application.py for the previous exercise.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Point the run configuration to the correct exercise folder by editing the folder path in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Command<span>&nbsp;</span></strong>text box in the bottom pane.<br style="line-height: 1.4em" />In that text box, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise-rekognition/FlaskApp/application.py</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Run</strong><span>&nbsp;</span>on the left side. You should see a message like this:</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">Running on http://0.0.0.0:5000/</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Go to your browser and type the IP address of the Amazon EC2 instance that hosts your AWS Cloud9 environment. At the end of the IP address, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">:5000</strong> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'>The application should now have the functionality related to Amazon Rekognition.</p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">To test the Amazon Rekognition component, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Home</strong><span>&nbsp;</span>on the application.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Upload an image. Amazon Rekognition should label the image with the image properties.</li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>Optional Challenge</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>The Boto 3<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="http://boto3.readthedocs.io/en/latest/reference/services/rekognition.html#Rekognition.Client.detect_labels" target="_blank">detect_labels</a><span>&nbsp;</span>response includes a<span>&nbsp;</span><em style="font-style: italic; line-height: 1.4em">Confidence</em><span>&nbsp;</span>value. Can you update the application UI to include the<span>&nbsp;</span><em style="font-style: italic; line-height: 1.4em">Confidence</em>? Or define a threshold and only display labels over the confidence threshold?</p><img src ="http://www.blogjava.net/Noah/aggbug/433169.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 11:16 <a href="http://www.blogjava.net/Noah/articles/433169.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>create AWS Cloud9 environment</title><link>http://www.blogjava.net/Noah/articles/433168.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 03:15:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433168.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433168.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433168.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433168.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433168.html</trackback:ping><description><![CDATA[<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this exercise, you will create your first AWS Cloud9 environment and start building the first component of the course project. AWS Cloud9 is a cloud-based IDE that lets you write, run, and debug your code with just a browser.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: Make sure to sign in to your AWS account with the AWS IAM user<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edXProjectUser</strong><span>&nbsp;</span>credentials.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><strong style="font-weight: bold; line-height: 1.4em">Architecture Diagram</strong></p><img style='font-size: 20px; max-width: 100%; border-top: 0px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; border-right: 0px; vertical-align: middle; white-space: normal; word-spacing: 0px; border-bottom: 0px; text-transform: none; font-weight: 400; color: rgb(34,34,34); font-style: normal; text-align: left; border-left: 0px; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.4em; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial' alt="Architecture Diagram" src="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/Arch+Diagram.jpg" /><span style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; float: none; font-weight: 400; color: rgb(34,34,34); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></span> 
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>The diagram shown above is the architecture diagram for the application you will build over the duration of the course. The course project is a simple web application in which users log in to their accounts and upload photos to an Amazon S3 bucket, process the photos with Amazon Rekognition to generate labels and then store the photos along with their labels and description in an Amazon RDS database.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>The application is deployed on an Amazon EC2 instance with an Application Load Balancer sitting in front of the instance to direct user requests to the instance. Amazon Cognito is used to sign up/sign in users for the application. In order to asynchronously process the photo labels, when a photo is uploaded, an Amazon S3 bucket event notification is issued to an Amazon SNS topic. This triggers a subscribed AWS Lambda function, which talks to Amazon Rekognition. To make the application more distributed, an Amazon SQS queue subscribed to the Amazon SNS topic stores all the incoming requests and an on-premises application polls the queue for processing. AWS X-Ray traces the calls made to all the AWS resources in this application, thereby providing diagnostics information. The application is coded in Python 3 using AWS Cloud9 as the IDE.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this exercise, you will build the Amazon S3 uploader component of the application. In this component, users will upload a photo to an Amazon S3 bucket.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>To begin, follow the instructions below.</p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>1. Create AWS Cloud9 environment and explore the environment.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will create an AWS Cloud9 environment and explore the environment.</p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Cloud9</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Cloud9 dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Make sure you are in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Oregon</strong><span>&nbsp;</span>region.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create environment</strong><span>&nbsp;</span>at the top-right corner.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Name</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">BuildingOnAWS</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next step</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Configure settings</strong><span>&nbsp;</span>page, leave the default selection in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Environment settings</strong><span>&nbsp;</span>section and scroll down to<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Network settings (advanced)</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Network (VPC)</strong>, choose the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-build-aws-vpc id</strong><span>&nbsp;</span>you wrote down in the third exercise.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Subnet</strong>, choose the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">public subnet</strong><span>&nbsp;</span>in edx-build-aws-vpc with the subnet-id you noted in the third exercise.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next step</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Review the details and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create environment</strong>. This should launch your AWS Cloud9 environment in a few minutes.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Upon environment creation, notice the terminal window on the bottom pane. The terminal provides a remote login to the instance on which the AWS Cloud9 environment is hosted, just as you used SSH for remote login in the third exercise. A pre-authenticated AWS CLI is installed in your terminal.</li><li style="margin-bottom: 0.7em; line-height: 1.4em"><strong style="font-weight: bold; line-height: 1.4em">Explore the terminal</strong><span>&nbsp;</span>by typing this command: 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">aws ec2 describe-instances</code> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p>This should give a JSON output with the all the information of the EC2 instances in your account.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Install<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Boto 3</strong><span>&nbsp;</span>on your AWS Cloud9 instance by typing this command:</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">sudo pip-3.6 install boto3</code> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">At the terminal, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">python3</strong><span>&nbsp;</span>and press ENTER.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Explore the Python Boto 3 APIs by executing these commands:</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">import boto3<br style="line-height: 1.4em" />client = boto3.client('ec2')<br style="line-height: 1.4em" />client.describe_instances()</code> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Press<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">CTRL+D</strong><span>&nbsp;</span>to exit the Python interpreter.</li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>2. Create an Amazon S3 bucket to store the application photos.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will create an Amazon S3 bucket in your AWS account. This bucket will store your application photos. If you are familiar with Amazon S3, you may want to attempt to complete this section by using the properties below before reading the step-by-step instructions.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Region: Oregon (us-west-2)<span>&nbsp;</span><br style="line-height: 1.4em" />Bucket name: Type a unique bucket name to store photos and make a note of it for later use.<span>&nbsp;</span></p><details style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(34,34,34); font-style: normal; text-align: left; orphans: 2; widows: 2; display: block; letter-spacing: normal; line-height: 1.4em; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial' open=""> 
<div id="details-content">
<ul style="color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 1em; margin: 1em 0px; list-style: disc none outside; line-height: 1.4em; padding-right: 0px"><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">S3</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">S3 dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create bucket</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Bucket name</strong>, type a unique bucket name to store photos. Write down the name of the bucket for later use.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Region</strong>, make sure you have selected the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Oregon (us-west-2)</strong><span>&nbsp;</span>region.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create</strong>.</li></ul></div></details>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>3. Build the Amazon S3 uploader component of the application in the AWS Cloud9 environment.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will build the Amazon S3 uploader component of the application. The Amazon S3 uploader component uploads photos to the Amazon S3 bucket you created in the previous section.</p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the command below in your AWS Cloud9 terminal to make sure you are in the ~/environment directory of your AWS Cloud9 instance. 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">cd ~/environment</code></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the command below in your AWS Cloud9 terminal to download the Python code for the Amazon S3 uploader component. 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">wget<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://us-west-2-tcdev.s3.amazonaws.com/courses/AWS-100-ADG/v1.0.0/exercises/ex-s3-upload.zip">https://us-west-2-tcdev.s3.amazonaws.com/courses/AWS-100-ADG/v1.0.0/exercises/ex-s3-upload.zip</a></code> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p>On the left tree view, you should see the exercise code .zip file named<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">ex-s3-upload.zip</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Unzip the exercise code .zip file by typing the command below in your AWS Cloud9 terminal. 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">unzip ex-s3-upload.zip</code> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p>The contents of the .zip file should be extracted to a folder with a similar name. You can view the folder on the left tree view.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise-s3-upload/FlaskApp/application.py</strong><span>&nbsp;</span>file and review the code. Notice that an Amazon S3 client has been created to interact with Amazon S3 via the Boto 3 API.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Install the requirements for the project by executing the command below in your AWS Cloud9 terminal.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">sudo pip-3.6 install -r exercise-s3-upload/FlaskApp/requirements.txt</code> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">To run the application.py code: 
<ul style="color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 1em; margin: 1em 0px; list-style: disc none outside; line-height: 1.4em; padding-right: 0px"><li style="margin-bottom: 0.7em; line-height: 1.4em">Select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise-s3-upload/FlaskApp/application.py</strong><span>&nbsp;</span>in the tree view.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the top menu bar, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Run -&gt; Run With -&gt; Python 3</strong>. Ensure that you are using the Python 3 runner, as shown in the screenshot below.<span>&nbsp;</span><br style="line-height: 1.4em" /><img style="max-width: 100%; border-top: 0px; border-right: 0px; vertical-align: middle; border-bottom: 0px; border-left: 0px; line-height: 1.4em" src="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/Images/C9_Py3Runner.jpg"  alt="" /></li><li style="margin-bottom: 0.7em; line-height: 1.4em">You should see an error message asking for an environment variable named PHOTOS_BUCKET.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">To successfully run the code, you will need to set environment variables. To do so, follow the instructions below:</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the right side of the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Run Configuration</strong><span>&nbsp;</span>pane at the bottom, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">ENV</strong>, as in the screenshot below.<span>&nbsp;</span><br style="line-height: 1.4em" /><img style="max-width: 100%; border-top: 0px; border-right: 0px; vertical-align: middle; border-bottom: 0px; border-left: 0px; line-height: 1.4em" src="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/Images/C9_ENV.jpg"  alt="" /></li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Name</strong><span>&nbsp;</span>column, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">PHOTOS_BUCKET</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Value</strong><span>&nbsp;</span>column, type the name of the Amazon S3 bucket you created earlier.<br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: Make sure to delete any white space that was inserted while copy/pasting.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Name</strong><span>&nbsp;</span>column, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">FLASK_SECRET</strong><br style="line-height: 1.4em" />The Flask app uses a secret value to encrypt session variables.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Value</strong><span>&nbsp;</span>column, type random characters and numbers.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Save the run configuration by typing a name for the configuration. This saves the run configuration with all the environment variables and the runner information. In the text box next to the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Run</strong><span>&nbsp;</span>button, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Python3RunConfiguration</strong>, as shown in the screenshot below.<br style="line-height: 1.4em" /><img style="max-width: 100%; border-top: 0px; border-right: 0px; vertical-align: middle; border-bottom: 0px; border-left: 0px; line-height: 1.4em" src="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/Images/C9_PyRunConfig.jpg"  alt="" /></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Run application.py again. This time, it should run successfully. In the terminal, you will see a message like this:<span>&nbsp;</span><br style="line-height: 1.4em" />
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">Running on http://0.0.0.0:5000/</code> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p>That means the Python Flask app is now running on port 5000 of the AWS Cloud9 instance.</li></ul></li><li style="margin-bottom: 0.7em; line-height: 1.4em">To verify that the app is running, you will need to edit the security group of the AWS Cloud9 instance. Go to the EC2 dashboard, locate your AWS Cloud9 instance, and select it.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Description</strong><span>&nbsp;</span>pane at the bottom, click the security group hyperlink. This should open up the security group associated with the AWS Cloud9 instance.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the bottom pane, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Inbound</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Edit</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Add Rule</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Port Range</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">5000</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Source</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">0.0.0.0/0</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Save</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Return to your AWS Cloud9 environment. On the top-right corner, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Share</strong>, as shown in the screenshot below.<img style="max-width: 100%; border-top: 0px; border-right: 0px; vertical-align: middle; border-bottom: 0px; border-left: 0px; line-height: 1.4em" src="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/Images/C9_ShareButton.jpg"  alt="" /></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Copy the IP address displayed in front of<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Application</strong>. This is the public IP address of the AWS Cloud9 instance.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Go to your browser and type the IP address of the AWS Cloud9 instance followed by<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">:5000</strong><span>&nbsp;</span>The uploaded component of the project is now up and running!</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Try uploading a few photos via the app. You will notice that the photos are stored in the Amazon S3 bucket that you created earlier.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: Your AWS Cloud9 instance has been configured to auto-hibernate your environment to prevent unnecessary charges.</li></ul>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>Optional Challenge</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>The Boto 3<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="http://boto3.readthedocs.io/en/latest/reference/services/s3.html#S3.Client.list_objects" target="_blank">list_objects</a><span>&nbsp;</span>method returns a LastModified property. Can you update the application to display photos in LastModified order?</p><br /><img src ="http://www.blogjava.net/Noah/aggbug/433168.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 11:15 <a href="http://www.blogjava.net/Noah/articles/433168.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>create AWS IAM user</title><link>http://www.blogjava.net/Noah/articles/433167.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 03:12:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433167.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433167.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433167.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433167.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433167.html</trackback:ping><description><![CDATA[<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>As you learned in the lecture, you should not use your AWS account root user credentials to access AWS. Instead, create an AWS IAM user and assign permissions only necessary for the work done by the user. In this exercise, you will create an AWS IAM user, attach a customer managed AWS IAM policy to the user and set up access keys for the AWS IAM user.</p><li style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(34,34,34); font-style: normal; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.4em; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>An AWS IAM user is an entity that you create in AWS to represent the person or service that uses it to interact with AWS. You attach permission policies to the IAM user that determine what the user can and cannot do in AWS.</li><li style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(34,34,34); font-style: normal; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.4em; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Access keys are a combination of an access key ID and a secret access key that are assigned to a user. These can be used to make programmatic calls to AWS when using the API in program code or at a command prompt when using the AWS CLI.</li><li style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(34,34,34); font-style: normal; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.4em; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><strong style="font-weight: bold; line-height: 1.4em">For all subsequent exercises, make sure to log in with the AWS IAM user credentials you create in this exercise, rather than the root user credentials.</strong> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'>You will also create an Amazon EC2 instance, SSH into the instance, and configure AWS CLI to explore the AWS CLI commands. Then you will install Boto 3 on the instance and try out some Python scripting on the terminal. Boto 3 is the AWS SDK for Python, making it easier to integrate your Python application, library, or script with AWS services.</p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'>To begin, follow the instructions below.</p>
<h3 style='color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; font-stretch: normal'>1. Create an AWS IAM policy.</h3>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'>In this section, you will create an AWS IAM customer-managed policy. Customer-managed policies provide more precise control over your policies than AWS managed policies. This policy will have permissions specific to the AWS resources needed for the application you will build in this course.</p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'></p>
<ul style="color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 1em; margin: 1em 0px; list-style: disc none outside; line-height: 1.4em; padding-right: 0px"><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Management Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">IAM</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">IAM dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the left navigation menu, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Policies</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create policy</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">JSON</strong><span>&nbsp;</span>tab.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the editor textbox, completely replace the sample policy with the following.</li><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px"><pre style="word-wrap: break-word; font-size: 1em; font-family: monospace, serif; white-space: pre-wrap; color: rgb(49,49,49); margin: 1em 0px; line-height: 1.4em">{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Sid1",
            "Effect": "Allow",
            "Action": [
                "iam:*",
                "rds:*",
                "sns:*",
                "cloudformation:*",
                "rekognition:*",
                "ec2:*",
                "cognito-idp:*",
                "sqs:*",
                "xray:*",
                "s3:*",
                "elasticloadbalancing:*",
                "cloud9:*",
                "lambda:*",
                "tag:GetResources",
                "logs:*",
                "kms:ListKeyPolicies",
                "kms:GenerateRandom",
                "kms:ListRetirableGrants",
                "kms:GetKeyPolicy",
                "kms:ListResourceTags",
                "kms:ReEncryptFrom",
                "kms:ListGrants",
                "kms:GetParametersForImport",
                "kms:ListKeys",
                "kms:GetKeyRotationStatus",
                "kms:ListAliases",
                "kms:ReEncryptTo",
                "kms:DescribeKey"
            ],
            "Resource": "*"
        }
    ]
}
</pre></code></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Review Policy</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Name</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edXProjectPolicy</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create policy</strong>. 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'>You have successfully created an AWS IAM policy with full access to AWS IAM, Amazon EC2, Amazon S3, Amazon RDS, Amazon SNS, Amazon SQS, Amazon Rekognition, AWS Lambda, Amazon Cognito, AWS Cloud9, AWS X-Ray, and AWS CloudFormation. When you create IAM policies, follow the standard security advice of granting<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">least privilege</strong><span>&nbsp;</span>- that is, granting only the permissions required to perform a task. Determine what users need to do and then craft policies for them that let the users perform only those tasks.</p></li></ul>
<h3 style='color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; font-stretch: normal'>2. Create an AWS IAM user, attach a policy to the user, and generate access keys.</h3>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'>In this section, you will create an AWS IAM user and attach the policy you just created to the user. You will then generate the access keys for the user. Those access keys will be used to make programmatic calls to AWS services via AWS CLI or APIs. If you are familiar with AWS IAM users, you may want to attempt to complete this section before reading the step-by-step instructions.</p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'></p>AWS IAM user name: edXProjectUser<br style="line-height: 1.4em" />Access type: Programmatic access and AWS Management Console access<br style="line-height: 1.4em" />Policy: edXProjectPolicy<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Important:</strong><span>&nbsp;</span>Download the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">.csv file</strong><span>&nbsp;</span>with the access keys after creating the user. Also, make sure to click the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Send email</strong><span>&nbsp;</span>link to get the email instructions for signing in to the AWS Management Console as edXProjectUser.<span>&nbsp;</span><br style="line-height: 1.4em" />
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'><strong style="font-weight: bold; line-height: 1.4em">Reminder!</strong><span>&nbsp;</span><em style="font-style: italic; line-height: 1.4em">Be sure to protect your AWS account access keys like you would your credit card numbers or any other sensitive secret.</em></p>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 20px 0px 1.41em; line-height: 1.6em !important'>At the end of this exercise, you will not be using the access keys again. It is a security best practice to remove IAM user credentials that are not needed. After this exercise, make sure to remove the access keys only (not the AWS Console password) for the IAM user - edXProjectUser. See more<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html" target="_blank">IAM Best Practices</a>.</p></li>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">IAM</strong><span>&nbsp;</span>to go to the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">IAM dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the left navigation menu, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Users</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Add user</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">User name</strong><span>&nbsp;</span>text box, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edXProjectUser</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Access type</strong>, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Programmatic access and AWS Management Console access</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Console password</strong>, you may choose either<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Autogenerated password</strong><span>&nbsp;</span>or<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Custom password</strong>. If you choose Autogenerated, you will be prompted to change your console password when you log in to the AWS Console as the edXProjectUser user. Make sure you take a note of the password created.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Permissions</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Under<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Set permissions for edXProjectUser</strong><span>&nbsp;</span>section, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Attach existing policies directly</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the search text box for<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Filter</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edXProjectPolicy</strong>. Select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edXProjectPolicy</strong><span>&nbsp;</span>from the filtered list.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Review</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Review the information and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create user</strong>. You should see a success message.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Download .csv</strong><span>&nbsp;</span>to download the access key ID and secret access key.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: This is your only chance to download these credentials.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Email login instructions</strong><span>&nbsp;</span>column, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Send email</strong>. You can send an email to an email address of your choice. This email contains the instructions to sign in to your AWS account with the edXProjectUser AWS IAM user credentials.<span>&nbsp;</span><br style="line-height: 1.4em" /></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Close</strong><span>&nbsp;</span>to return to the console.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the left navigation menu, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Note the IAM users sign-in link. This is a special URL for IAM users, which includes your account ID. You will see the same URL in the email you just created.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Sign out of the console, and follow the instructions provided in the email you just received to sign in to the AWS Console as the edXProjectUser AWS IAM user.</li></ul><br />
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>3. Create an Amazon EC2 instance and configure AWS CLI with the access keys of the AWS IAM user edXProjectUser.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">Sign-in to your AWS account as the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edXProjectUser</strong><span>&nbsp;</span>AWS IAM user.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Create an Amazon EC2 instance using the properties below. If you are familiar with Amazon EC2, you may want to attempt to complete this portion before reading the step-by-step instructions. 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p>Region: Oregon (us-west-2)<span>&nbsp;</span><br style="line-height: 1.4em" />Amazon Machine Image (AMI): Amazon Linux AMI<span>&nbsp;</span><br style="line-height: 1.4em" />Instance Type: t2.micro<span>&nbsp;</span><br style="line-height: 1.4em" />Network VPC: edx-build-aws-vpc<span>&nbsp;</span><br style="line-height: 1.4em" />Subnet: edx-subnet-public-a<span>&nbsp;</span><br style="line-height: 1.4em" />Tag: Ex4WebServer<span>&nbsp;</span><br style="line-height: 1.4em" />Security group name: Use the security group created in the third exercise, exercise3-sg.<span>&nbsp;</span><br style="line-height: 1.4em" />Key Pair: Use the key pair created in the third exercise.<span>&nbsp;</span></li></ul><br />
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em"><details style="display: block; line-height: 1.4em" open="">
<div id="details-content">
<ul style="color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 1em; margin: 1em 0px; list-style: disc none outside; line-height: 1.4em; padding-right: 0px"><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2</strong><span>&nbsp;</span>to go to the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2 dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Make sure you are in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Oregon</strong><span>&nbsp;</span>region.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">From the EC2 dashboard, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch Instance</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Choose an Amazon Machine Image (AMI)</strong><span>&nbsp;</span>page, select the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Amazon Linux AMI</strong>. This AMI is free-tier eligible.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Choose an Instance Type</strong><span>&nbsp;</span>page, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">t2.micro</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Configure Instance Details</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Network</strong>, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-build-aws-vpc</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Subnet</strong>, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-subnet-public-a</strong><span>&nbsp;</span>in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">us-west-2a</strong><span>&nbsp;</span>availability zone.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Add Storage</strong>. Skip through this page and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Add Tags</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Add Tag</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the Key textbox, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Name</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the Value textbox, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Ex4WebServer</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Configure Security Group</strong>. Select the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Select an existing security group</strong><span>&nbsp;</span>option.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">From the list of security groups, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise3-sg</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Review and Launch</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the Review Instance Launch page, review the details and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">When prompted for a key pair, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Choose an existing key pair</strong>, and then choose the key pair you created in the third exercise.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Select the acknowledgement check box, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch Instances</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">View Instances</strong><span>&nbsp;</span>to return to the instances page.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the Instances page, you can view the status of the launch. It can take a few minutes for the instance to be ready so that you can connect to it. Check that your instance has passed its status checks. You can view this information in the Status Checks column.<span>&nbsp;</span><br style="line-height: 1.4em" /></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Once the instance is ready, select the instance and note down the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">IPv4 Public IP</strong><span>&nbsp;</span>found in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Descriptions</strong><span>&nbsp;</span>tab at the bottom.</li></ul></div></details>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Connect to the instance using SSH. You may refer to the instructions in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">third exercise</strong><span>&nbsp;</span>for connecting to the instance.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">credentials.csv</strong><span>&nbsp;</span>file that you downloaded earlier. Find the entry for<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edXProjectUser</strong>, and note the values for<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Access Key Id</strong><span>&nbsp;</span>and<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Secret Access Key</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the instance terminal, type the below command.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">aws configure</code> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Follow the prompts on the screen and paste in the values for<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Access Key Id</strong><span>&nbsp;</span>and<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Secret Access Key.</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Region</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">us-west-2</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Default output format</strong>, press ENTER.<span>&nbsp;</span><br style="line-height: 1.4em" />You have now configured the AWS CLI so that any CLI calls will operate with the credentials of the AWS IAM user edXProjectUser.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Now query the information about the Amazon EC2 instances in your account. Type the command below. 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">aws ec2 describe-instances</code> 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p>You should see a JSON output with all the information of the Amazon EC2 instances in your account. This means that you were able to successfully execute the AWS CLI command with the permissions attached to the edXProjectUser.</li></ul><br />
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>4. Install Boto 3 on the instance and explore Boto 3 APIs.</h3>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">First install Python 3 and the Boto 3 SDK. On the Amazon EC2 instance terminal, type the commands below.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px"><pre style="word-wrap: break-word; font-size: 1em; font-family: monospace, serif; white-space: pre-wrap; color: rgb(49,49,49); margin: 1em 0px; line-height: 1.4em">sudo yum -y install python36
sudo pip-3.6 install boto3
</pre></code>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">To start using Boto 3, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">python3</strong><span>&nbsp;</span>on the instance terminal and press ENTER. You should now be able to execute Python commands from your instance terminal.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Import boto3 and create a client for the corresponding AWS service you wish to use. In this case, you can explore the EC2 APIs for Boto 3 by creating the EC2 client. Type the following. 
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">import boto3<br style="line-height: 1.4em" />client = boto3.client('ec2')<br style="line-height: 1.4em" />client.describe_instances()<br style="line-height: 1.4em" /></code>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'></p>You should see a JSON output similar to the one given by the AWS CLI command.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Now, type the command below.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">client.describe_key_pairs()</code></p>You should see a JSON output with the information about the key pairs in your account.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Press<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Ctrl-D</strong><span>&nbsp;</span>to exit the python interpreter.</li></ul>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>Optional Challenge</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this exercise, you configured an access key (access key ID and secret access key) on your EC2 instance. Later in the course, we will introduce IAM<span>&nbsp;</span><em style="font-style: italic; line-height: 1.4em">roles</em>. You may want to read ahead a little, and look at<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html" target="_blank">IAM Roles for Amazon EC2</a>.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Can you see a way to complete this exercise using an IAM role on the instance, rather than the access keys you just used?</p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>5. Terminate the Amazon EC2 instance.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will terminate the Amazon EC2 instance by selecting the instance in the Amazon EC2 dashboard and clicking<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Actions -&gt; Instance State -&gt; Terminate<span>&nbsp;</span></strong>.</p><br />
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2 dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the navigation pane, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instances</strong>. In the list of instances, select the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Ex4WebServer</strong><span>&nbsp;</span>instance.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Actions</strong>,<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instance State</strong>,<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Terminate</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Yes, Terminate</strong><span>&nbsp;</span>when prompted for confirmation.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Amazon EC2 shuts down and terminates your instance. After your instance is terminated, it remains visible on the console for a short while, and then the entry is deleted.</li></ul><br /><img src ="http://www.blogjava.net/Noah/aggbug/433167.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 11:12 <a href="http://www.blogjava.net/Noah/articles/433167.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>creating a VPC and subnets via an AWS CloudFormation template</title><link>http://www.blogjava.net/Noah/articles/433166.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 03:10:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433166.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433166.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433166.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433166.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433166.html</trackback:ping><description><![CDATA[<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this exercise, you will start laying the infrastructure for the course project by creating a VPC and subnets via an AWS CloudFormation template. You will create more AWS resources in these subnet in the subsequent exercises.<span>&nbsp;</span><br style="line-height: 1.4em" />You will also create an Amazon EC2 instance and learn how to connect to it using an SSH client. You use an SSH client for remote login and administration over an authenticated secure channel. You will then look at the log files on the instance and extract information from the instance metadata and user data script.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>To get started, follow the steps below.</p><br />
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>1. Launch an AWS CloudFormation template to create VPC and subnets.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will create a VPC and subnets by launching an AWS CloudFormation template. If you are familiar with AWS CloudFormation, you may want to attempt to complete this section by using the properties below before reading the step-by-step instructions.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Region: Oregon (us-west-2)<span>&nbsp;</span><br style="line-height: 1.4em" />CloudFormation template:<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/templates/vpc.template" download="">Download template<span>&nbsp;</span></a><br style="line-height: 1.4em" />Name of the stack: edx-vpc-stack<span>&nbsp;</span></p><br /><details style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(34,34,34); font-style: normal; text-align: left; orphans: 2; widows: 2; display: block; letter-spacing: normal; line-height: 1.4em; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial' open=""> 
<div id="details-content">
<ul style="color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 1em; margin: 1em 0px; list-style: disc none outside; line-height: 1.4em; padding-right: 0px"><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">CloudFormation</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">CloudFormation dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Make sure you are still in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Oregon</strong><span>&nbsp;</span>AWS Region.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create Stack</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em"><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/templates/vpc.template" download="">Download the AWS CloudFormation template<span>&nbsp;</span></a>to create a VPC and save it locally on your computer.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">To select the AWS CloudFormation template you just downloaded, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Choose file</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Stack name</strong><span>&nbsp;</span>textbox, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-vpc-stack</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next</strong>. Skip the Options page and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create</strong>. You will notice that the status of the template is<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">CREATE_IN_PROGRESS.<span>&nbsp;</span></strong>The template should finish creating in a minute.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In your AWS Management Console home page, in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">AWS services</strong><span>&nbsp;</span>search textbox at the top, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">VPC</strong>, and then select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">VPC</strong><span>&nbsp;</span>to open the VPC dashboard.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the VPC dashboard, on the left navigation menu, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Your VPCs</strong>. You will see a VPC named<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-build-aws-vpc</strong>in the list. Write down the vpc-id of the edx-build-aws-vpc. You will need the vpc-id in subsequent exercises.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the VPC dashboard, on the left navigation menu, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Subnets</strong>. You will see four subnets starting with edx-subnet-xxxx. Write down the subnet-id of edx-subnet-public-a. You will need the subnet-id in subsequent exercises.</li></ul></div></details>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p><br class="Apple-interchange-newline" /><br />
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>2. Launch an Amazon EC2 instance with a user data script in a VPC.</h3><br />
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will launch an Amazon EC2 instance with an user data script. If you are familiar with Amazon EC2, you may want to attempt to complete this section by using the properties below before reading the step-by-step instructions.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Region: Oregon (us-west-2)<span>&nbsp;</span><br style="line-height: 1.4em" />Amazon Machine Image (AMI): Amazon Linux AMI<span>&nbsp;</span><br style="line-height: 1.4em" />Instance Type: t2.micro<span>&nbsp;</span><br style="line-height: 1.4em" />Network VPC: edx-build-aws-vpc<span>&nbsp;</span><br style="line-height: 1.4em" />Subnet: edx-subnet-public-a<span>&nbsp;</span><br style="line-height: 1.4em" />User data script:<a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/UserDataScript.txt" download=""><span>&nbsp;</span>Download</a><span>&nbsp;</span><br style="line-height: 1.4em" />Tag: Ex3WebServer<span>&nbsp;</span><br style="line-height: 1.4em" />Security group name: exercise3-sg<span>&nbsp;</span><br style="line-height: 1.4em" />Security group rules: Allow HTTP and SSH<span>&nbsp;</span><br style="line-height: 1.4em" />Key Pair: Create a new key pair and save it for later use.<span>&nbsp;</span></p><br />
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2 dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">At the top right corner, select the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">US West (Oregon)</strong><span>&nbsp;</span>region.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">From the EC2 dashboard, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch Instance</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Choose an Amazon Machine Image (AMI)</strong><span>&nbsp;</span>page, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Amazon Linux AMI</strong><span>&nbsp;</span>by clicking<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Select</strong>. This AMI is free-tier eligible.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Choose an Instance Type</strong><span>&nbsp;</span>page, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">t2.micro</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Configure Instance Details</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Network</strong>, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-build-aws-vpc</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Subnet</strong>, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">edx-subnet-public-a</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Leave the defaults and scroll down to the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Advanced Details</strong><span>&nbsp;</span>section and expand it.</li><li style="margin-bottom: 0.7em; line-height: 1.4em"><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/UserDataScript.txt" download="">Download the user data script</a><span>&nbsp;</span>and copy and paste the contents of the script in the text area.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Add Storage</strong>. Skip through this page and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Add Tags</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Add Tag</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Key</strong><span>&nbsp;</span>textbox, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Name</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Value</strong><span>&nbsp;</span>textbox, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Ex3WebServer</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Configure Security Group</strong>. Note that the wizard gives you an option to create a new security group or select an existing one. For this exercise, leave the default chosen option, Create a new security group.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Security group name</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise3-sg</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Add Rule</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Type</strong>, leave<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Custom TCP Rule</strong><span>&nbsp;</span>selected.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Port Range</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">80</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Source</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">0.0.0.0/0</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em"><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: The inbound rule for SSH is added by default.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Review and Launch</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Review Instance Launch</strong><span>&nbsp;</span>page, review the details and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">When prompted for a key pair, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create a new key pair</strong>, enter a name for the key pair, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Download Key Pair</strong>.</li><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: This is the only chance for you to save the private key file, so be sure to download it. You will use the same key pair for all subsequent exercises in the course. Save the private key file in a safe place. You'll need to provide the name of your key pair when you launch an instance and the corresponding private key each time you connect to the instance.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Select the acknowledgement check box, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch Instances</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">View Instances</strong><span>&nbsp;</span>to return to the instances page.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instances</strong><span>&nbsp;</span>page, you can view the status of the launch. It can take a few minutes for the instance to be ready so that you can connect to it. Check that your instance has passed its status checks. You can view this information in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Status Checks</strong><span>&nbsp;</span>column.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: It takes a few minutes for the status checks to pass. Wait until the status checks changes from Initializing to 2/2 checks passed.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Once the instance is ready, select the instance and note down the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">IPv4 Public IP</strong><span>&nbsp;</span>found in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Descriptions</strong><span>&nbsp;</span>tab at the bottom.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Paste the public IP address of your instance in your web browser to display the welcome web page. This page is now displaying dynamic information about your server.</li></ul><br />
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>3. Connect to your Amazon EC2 instance.</h3><br />
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will connect to your Amazon EC2 instance via SSH. An SSH connection requires port 22 to be open on your network. You may need to contact your network administrator to ensure that this is open.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><strong style="font-weight: bold; line-height: 1.4em">For MAC/Linux users</strong>:</p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">Open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Terminal</strong><span>&nbsp;</span>application.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the commands below. In both commands, replace<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">PATH-TO-PEM-FILE</strong><span>&nbsp;</span>with a reference to the .pem file that you downloaded while launching the instance. In the second command, replace<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">PUBLIC-IP</strong><span>&nbsp;</span>with the IPv4 Public IP of the instance.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">chmod 400 PATH-TO-PEM-FILE<span>&nbsp;</span><br style="line-height: 1.4em" />ssh -i PATH-TO-PEM-FILE ec2-user@PUBLIC-IP<span>&nbsp;</span><br style="line-height: 1.4em" /></code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">You will see a prompt like the one below. Answer<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">yes</strong><span>&nbsp;</span>to the prompt.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">The authenticity of host '54.201.7.240 (54.201.7.240)' can't be established. ECDSA key fingerprint is SHA256:TrCPkFBL0F+pTp3LH+UGFPhGjl7N4qaoLucu21RWsRM. Are you sure you want to continue connecting (yes/no)?</code></p></ul><br /><strong><font color="#313131" size="5" face="Helvetica">For Windows users</font></strong><span style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; float: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>:</span><br />
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em"><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html" target="_blank">Install PuTTY.</a></li><li style="margin-bottom: 0.7em; line-height: 1.4em">PuTTY does not natively support the private key format (.pem) generated by Amazon EC2. PuTTY has a tool named PuTTYgen, which can convert keys to the required PuTTY format (.ppk). You must convert your private key into this format (.ppk) before attempting to connect to your instance using PuTTY. To convert your private key (.pem file) using PuTTYgen, follow the instructions below: 
<ul style="color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 1em; margin: 1em 0px; list-style: disc none outside; line-height: 1.4em; padding-right: 0px"><li style="margin-bottom: 0.7em; line-height: 1.4em">Start PuTTYgen.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Under<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Type of key to generate</strong>, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">RSA</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Load</strong>. By default, PuTTYgen displays only files with the extension .ppk. To locate your .pem file, select the option to display files of all types.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Select your<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">.pem file</strong><span>&nbsp;</span>for the key pair that you specified when you launched your instance, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Open</strong>. Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">OK</strong><span>&nbsp;</span>to dismiss the confirmation dialog box.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Save private key</strong><span>&nbsp;</span>to save the key in the format that PuTTY can use. PuTTYgen displays a warning about saving the key without a passphrase. Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Yes</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Specify the same name for the key that you used for the key pair (for example, my-key-pair). PuTTY automatically adds the .ppk file extension.<span>&nbsp;</span><br style="line-height: 1.4em" />Your private key is now in the correct format for use with PuTTY. You can now connect to your instance using PuTTY's SSH client.</li></ul></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Start<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">PuTTY</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Category</strong><span>&nbsp;</span>pane, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Session</strong>.</li>In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Host Name</strong><span>&nbsp;</span>text box, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">ec2-user@IP-ADDRESS</strong>, where IP-ADDRESS is the public IP address of your Amazon EC2 instance.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Category</strong><span>&nbsp;</span>pane, expand<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Connection</strong>, expand<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">SSH</strong>, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Auth</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Browse</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Select the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">.ppk file</strong><span>&nbsp;</span>that you generated for your key pair, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Open</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">If you plan to start this session again later, you can save the session information for future use. In the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Category</strong>tree, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Session</strong>, enter a name for the session in<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Saved Sessions</strong>, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Save</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Open</strong><span>&nbsp;</span>to start the PuTTY session. PuTTY will ask whether you wish to cache the server&#8217;s host key. Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Yes</strong>.</li></ul><br />
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>4. View log file, query instance metadata, and user data.</h3>&nbsp;&nbsp;&nbsp;&nbsp;<br />
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will inspect the cloud-init logs to verify the steps in the UserData script executed on the Amazon EC2 Instance. Then, you will query the instance metadata service from the Amazon EC2 instance so that you can see how your application is printing information about itself on the welcome page.</p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">To view the log file, type the command below in your instance terminal.</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">cat /var/log/cloud-init-output.log</code></p>Explore the log file to see the log entries generated for installing the user data script.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">To view the instance metadata, type the command below:</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">curl http://169.254.169.254/latest/meta-data/</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Execute the command below to get the instance identity document of your instance:</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">curl http://169.254.169.254/latest/dynamic/instance-identity/document</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Execute the command below to get the instance public IP address:</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">curl http://169.254.169.254/latest/meta-data/public-ipv4</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Execute the command below to get the MAC address of the instance:</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">curl http://169.254.169.254/latest/meta-data/mac</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Execute the command below to get the VPC ID in which the instance resides. Make sure to replace<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Your-MAC</strong><span>&nbsp;</span>in the command below with the MAC address of your instance:</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/Your-MAC/vpc-id</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Execute the command below to get the subnet-id in which the instance resides. Make sure to replace<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Your-MAC</strong>in the command below with the MAC address of your instance:</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">curl http://169.254.169.254/latest/meta-data/network/interfaces/macs/Your-MAC/subnet-id</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Execute the command below to get the instance user data:</li>
<p style='font-size: 1em; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(49,49,49); text-align: left; margin: 0px 0px 1.41em; line-height: 1.6em !important'><code style="font-size: 1em; font-family: monospace, serif;background: none transparent scroll repeat 0% 0%; color: rgb(49,49,49); padding-bottom: 0px; padding-top: 0px; padding-left: 0px; line-height: 1.4em; padding-right: 0px">curl http://169.254.169.254/latest/user-data</code></p></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Go to the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2 dashboard</strong><span>&nbsp;</span>in your console, locate the Amazon EC2 instance you created and verify the public IP address, the VPC ID and the subnet-id of the instance you just queried in the instance terminal. You should be able see this information in the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Description</strong><span>&nbsp;</span>tab at the bottom.</li></ul><br />
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>5. Terminate the Amazon EC2 instance.</h3><br /><span style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; float: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will terminate the Amazon EC2 instance by selecting the instance in the EC2 dashboard and clicking<span>&nbsp;</span></span><strong style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: bold; color: rgb(49,49,49); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.4em; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Actions -&gt; Instance State -&gt; Terminate<span>&nbsp;</span></strong><span style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; float: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>.</span><br />
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2 dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the navigation pane, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instances</strong>. In the list of instances, select the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Ex3WebServer</strong><span>&nbsp;</span>instance.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Actions</strong>,<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instance State</strong>,<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Terminate</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Yes, Terminate</strong><span>&nbsp;</span>when prompted for confirmation.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Amazon EC2 shuts down and terminates your instance. After your instance is terminated, it remains visible on the console for a short while, and then the entry is deleted.</li></ul> <img src ="http://www.blogjava.net/Noah/aggbug/433166.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 11:10 <a href="http://www.blogjava.net/Noah/articles/433166.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>create Amazon EC2</title><link>http://www.blogjava.net/Noah/articles/433165.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 02:59:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433165.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433165.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433165.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433165.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433165.html</trackback:ping><description><![CDATA[<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this exercise, you will create your first Amazon EC2 instance and install a sample Python Flask app using user data. When you launch an instance in Amazon EC2, you can pass user data to the instance that can be used to perform common automated configuration tasks. User data is usually passed in the form of shell-scripts. You can pass this data into the launch wizard as plain text, as a file while launching via the command line tools, or as base64-encoded text for API calls.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>To get started, follow the steps below.<br /><br /></p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-stretch: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>1. Launch an Amazon EC2 instance with a user data script.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will launch an Amazon EC2 instance with a user data script. If you are familiar with Amazon EC2, you may want to attempt to complete this section by using the properties below before reading the step-by-step instructions.</p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Region: Oregon (us-west-2)<span>&nbsp;</span><br style="line-height: 1.4em" />Amazon Machine Image (AMI): Amazon Linux AMI<span>&nbsp;</span><br style="line-height: 1.4em" />Instance Type: t2.micro<span>&nbsp;</span><br style="line-height: 1.4em" />User data script:<a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/UserDataScript.txt" download=""><span>&nbsp;</span>Download</a><span>&nbsp;</span><br style="line-height: 1.4em" />Tag: SamplePythonFlaskApp<span>&nbsp;</span><br style="line-height: 1.4em" />Security group name: exercise2-sg<span>&nbsp;</span><br style="line-height: 1.4em" />Security group rules: Allow HTTP<span>&nbsp;</span><br style="line-height: 1.4em" />Key Pair: Proceed without a key pair<span>&nbsp;</span></p>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2 dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">At the top-right corner, select the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">US West (Oregon)</strong><span>&nbsp;</span>region.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">From the EC2 dashboard, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch Instance</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Choose an Amazon Machine Image (AMI)</strong><span>&nbsp;</span>page, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Amazon Linux AMI</strong><span>&nbsp;</span>by clicking<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Select</strong>. This AMI is free-tier eligible.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: Do not select the Amazon Linux 2 AMI option.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Choose an Instance Type</strong><span>&nbsp;</span>page, you can select the hardware configuration of your instance. Select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">t2.micro</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Configure Instance Details</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the Configure Instance Details page, leave the defaults and scroll down to the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Advanced Details</strong><span>&nbsp;</span>section and expand it.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the User data section, leave<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">As text</strong><span>&nbsp;</span>selected.</li><li style="margin-bottom: 0.7em; line-height: 1.4em"><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://s3-us-west-2.amazonaws.com/us-west-2-tcdev/courses/AWS-100-ADG/v1.0.0/exercises/UserDataScript.txt" download="">Download the user data script</a><span>&nbsp;</span>and copy and paste the contents of the script in the text area.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Add Storage</strong>. Skip through this page and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Add Tags</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Add Tag</strong>. Tags enable you to categorize your AWS resources in different ways - for example, by purpose, owner, or environment.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the Key textbox, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Name</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the Value textbox, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">SamplePythonFlaskApp</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Next: Configure Security Group</strong>. Note that the wizard gives you an option to create a new security group or select an existing one. For this exercise, accept the default chosen option, Create a new security group.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For Security Group Name, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">exercise2-sg</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the security group table,<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">delete the SSH rule</strong><span>&nbsp;</span>by clicking the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">X</strong><span>&nbsp;</span>button at the end of the row.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Add Rule</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Type</strong>, leave<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Custom TCP Rule</strong><span>&nbsp;</span>selected.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Port Range</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">80</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">For<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Source</strong>, type<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">0.0.0.0/0</strong></li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Review and Launch</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the Review Instance Launch page, review the details and click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">When prompted for a key pair, select<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Proceed without a key pair</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Select the acknowledgement check box, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Launch Instances</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">View Instances</strong><span>&nbsp;</span>to return to the Instances page.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the Instances page, you can view the status of the launch. It can take a few minutes for the instance to be ready so that you can connect to it. Check that your instance has passed its status checks. You can view this information in the Status Checks column.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: It takes a few minutes for the status checks to pass. Wait until the status checks changes from<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Initializing</strong>to<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">2/2 checks passed</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Once the instance is ready, select the instance and write down the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">IPv4 Public IP</strong><span>&nbsp;</span>found in the Descriptions tab at the bottom.</li></ul><br /><br />
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-stretch: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>2. Test the sample app running on your instance</h3><br />
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">Open a browser and type the public IP of the Amazon EC2 instance you copied earlier.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">You should see a sample Python app running on your Amazon EC2 instance.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Congratulations!</strong><span>&nbsp;</span>You have launched your first web server in AWS.</li></ul><br />
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-stretch: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>3. Terminate the Amazon EC2 instance</h3>
<p style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-stretch: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><span style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; float: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this section, you will terminate the Amazon EC2 instance by selecting the instance in EC2 dashboard and clicking</span><strong style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: bold; color: rgb(49,49,49); font-style: normal; text-align: left; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.4em; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>Actions -&gt; Instance State -&gt; Terminate<span>&nbsp;</span></strong><span style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; float: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; orphans: 2; widows: 2; display: inline !important; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>.<br /></p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">In the AWS Console, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Services</strong>, then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2</strong><span>&nbsp;</span>to open the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">EC2 dashboard</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">In the navigation pane, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instances</strong>. In the list of instances, select the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">SamplePythonFlaskApp</strong><span>&nbsp;</span>instance.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Actions</strong>,<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Instance State</strong>,<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Terminate</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Yes, Terminate</strong><span>&nbsp;</span>when prompted for confirmation.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Amazon EC2 shuts down and terminates your instance. After your instance is terminated, it remains visible on the console for a short while, and then the entry is deleted.</li></ul>
<p style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; font-stretch: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></span>&nbsp;</p><img src ="http://www.blogjava.net/Noah/aggbug/433165.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 10:59 <a href="http://www.blogjava.net/Noah/articles/433165.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>create and activate AWS account</title><link>http://www.blogjava.net/Noah/articles/433164.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 19 Apr 2018 02:49:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/433164.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/433164.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/433164.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/433164.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/433164.html</trackback:ping><description><![CDATA[<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>In this exercise, you will create and activate your AWS account. To begin, follow the steps below.</p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>1. Go to the<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://aws.amazon.com/" target="_blank">Amazon Web Services home page</a><span>&nbsp;</span>and sign up for an account.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">Go to the<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://aws.amazon.com/" target="_blank">Amazon Web Services home page</a>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create a Free Account</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">On the sign-in page, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create an Account</strong>.<span>&nbsp;</span><br style="line-height: 1.4em" /><strong style="font-weight: bold; line-height: 1.4em">Note</strong>: This might be unavailable in your browser if you previously signed in to the AWS Management Console. In that case, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Sign in to a different account</strong>, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create a new account</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the requested account information, and then click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Continue</strong>.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Choose<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Personal</strong><span>&nbsp;</span>or<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Professional</strong>.</li><strong style="font-weight: bold; line-height: 1.4em">Note:</strong><span>&nbsp;</span>These two account types are identical in functionality. You can choose a personal account for your personal projects or choose professional for use within your company, an educational institution, or an organization.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the requested company or personal information.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Read the<span>&nbsp;</span><a style="text-decoration: none; font-family: inherit; color: rgb(0,117,180); font-stretch: inherit; transition: all 0.1s linear 0s" href="https://aws.amazon.com/agreement/" target="_blank">AWS Customer Agreement</a>, and then check the box.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Create Account and Continue</strong>.</li></ul>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>2. Add a payment method.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Payment Information</strong><span>&nbsp;</span>page, add a payment method by typing the requested information associated with your payment method.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Secure Submit</strong>.</li></ul>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>3. Verify your phone number.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Phone Verification</strong><span>&nbsp;</span>page, type a phone number that you can use to accept incoming phone calls.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Enter the code displayed in the security check.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">When you're ready to receive a call, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Call me now</strong>. In a few moments, an automated system will call you.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Type the provided PIN on your phone's keypad. After the process has completed, click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Continue</strong>.</li></ul>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 20px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<h3 style='white-space: normal; word-spacing: 0px; text-transform: none; color: rgb(49,49,49); text-align: left; font: 600 1.2em/1.4em "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0px 0px 10px; orphans: 2; widows: 2; letter-spacing: normal; background-color: rgb(255,255,255); text-indent: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; font-stretch: normal'>4. Choose a support plan and sign in to your console.</h3>
<p style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); font-style: normal; text-align: left; margin: 0px 0px 1.41em; orphans: 2; widows: 2; letter-spacing: normal; line-height: 1.6em !important; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'></p>
<ul style='font-size: 20px; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; white-space: normal; word-spacing: 0px; text-transform: none; font-weight: 400; color: rgb(49,49,49); padding-bottom: 0px; font-style: normal; text-align: left; padding-top: 0px; padding-left: 1em; margin: 1em 0px; orphans: 2; widows: 2; letter-spacing: normal; list-style: disc none outside; line-height: 1.4em; padding-right: 0px; background-color: rgb(255,255,255); text-indent: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'><li style="margin-bottom: 0.7em; line-height: 1.4em">On the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Select a Support Plan</strong><span>&nbsp;</span>page, select the<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Basic Plan</strong><span>&nbsp;</span>included in the free tier.</li><li style="margin-bottom: 0.7em; line-height: 1.4em">Click<span>&nbsp;</span><strong style="font-weight: bold; line-height: 1.4em">Sign in to Console</strong><span>&nbsp;</span>to sign in to your console.</li></ul><img src ="http://www.blogjava.net/Noah/aggbug/433164.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2018-04-19 10:49 <a href="http://www.blogjava.net/Noah/articles/433164.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>