Skip to content

Commit

Permalink
Added instructions around Self Signed Warning
Browse files Browse the repository at this point in the history
  • Loading branch information
oak2278 committed Nov 20, 2017
1 parent 08ad395 commit edb0bd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ The template sets up a VPC, IAM roles, S3 bucket, and an EC2 Instance. The EC2 i

![CloudFormation Complete](/images/cf-complete.png)

7. Click on the Output URLs for **Jupyter** and **Web Server**. Each should load a web page confirming that the environment has been deployed correctly.
7. Click on the Output URLs for **Jupyter** and **Web Server**. Each should load a web page confirming that the environment has been deployed correctly. We have vreated a self-signed certificate for the Jupyter Notebook. You will see messages about an unsafe connection. It is safe to ignore these warnings and continue. The steps will differ depending on your browser.

Jupyter
![CloudFormation Jupyter Complete](/images/jupyter.png)
Expand Down
26 changes: 10 additions & 16 deletions templates/monte-carlo-workshop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ Resources:
UserData:
Fn::Base64: !Sub |
#!/bin/bash

# Update and Install dependencies
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
yum -y --security update
Expand All @@ -281,28 +282,14 @@ Resources:
aws configure set default.region ${AWS::Region}
start amazon-ssm-agent

#Assign Elastic IP
INSTANCE_ID=$(curl 169.254.169.254/latest/meta-data/instance-id 2>/dev/null)
echo $INSTANCE_ID
ENI_ID=${workstationElasticNetworkInterface}
ALLOCATION_ID=${workstationElasticIp.AllocationId}
# aws ec2 attach-network-interface --network-interface-id $ENI_ID --instance-id $INSTANCE_ID --device-index 1
aws ec2 associate-address --instance-id $INSTANCE_ID --allocation-id $ALLOCATION_ID

# Clone the workshop code
cd /home/ec2-user
n=0
until [ $n -ge 3 ]
do
git clone https://github.com/aws-samples/ec2-spot-montecarlo-workshop && break
n=$[$n+1]
sleep 5
done
git clone https://github.com/aws-samples/ec2-spot-montecarlo-workshop && break
WORKSHOPDIR=/home/ec2-user/ec2-spot-montecarlo-workshop/src

# Configure Web Client
cp -rf $WORKSHOPDIR/*.py $WORKSHOPDIR/web/public/static/
sed -i "s_REGION_NAME"_${AWS::Region}_g" $WORKSHOPDIR/web/config.json
sed -i "s/REGION_NAME/${AWS::Region}/g" $WORKSHOPDIR/web/config.json

#Configure Jupyter Notebook Password
mkdir $WORKSHOPDIR/keys
Expand All @@ -318,6 +305,13 @@ Resources:
chown ec2-user:ec2-user $WORKSHOPDIR
rm $WORKSHOPDIR/password_temp

#Assign Elastic IP
INSTANCE_ID=$(curl 169.254.169.254/latest/meta-data/instance-id 2>/dev/null)
echo $INSTANCE_ID
ENI_ID=${workstationElasticNetworkInterface}
ALLOCATION_ID=${workstationElasticIp.AllocationId}
aws ec2 associate-address --instance-id $INSTANCE_ID --allocation-id $ALLOCATION_ID

#Start Web and Jupyter
cd $WORKSHOPDIR
node web/bin/www > stdout.txt 2>&1 &
Expand Down

0 comments on commit edb0bd1

Please sign in to comment.