EC2 - davidkhala/aws-collection GitHub Wiki

hostnamectl info

  • Hardware Vendor: Amazon EC2
  • Hardware Model: <instance type. e.g. t3.medium>

Schedule auto-down

Usecase: Per EC2 instance

powered by CloudWatch alarms

  • Limit: CloudWatch alarms trigger actions only when the alarm state changes and is maintained for a specified number of periods.
    • So please please wait for alarm change to a desired state before further action.

Usecase: For multiple EC2

  • AWS has released a new feature that integrates CloudWatch alarms with AWS Systems Manager OpsCenter.

Amazon Machine Images(AMI)

  • Most of snapshot requires 8GB volume size
    • What is the possible image to support 1GB size?

User data

Use case: Scripts or cloud-init can retrieve this data at boot time to automate tasks.

  • available in imds endpoint http://169.254.169.254/latest/user-data

Instance metadata service (imds)

details

Troubleshoot

Q: CredentialsError: Missing credentials in config

  • apply IAM role(such as 'AdministratorAccess') to EC2
  • Console -> Service: EC2 -> select an instance -> Actions -- Instance Settings -- Attach/Replace IAM Role

Elastic Block Storage (EBS)

https://github.com/davidkhala/aws-collections/blob/main/ec2/ebs.md