ec2_skill
- Python
976
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill itsmostafa/aws-agent-skills --skill ec2- instance-management.md9.2 KB
- SKILL.md9.2 KB
Overview
This skill provides AWS EC2 virtual machine management for instances, AMIs, networking, and storage. It streamlines launching and configuring instances, managing security groups and key pairs, handling EBS volumes and AMIs, and troubleshooting connectivity and lifecycle issues. Use it to automate instance workflows, enforce best practices, and speed operational tasks.
How this skill works
The skill exposes common EC2 operations via CLI and boto3 patterns: launching instances with key pairs and security groups, running user-data scripts, attaching IAM instance profiles, creating AMIs, and managing EBS volumes and snapshots. It inspects instance state, networking rules, and metadata options to validate connectivity, apply security settings (IMDSv2, encryption), and collect diagnostics like console output and CloudWatch metrics. Typical workflows combine describe/modify actions with automation steps (create-image, attach-volume, request-spot-instances) to manage lifecycle and cost.
When to use it
- Launch or configure EC2 instances (dev, staging, production).
- Set up security groups, key pairs, and IAM instance profiles.
- Create custom AMIs or bake images from running instances.
- Attach, resize, snapshot, or encrypt EBS volumes.
- Troubleshoot SSH/connectivity, instance health, or boot issues.
- Optimize cost via Spot, Reserved Instances, or instance right-sizing.
Best practices
- Use IAM roles for instances instead of embedded access keys.
- Restrict security group rules to least privilege and use private subnets for backends.
- Require IMDSv2 for instance metadata and encrypt EBS volumes by default.
- Right-size instances and use Spot or Savings Plans for cost savings.
- Deploy across multiple AZs with Auto Scaling and ELB for reliability.
- Remove unused EBS volumes, snapshots, and unused AMIs to reduce costs.
Example use cases
- Automate launching a web server fleet with user-data to install and start services.
- Create a golden AMI from a configured instance for consistent deployments.
- Attach and encrypt a new EBS volume, then snapshot it for backups.
- Troubleshoot an unreachable instance by checking security groups, public IP, and console output.
- Request Spot instances for batch processing to reduce compute costs.
FAQ
Check security group rules, public IP, key pair match, instance state, and network ACLs. If SSH still fails, use AWS Systems Manager Session Manager to start a session without SSH.
When should I create a custom AMI?
Create a custom AMI when you need a repeatable, preconfigured image with installed software and settings for faster, consistent instance launches across environments.