aws-compute
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAmazon EC2 Compute
Amazon EC2 计算服务
Best experience with the AWS MCP server; also works with the AWS CLI alone — no hard dependency on either.
在AWS MCP服务器上使用体验最佳;也可单独配合AWS CLI使用——无强制依赖。
Critical Warnings
重要警告
Launch configurations are deprecated and do not support current EC2 instance types; new accounts cannot create them. Use launch templates for every new Auto Scaling group. See auto-scaling.md.
ASGs ignore ELB health checks by default: An Auto Scaling group only uses EC2 status checks unless you set . Without it, instances failing the load balancer's health check stay in service forever. See auto-scaling.md.
--health-check-type ELBIMDSv2 hop limit breaks containers: the default of 1 makes the IMDSv2 token PUT response fail to reach a containerized process (the extra hop exceeds the response TTL), so the token request times out. Set for bridge/awsvpc container workloads. (If IMDSv2 is required, a subsequent tokenless GET returns ; if optional, it silently falls back to IMDSv1.) See provisioning.md.
HttpPutResponseHopLimitHttpPutResponseHopLimit=2401T3/T3a/T4g default to unlimited mode: Unlike T2 (standard), these burst without throttling but bill surplus CPU credits when 24h-average CPU exceeds baseline — a silent cost leak. See instance-selection.md.
Instance store is ephemeral: Data on instance store volumes is lost on stop, hibernate, terminate, instance-type change, and host failure — it survives only a reboot. Put anything durable on EBS/EFS/S3. See instance-selection.md.
启动配置已被弃用,且不支持当前EC2实例类型;新账户无法创建启动配置。所有新的Auto Scaling组请使用启动模板。详见auto-scaling.md。
ASG默认忽略ELB健康检查:Auto Scaling组默认仅使用EC2状态检查,除非设置。若未设置,未通过负载均衡器健康检查的实例会一直处于服务状态。详见auto-scaling.md。
--health-check-type ELBIMDSv2跳数限制会导致容器故障:默认的值为1,会使IMDSv2令牌PUT请求无法到达容器化进程(额外的跳数超过了响应TTL),导致令牌请求超时。对于bridge/awsvpc容器工作负载,请设置。(如果强制要求IMDSv2,后续无令牌的GET请求会返回;如果是可选模式,则会自动回退到IMDSv1。)详见provisioning.md。
HttpPutResponseHopLimitHttpPutResponseHopLimit=2401T3/T3a/T4g默认采用无限制模式:与T2(标准模式)不同,这些实例可无限制突增,但当24小时平均CPU使用率超过基线时,会收取超额CPU信用费用——这是一种隐性成本损耗。详见instance-selection.md。
实例存储是临时的:实例存储卷上的数据会在停止、休眠、终止、实例类型变更或主机故障时丢失——仅重启时会保留。所有需要持久化的数据请存储在EBS/EFS/S3上。详见instance-selection.md。
Which do you need?
你需要哪个指南?
| If you're deciding... | Guidance |
|---|---|
| Instance family / size / Graviton / GPU / burstable | instance-selection.md — start with the workload→family table |
| How to define instances once and reuse (launch template) | provisioning.md |
| How to run many instances that scale automatically | auto-scaling.md |
| How to access/patch/manage instances without SSH keys | systems-manager.md |
| 如果你正在决定... | 指引 |
|---|---|
| 实例系列/规格/Graviton/GPU/可突增实例 | instance-selection.md — 从工作负载→实例系列对照表开始 |
| 如何一次性定义实例并重复使用(启动模板) | provisioning.md |
| 如何运行可自动扩展的多实例集群 | auto-scaling.md |
| 如何无需SSH密钥即可访问/补丁/管理实例 | systems-manager.md |
Quick Navigation
快速导航
| You want to... | Go to |
|---|---|
| Pick an instance type, Graviton vs x86, burstable credits, GPU, instance store vs EBS | instance-selection.md |
| Create a launch template, user data, key pairs, IMDSv2, placement groups, Elastic IPs | provisioning.md |
| Set up or fix an Auto Scaling group, scaling policies, instance refresh, Spot, lifecycle hooks | auto-scaling.md |
| Get SSH-less access, patch a fleet, or fix an instance not showing as a managed node | systems-manager.md |
| Create, share, or retire (deprecate/disable/deregister) an AMI | ami-management.md |
| Fix something broken (can't connect, status-check fail, capacity error, stuck instances) | troubleshooting.md |
| 你想要... | 前往 |
|---|---|
| 选择实例类型、Graviton vs x86、可突增信用、GPU、实例存储 vs EBS | instance-selection.md |
| 创建启动模板、用户数据、密钥对、IMDSv2、放置组、弹性IP | provisioning.md |
| 搭建或修复Auto Scaling组、扩展策略、实例刷新、Spot实例、生命周期钩子 | auto-scaling.md |
| 实现无SSH访问、给集群打补丁,或修复未显示为受管节点的实例 | systems-manager.md |
| 创建、共享或淘汰(弃用/禁用/注销)AMI | ami-management.md |
| 修复故障(无法连接、状态检查失败、容量错误、实例卡住) | troubleshooting.md |
Common Workflows
常见工作流
"Stand up an autoscaling web fleet" → Create a launch template (AMI, type, IMDSv2), then an ASG referencing it with and a target-tracking policy, see auto-scaling.md. For the public entry point, secure the load balancer (TLS/ACM, WAF, security response headers) per the Security Considerations below and the load-balancer notes in auto-scaling.md — the load-balancer build itself belongs to .
--health-check-type ELBaws-networking"Roll out a new AMI to my fleet" → New launch template version → instance refresh; pin a numeric launch-template version so rollback works, see auto-scaling.md.
"Connect to a private instance without a bastion" → Give the instance SSM permissions (an instance profile with , or account-level DHMC) plus a network path, then use Session Manager, see systems-manager.md.
AmazonSSMManagedInstanceCore"Cut EC2 cost" → Right-size (burstable vs fixed-performance), Graviton where the app supports Arm64, Spot with for fault-tolerant fleets, release idle Elastic IPs, see instance-selection.md.
price-capacity-optimized"搭建自动扩展的Web集群" → 创建启动模板(AMI、实例类型、IMDSv2),然后创建引用该模板的ASG,设置和目标追踪策略,详见auto-scaling.md。对于公共入口点,请根据下方安全注意事项和auto-scaling.md中的负载均衡器说明,对负载均衡器进行安全配置(TLS/ACM、WAF、安全响应头)——负载均衡器的搭建本身属于范畴。
--health-check-type ELBaws-networking"将新AMI推送到我的集群" → 创建新的启动模板版本→执行实例刷新;固定启动模板的数字版本,以便回滚操作生效,详见auto-scaling.md。
"无需堡垒机即可连接私有实例" → 为实例赋予SSM权限(带有的实例配置文件,或账户级DHMC)并确保网络路径可用,然后使用Session Manager,详见systems-manager.md。
AmazonSSMManagedInstanceCore"降低EC2成本" → 优化实例规格(可突增型 vs 固定性能型)、在应用支持Arm64的情况下使用Graviton、对容错集群使用模式的Spot实例、释放闲置的弹性IP,详见instance-selection.md。
price-capacity-optimizedTroubleshooting
故障排查
| Symptom | Likely cause | Quick fix |
|---|---|---|
| SSH "Connection timed out" | Network path (SG/NACL/route/no public IP) | Open TCP 22 from your IP; check route to IGW; verify public IP — see troubleshooting.md |
| SSH "Connection refused" | Host: sshd down or still booting | Wait for boot; check sshd/port via Session Manager or serial console |
| AWS lacks capacity of that type in the AZ (NOT a quota) | Try another AZ / instance type / retry; don't request a quota increase |
| vCPU quota reached (this IS a quota) | Request a Service Quotas increase for the instance family |
| ASG never replaces LB-unhealthy instances | Health check type still EC2 | Set |
Instances stuck in | Lifecycle hook never completed (heartbeat 3600s, default ABANDON) | Call |
| System status check failed | AWS host/hardware | Stop/start to migrate to new hardware (reboot won't) |
| Instance status check failed | Instance OS/network config | Reboot or fix the OS/network config |
Full tables and more errors in troubleshooting.md.
| 症状 | 可能原因 | 快速修复 |
|---|---|---|
| SSH "连接超时" | 网络路径问题(安全组/NACL/路由/无公网IP) | 从你的IP开放TCP 22端口;检查到IGW的路由;验证公网IP — 详见troubleshooting.md |
| SSH "连接被拒绝" | 主机问题:sshd未启动或仍在启动中 | 等待启动完成;通过Session Manager或串行控制台检查sshd/端口状态 |
| AWS在该可用区缺少对应类型的实例容量(不是配额问题) | 尝试其他可用区/实例类型/重试;不要申请配额提升 |
| 已达到vCPU配额(这属于配额问题) | 针对对应实例系列申请服务配额提升 |
| ASG从未替换LB不健康的实例 | 健康检查类型仍为EC2 | 设置 |
实例卡在 | 生命周期钩子未完成(心跳超时3600秒,默认操作是ABANDON) | 调用 |
| 系统状态检查失败 | AWS主机/硬件问题 | 停止/启动实例以迁移到新硬件(重启无效) |
| 实例状态检查失败 | 实例操作系统/网络配置问题 | 重启实例或修复操作系统/网络配置 |
完整表格和更多错误信息请见troubleshooting.md。
Security Considerations
安全注意事项
- Enforce IMDSv2 () on launch templates to block SSRF-based credential theft; set the account-level default per Region (applies to new launches only).
HttpTokens=required - Prefer Session Manager over inbound SSH — no open port 22, no key management, and a CloudTrail record of session API calls; enable Session Manager session logging to CloudWatch Logs/S3 (off by default) to capture the in-session commands themselves — see systems-manager.md.
- Use instance profiles, never embedded credentials; scope the role to least privilege.
- Encrypt EBS/AMIs; to share an encrypted AMI cross-account, re-encrypt under a customer-managed KMS key (the default key can't be shared).
aws/ebs - Enable CloudTrail in all Regions to audit EC2/ASG/SSM API activity, and alarm on sensitive actions (security-group changes, /
RunInstancesfrom unexpected principals) so unauthorized changes surface.TerminateInstances - For public-facing web fleets, encrypt traffic in transit with an ACM certificate on the load balancer's HTTPS listener and add AWS WAF for defense in depth against common web exploits — the load-balancer/WAF setup itself lives in .
aws-networking - For hardening beyond this guidance, see AWS EC2 security best practices and CIS Benchmarks for the guest OS.
- 强制启用IMDSv2:在启动模板中设置,以阻止基于SSRF的凭证窃取;按区域设置账户级默认值(仅适用于新启动的实例)。
HttpTokens=required - 优先使用Session Manager而非入站SSH — 无需开放22端口,无需密钥管理,且CloudTrail会记录会话API调用;启用Session Manager会话日志到CloudWatch Logs/S3(默认关闭),以捕获会话内的命令操作 — 详见systems-manager.md。
- 使用实例配置文件,切勿嵌入凭证;将角色权限限制为最小必要权限。
- 加密EBS/AMI;若要跨账户共享加密AMI,请使用客户管理的KMS密钥重新加密(默认的密钥无法共享)。
aws/ebs - 在所有区域启用CloudTrail,以审计EC2/ASG/SSM API活动,并对敏感操作(安全组变更、来自非预期主体的/
RunInstances操作)设置告警,以便及时发现未授权变更。TerminateInstances - 对于面向公网的Web集群,在负载均衡器的HTTPS监听器上使用ACM证书加密传输中的流量,并添加AWS WAF以深度防御常见Web漏洞 — 负载均衡器/WAF的配置本身属于范畴。
aws-networking - 如需本指南之外的加固建议,请参考AWS EC2安全最佳实践和针对客户操作系统的CIS基准。
Not Covered By This Skill
本技能未涵盖的内容
- Launching a single hardened instance with best-practice defaults → use the skill
launching-ec2-instance-with-best-practices - Creating IAM roles / instance profiles for EC2 → use the skill
setting-up-ec2-instance-profiles - Building AMIs with an Image Builder pipeline → use the skill
creating-ec2-image-builder-pipeline - Lambda / serverless → ; ECS/Fargate →
aws-serverless; EKS/Kubernetes →aws-containerskubernetes - VPC, subnets, ALB/NLB, endpoints → or built-in knowledge
aws-networking - IAM policy logic and CloudWatch dashboards/agent setup → ,
aws-iamaws-observability
- 使用最佳实践默认值启动单个加固实例 → 使用技能
launching-ec2-instance-with-best-practices - 为EC2创建IAM角色/实例配置文件 → 使用技能
setting-up-ec2-instance-profiles - 通过Image Builder流水线构建AMI → 使用技能
creating-ec2-image-builder-pipeline - Lambda/无服务器 → ;ECS/Fargate →
aws-serverless;EKS/Kubernetes →aws-containerskubernetes - VPC、子网、ALB/NLB、端点 → 或内置知识
aws-networking - IAM策略逻辑和CloudWatch仪表盘/代理配置 → 、
aws-iamaws-observability