Description: The EC2 instance remains in the "terminating" state for an extended period.
Cause:
Solution:
aws ec2 terminate-instances --instance-ids i-xxxxxxxxxxxxxxxxx --force
aws autoscaling describe-auto-scaling-instances --instance-ids i-xxxxxxxxxxxxxxxxx
Description: The instance cannot be terminated because termination protection is enabled.
Cause: Termination protection prevents accidental deletion of critical instances.
Solution:
aws ec2 modify-instance-attribute --instance-id i-xxxxxxxxxxxxxxxxx --no-disable-api-termination
Description: You receive an error indicating that you lack permissions to terminate the instance.
Cause: The IAM user or role does not have the required permissions.
Solution:
{ "Effect": "Allow", "Action": "ec2:TerminateInstances", "Resource": "arn:aws:ec2:region:account-id:instance/i-xxxxxxxxxxxxxxxxx" }
Description: The EC2 instance is terminated unexpectedly without user intervention.
Cause:
Solution:
aws autoscaling describe-auto-scaling-instances --instance-ids i-xxxxxxxxxxxxxxxxx
aws ec2 describe-spot-instance-requests --filters Name=state,Values=closed
Description: The instance is terminated, but its attached EBS volume remains.
Cause: The root volume is configured to persist after termination.
Solution:
aws ec2 describe-instances --instance-ids i-xxxxxxxxxxxxxxxxx --query 'Reservations[*].Instances[*].BlockDeviceMappings'
aws ec2 delete-volume --volume-id vol-xxxxxxxxxxxxxxxxx
Description: The instance is terminated, but the Elastic IP (EIP) is still allocated and incurring charges.
Cause: Elastic IPs are not automatically released upon instance termination.
Solution:
aws ec2 release-address --allocation-id eipalloc-xxxxxxxx
Welcome to our comprehensive collection of programming language cheatsheets! Whether you're a seasoned developer or a beginner, these quick reference guides provide essential tips and key information for all major languages. They focus on core concepts, commands, and functions—designed to enhance your efficiency and productivity.
ManageEngine Site24x7, a leading IT monitoring and observability platform, is committed to equipping developers and IT professionals with the tools and insights needed to excel in their fields.
Monitor your IT infrastructure effortlessly with Site24x7 and get comprehensive insights and ensure smooth operations with 24/7 monitoring.
Sign up now!