Compute – Workshop
- Areas of Focus
- Automation
- Administration
Activity 1: Shutdown all instances which have tag Env=QA
- Setup: Create 3 ec2 instances of free tier and provide tags
- Machine 1: Env: QA
- Machine 2: Env: Dev
- Machine 3: Env: UAT
- Refer Here for the cli with script
- Improvement 1: This script was failing if there are no instances matching critiera, so we add a flag or condition Refer Here for changes.
- Improvement 2: Make this script work for tag Env=Dev Refer Here for the imporvement where user can now call
activity1.sh <tag-name> <tag-value>
Activity 2: Resize the EC2 instance from t2.micro to t2.nano based on tags
- Refer Here for the changes.
Activity 3: EC2 Systems Manager
-
Systems Manager can be used to control linux or window workloads in
- AWS
- Other Cloud Providers
- On-premises
- IOT
- General Setup of Systems Manager Refer Here and Refer Here for setup on ec2 instances
Setting up Systems Manager
- Refer Here for pre-requisites
- Navigate to Systems Manager
- Now Create an Instance Profile Refer Here
- Refer Here to attach IAM role to existing ec2 instance
- AWS Recommends using Configure Default Host Management
- Navigate to systems Manager -> Fleet Manager ->
- Navigate to systems Manager -> Fleet Manager ->
- Now we can recover from key lost scenarios Refer Here