The Cloud

Mattias Holmlund, 2015-08-27

Use cases

No hardware!

Several different providers

Amazon

Amazon

AWS

Amazon EC2

Rent virtual servers

Demo

Create ec2 instance via web

Networking in EC2

Networking in EC2

Demo

Create ec2 instance via cli

https://aws.amazon.com/cli/

run-instance

inst_id=$(aws ec2 run-instances \
  --image-id ami-accff2b1 \
  --count 1 --instance-type t2.micro \
  --key-name netinsight \
  --security-groups launch-wizard-1 \
  --query Instances[0].InstanceId \
  --output text)
  
aws ec2 wait instance-status-ok \
  --instance-ids $inst_id
  

run-instance

ip=$(aws ec2 describe-instances \
  --instance-ids $inst_id \
  --query \ 
    'Reservations[0].Instances[0].PublicIpAddress' \
  --output text)
  
scp -o StrictHostKeyChecking=no \
  ./installer ubuntu@$ip:
  
ssh -o StrictHostKeyChecking=no ubuntu@$ip \
  sudo ./installer
  

run-instance

aws ec2 terminate-instances \
  --instance-ids $inst_id \
  --output text
  

installer

apt-get update
apt-get install -y apache2
echo "Behold the power of the Cloud" \
  > /var/www/html/index.html
  

This script runs on the EC2 instance.

Clean environment every time!

Pricing

Type vCPU Mem 1h 1month
t2.micro 1 1 GB 0.12 106
m4.large 2 8 GB 1.20 1060

Prices in SEK. 750 hours of free t2.micro when you sign up

Storage

EBS - Elastic Block Store

S3 - Simple Storage Service

S3 Cost

S3 Demo

Questions?

Try it!

https://mattiash.github.io/presentation-cloud/https://github.com/mattiash/presentation-cloud/