aws-ec2
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "aws-ec2" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-bb714a07cf91e781fb33a79f2e9e11982e42e6030d97c8f8a6e5e8562dbdd1d4. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Launch and manage Amazon EC2 instances for scalable compute by configuring AMIs, security groups, key pairs, and EBS volumes, and set up cross‑availability‑zone auto scaling groups to achieve high availability and cost optimization.
Introduction source: third_party · TerminalSkills · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Amazon Elastic Compute Cloud (EC2) provides resizable virtual servers in the cloud. It's the foundational compute service for running applications, from simple web servers to complex distributed systems.
- Software, accounts and paid services
- !/bin/bash yum update -y yum install -y docker systemctl start docker systemctl enable docker docker pull myapp:latest docker run -d -p 80:8080 myapp:latest ```
- Testing
- Not tested
Browse files
Frontmatter
name: aws-ec2
description: |
Launch and manage Amazon EC2 instances for scalable compute. Configure AMIs,
security groups, key pairs, and EBS volumes. Set up auto-scaling groups for
high availability and cost optimization across availability zones.
license: Apache-2.0
compatibility: 'aws-cli, boto3, terraform'
metadata:
author: terminal-skills
version: 1.0.0
category: devops
tags:
- aws
- ec2
- compute
- auto-scalingAWS EC2
Amazon Elastic Compute Cloud (EC2) provides resizable virtual servers in the cloud. It's the foundational compute service for running applications, from simple web servers to complex distributed systems.
Core Concepts
- Instance — a virtual server with CPU, memory, storage, and networking
- AMI — Amazon Machine Image, a template for launching instances
- Instance type — hardware configuration (t3.micro, m5.xlarge, etc.)
- Security group — virtual firewall controlling inbound/outbound traffic
- Key pair — SSH authentication for Linux instances
- EBS — Elastic Block Store, persistent block storage volumes
Launching Instances
# Launch a basic EC2 instance
aws ec2 run-instances \
--image-id ami-0c55b159cbfafe1f0 \
--instance-type t3.micro \
--key-name my-key-pair \
--security-group-ids sg-0123456789abcdef0 \
--subnet-id subnet-0123456789abcdef0 \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=web-server-1}]' \
--count 1
# Launch with user data script for bootstrapping
aws ec2 run-instances \
--image-id ami-0c55b159cbfafe1f0 \
--instance-type t3.small \
--key-name my-key-pair \
--security-group-ids sg-0123456789abcdef0 \
--user-data file://setup.sh \
--iam-instance-profile Name=ec2-app-role \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=app-server},{Key=Env,Value=prod}]'
# setup.sh — bootstrap script for EC2 instance
#!/bin/bash
yum update -y
yum install -y docker
systemctl start docker
systemctl enable docker
docker pull myapp:latest
docker run -d -p 80:8080 myapp:latest
Instance Management
# List running instances with key details
aws ec2 describe-instances \
--filters "Name=instance-state-name,Values=running" \
--query 'Reservations[].Instances[].[InstanceId,InstanceType,PublicIpAddress,Tags[?Key==`Name`].Value|[0]]' \
--output table
# Stop, start, terminate instances
aws ec2 stop-instances --instance-ids i-0123456789abcdef0
aws ec2 start-instances --instance-ids i-0123456789abcdef0
aws ec2 terminate-instances --instance-ids i-0123456789abcdef0
# Resize an instance (must be stopped first)
aws ec2 stop-instances --instance-ids i-0123456789abcdef0
aws ec2 modify-instance-attribute \
--instance-id i-0123456789abcdef0 \
--instance-type '{"Value": "t3.large"}'
aws ec2 start-instances --instance-ids i-0123456789abcdef0
Security Groups
# Create a security group for a web server
aws ec2 create-security-group \
--group-name web-sg \
--description "Allow HTTP, HTTPS, SSH" \
--vpc-id vpc-0123456789abcdef0
# Add inbound rules
aws ec2 authorize-security-group-ingress \
--group-id sg-0123456789abcdef0 \
--ip-permissions \
'IpProtocol=tcp,FromPort=80,ToPort=80,IpRanges=[{CidrIp=0.0.0.0/0}]' \
'IpProtocol=tcp,FromPort=443,ToPort=443,IpRanges=[{CidrIp=0.0.0.0/0}]' \
'IpProtocol=tcp,FromPort=22,ToPort=22,IpRanges=[{CidrIp=203.0.113.0/24,Description=Office}]'
AMIs
# Create an AMI from a running instance
aws ec2 create-image \
--instance-id i-0123456789abcdef0 \
--name "app-server-v1.2.0-$(date +%Y%m%d)" \
--description "App server with latest patches" \
--no-reboot
# List your AMIs
aws ec2 describe-images --owners self \
--query 'Images[*].[ImageId,Name,CreationDate]' --output table
# Deregister old AMI and delete snapshot
aws ec2 deregister-image --image-id ami-0123456789abcdef0
aws ec2 delete-snapshot --snapshot-id snap-0123456789abcdef0
EBS Volumes
# Create and attach an EBS volume
aws ec2 create-volume \
--size 100 \
--volume-type gp3 \
--availability-zone us-east-1a \
--iops 3000 \
--throughput 125 \
--tag-specifications 'ResourceType=volume,Tags=[{Key=Name,Value=data-vol}]'
# Attach volume to instance
aws ec2 attach-volume \
--volume-id vol-0123456789abcdef0 \
--instance-id i-0123456789abcdef0 \
--device /dev/xvdf
# Create a snapshot for backup
aws ec2 create-snapshot \
--volume-id vol-0123456789abcdef0 \
--description "Daily backup $(date +%Y-%m-%d)" \
--tag-specifications 'ResourceType=snapshot,Tags=[{Key=Name,Value=daily-backup}]'
Auto Scaling
# Create a launch template
aws ec2 create-launch-template \
--launch-template-name app-server-template \
--launch-template-data '{
"ImageId": "ami-0c55b159cbfafe1f0",
"InstanceType": "t3.medium",
"SecurityGroupIds": ["sg-0123456789abcdef0"],
"KeyName": "my-key-pair",
"IamInstanceProfile": {"Name": "ec2-app-role"},
"UserData": "'$(base64 -w0 setup.sh)'"
}'
# Create an auto-scaling group
aws autoscaling create-auto-scaling-group \
--auto-scaling-group-name app-asg \
--launch-template LaunchTemplateName=app-server-template,Version='$Latest' \
--min-size 2 \
--max-size 10 \
--desired-capacity 2 \
--vpc-zone-identifier "subnet-aaa,subnet-bbb" \
--target-group-arns "arn:aws:elasticloadbalancing:us-east-1:123456789:targetgroup/app-tg/abc123" \
--health-check-type ELB \
--health-check-grace-period 300
# Create scaling policy based on CPU
aws autoscaling put-scaling-policy \
--auto-scaling-group-name app-asg \
--policy-name cpu-scale-out \
--policy-type TargetTrackingScaling \
--target-tracking-configuration '{
"PredefinedMetricSpecification": {"PredefinedMetricType": "ASGAverageCPUUtilization"},
"TargetValue": 70.0,
"ScaleInCooldown": 300,
"ScaleOutCooldown": 60
}'
Spot Instances
# Request spot instances for cost savings (up to 90% off)
aws ec2 request-spot-instances \
--instance-count 3 \
--type "one-time" \
--launch-specification '{
"ImageId": "ami-0c55b159cbfafe1f0",
"InstanceType": "c5.xlarge",
"SecurityGroupIds": ["sg-0123456789abcdef0"],
"SubnetId": "subnet-0123456789abcdef0"
}'
Best Practices
- Use launch templates over launch configurations for versioning
- Place instances in private subnets; use a bastion host or SSM for access
- Enable detailed monitoring for production workloads
- Use auto-scaling with target tracking for hands-off scaling
- Tag everything for cost allocation and resource management
- Use spot instances for fault-tolerant, flexible workloads
- Rotate AMIs regularly with latest security patches
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供完整的 AWS EC2 实例生命周期管理功能
- 涵盖安全组、AMI、EBS、自动扩展等核心 AWS 服务
- 包含 Spot 实例等成本优化方案
- 适用于从简单 Web 服务器到复杂分布式系统的各种场景
Highlights
- 触发词精准覆盖 EC2 核心功能
- 明确描述可扩展计算、高可用性和成本优化等关键特性
- 边界清晰,能准确匹配用户相关需求
Highlights
- 文档结构清晰,章节划分合理
- 每个功能模块都有完整的命令示例
- frontmatter 信息完整,包含兼容性说明
- 提供端到端的操作示例和最佳实践
Highlights
- 所有命令基于标准 AWS CLI,来源明确
- 参数使用正确,命令示例完整
- 覆盖了 EC2 管理的各种主要场景
- 提供了从基础到高级的完整操作链
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 63 -
Cloud changes and possible charges
Preview changes and verify account, region, permissions and costs. Confirm creation, deployment or deletion separately.
Mentioned in main document · lines 100, 120, 136, 143, 162
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
!/bin/bash yum update -y yum install -y docker systemctl start docker systemctl enable docker docker pull myapp:latest docker run -d -p 80:8080 myapp:latest ```
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.