EC2 instance Status Checks
- Lets create an ec2 instance and look at status checks

- Types of Status Checks
- System Status Checks:
- They check AWS Systems (physical server) on which your ec2 instance runs
- These check detect underlying probles with your instance that require AWS involvement to repair
- The failure represents one of the following
- Loss of network connectivity
- Loss of System Power
- Software issues on Physical Host
- Hardware issues on Physical Host
- Instance Status Checks:
- They check software & network configuration of your ec2 instance.
- This check is performed by send ARP (Address Resolution Protocol) packet to the Network interface.
- This failure requires your involvement to repair
- The failure represent
- Failed System Checks
- Incorrect network or start up configuration
- No Memory
- Corrupted file system
- In compatible kernel
- System Status Checks:
- Troubleshooting can be done as shown below and select system log

- Get Instance Screenshot

- Resizing Instance types can be done when your ec2 instance is stopped

Scenario: Create a linux ec2 instance with apache server installed
- In ubuntu machine to install apache server
sudo apt-get update
sudo apt-get install apache2 -y
- One approach is create an ec2 instance and login into ec2 instance and execute the commands
- AWS has one more approach which is called as user data
User data
- While we launch ec2 instance user data is the way to pass the automated configuration task
- Lets try to create an ubuntu instance with the following script as userdata
#!/bin/bash
sudo apt-get update
sudo apt-get install apache2 -y

- By default user data scripts run only during boot cycle when you first launch an instance
- To get further into the details, we need to understand retrieving dynamic data and metadata versions
- We also need to understand cloud-init
- Exercise: Ensure you go through yaml tutorial before tomorrow’s session Refer Here
Exercises:
- Create a Key pair from AWS CLI
aws ec2 create-key-pair --key-name 'forfun' --query 'KeyMaterial' --output text > forfun.pem
chmod 400 forfun.pem

- Create an ec2 instance with this keypair and login into ec2 instance without using aws console
aws ec2 run-instance
*
