Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I went ahead and created a script that will reproduce the same exact steps that i'm using. This assumes you're using linux as an operating system and that the AWS CLI tools are already installed. If you don't have this setup already I recommend starting a new Amazon Linux micro instance and running the script from there since they have everything already installed.</p> <ol> <li><p>Download the X.509 certificate files from amazon <a href="https://aws-portal.amazon.com/gp/aws/securityCredentials" rel="nofollow">https://aws-portal.amazon.com/gp/aws/securityCredentials</a></p></li> <li><p>Copy the certificate files to the machine where you will run the commands</p></li> <li><p>Save two variables that are required in the script</p> <pre><code>aws_account=&lt;aws account id&gt; keypair="&lt;key pair name&gt;" </code></pre></li> <li><p>Export the certificates as environmental variables</p> <pre><code>export EC2_PRIVATE_KEY=&lt;private_Key_file&gt; export EC2_CERT=&lt;cert_file&gt; export EC2_URL=https://ec2.us-east-1.amazonaws.com </code></pre></li> <li><p>Create the security groups</p> <pre><code>ec2-create-group loadbalancer-sg -d "Loadbalancer Test group" ec2-authorize loadbalancer-sg -o loadbalancer-sg -u $aws_account ec2-authorize loadbalancer-sg -p 80 -s 0.0.0.0/0 </code></pre></li> <li><p>Create the user-data-file for the instance so that apache is started and the index.html file is created</p> <pre><code>mkdir -p ~/temp/ echo '#! /bin/sh yum -qy install httpd touch /var/www/html/index.html /etc/init.d/httpd start' &gt; ~/temp/user-data.sh </code></pre></li> <li><p>Start the new instance and save the instanceid</p> <pre><code>instanceid=`ec2-run-instances ami-31814f58 -k "$keypair" -t t1.micro -g loadbalancer-sg -g default -z us-east-1a -f ~/temp/user-data.sh | grep INSTANCE | awk '{ print $2 }'` </code></pre></li> <li><p>Create the loadbalancer and attach the instance</p> <pre><code>elb-create-lb test-lb --availability-zones us-east-1a --listener "protocol=http, lb-port=80, instance-port=80" elb-register-instances-with-lb test-lb --instances $instanceid </code></pre></li> <li>Wait until your instance state in the loabalancer is "InService" and try to access the urls</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload