ec2
Table of Contents

Elastic Compute Cloud

Deploy across AWS Regions and Availablity Zones for reliability

Characteristic

All data is automatically deleted when an EC2 instance stops, fails or is terminated

Launch

Can be launch from a pre-configured Amazon Machine Image (AMI)

User data

In Advanced Details, here we could input below data for bootstrap

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#!/bin/bash
yum -y install httpd
systemctl start httpd 
if [ ! -f /var/www/html/lab2-app.tar.gz ]; then 
cd /var/www/html
wget https://us-west-2-aws-training.s3.amazonaws.com/awsu-ilt/AWS-100-ESS/v4.1/lab-2-configure-website-datastore/scripts/lab2-app.tar.gz

tar xvfz lab2-app.tar.gz
chown apache:root /var/www/html/rds.config.php
fi

query user-data info

curl http://169.254.169.254/latest/user-data

Metadata Service

e.g.

http://169.254.169.254/latest/meta-data/iam/security-credentials/rolename

Instance Technologies

img

Current Generation Instances

img

Reboot vs Stop vs Terminate

img

Auto-scaling

Launch configurations

Specify below info when launch a instance

AMI ID
Instance type
Key pair
Security groups
Block deivce mapping
User data

img

Load Balancer Types

img