aws-support-case
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAWS Support Case Manager
AWS Support Case Manager
Overview
概述
Manage AWS Support cases through CLI with intelligent features: auto-detect service/category when creating cases, translate Chinese to English for submissions, and display case communications in bilingual format (English original followed by Chinese translation).
通过CLI管理AWS Support案例,具备智能功能:创建案例时自动检测服务/分类,将中文内容翻译为英文提交,并以双语格式展示案例沟通内容(先显示英文原文,后附中文翻译)。
Prerequisites
前置条件
- AWS CLI configured with default profile
- AWS Support API access (requires Business or Enterprise Support plan for some features)
- All commands must use (Support API only available in this region)
--region us-east-1
- 已配置默认配置文件的AWS CLI
- 拥有AWS Support API访问权限(部分功能需要Business或Enterprise支持计划)
- 所有命令必须使用(Support API仅在此区域可用)
--region us-east-1
Core Workflows
核心工作流
1. List Cases
1. 列出案例
List recent 2 weeks cases:
bash
aws support describe-cases \
--region us-east-1 \
--after-time "$(date -u -v-14d '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -u -d '14 days ago' '+%Y-%m-%dT%H:%M:%SZ')" \
--include-resolved-cases \
--output jsonList unresolved cases only:
bash
aws support describe-cases \
--region us-east-1 \
--no-include-resolved-cases \
--output jsonDisplay format: Present cases in a clear table with columns: Case ID | Subject | Status | Created | Severity
列出最近两周的案例:
bash
aws support describe-cases \
--region us-east-1 \
--after-time "$(date -u -v-14d '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || date -u -d '14 days ago' '+%Y-%m-%dT%H:%M:%SZ')" \
--include-resolved-cases \
--output json仅列出未解决案例:
bash
aws support describe-cases \
--region us-east-1 \
--no-include-resolved-cases \
--output json展示格式: 以清晰表格展示案例,列包括:案例ID | 主题 | 状态 | 创建时间 | 严重程度
2. View Case Details (Bilingual Display)
2. 查看案例详情(双语显示)
To view a case with communications:
bash
aws support describe-communications \
--region us-east-1 \
--case-id "case-XXXXXXXX" \
--output jsonBilingual Display Format: When displaying case communications, format each message as follows:
---
[Sender] | [Timestamp]
---
> Original English text line 1
> 中文翻译第一行
> Original English text line 2
> 中文翻译第二行
---Translation guidelines:
- Translate each sentence/paragraph, placing English original first with prefix
> - Chinese translation immediately follows on the next line with prefix
> - Preserve technical terms (service names, error codes, ARNs) without translation
- Maintain formatting (bullet points, numbered lists) in both languages
如需查看包含沟通记录的案例:
bash
aws support describe-communications \
--region us-east-1 \
--case-id "case-XXXXXXXX" \
--output json双语展示格式: 展示案例沟通内容时,每条消息格式如下:
---
[发送方] | [时间戳]
---
> 英文原文第一行
> 中文翻译第一行
> 英文原文第二行
> 中文翻译第二行
---翻译准则:
- 逐句/逐段翻译,英文原文前缀为
> - 中文翻译紧随其后,前缀同样为
> - 保留技术术语(服务名称、错误代码、ARN)不翻译
- 保留两种语言的格式(项目符号、编号列表)
3. Create New Case
3. 创建新案例
Step 1: Query available services and categories
bash
aws support describe-services --region us-east-1 --output jsonStep 2: Auto-detect service and category
Analyze the user's description (Chinese or English) to identify:
- Service code: Match keywords to AWS services (e.g., "EC2实例" → , "S3存储桶" →
amazon-ec2)amazon-s3 - Category code: Match issue type (e.g., "性能慢" → , "无法连接" →
performance, "配额提升" →connectivity)limits
Step 3: Translate and create
If user provides Chinese description:
- Translate to professional, native English
- Use technical AWS terminology appropriately
- Keep specific identifiers (account IDs, resource ARNs, error codes) unchanged
bash
aws support create-case \
--region us-east-1 \
--subject "Translated English subject" \
--communication-body "Translated English description with full details" \
--service-code "detected-service" \
--category-code "detected-category" \
--severity-code "low|normal|high|urgent|critical" \
--language "en"Severity selection guide:
| Severity | When to use |
|---|---|
| low | General questions, non-urgent inquiries |
| normal | Production system has minor issues |
| high | Production system significantly impaired |
| urgent | Production system severely impaired |
| critical | Production system down (Enterprise only) |
步骤1:查询可用服务和分类
bash
aws support describe-services --region us-east-1 --output json步骤2:自动检测服务和分类
分析用户提供的描述(中文或英文)以识别:
- 服务代码:将关键词匹配到AWS服务(例如:"EC2实例" → ,"S3存储桶" →
amazon-ec2)amazon-s3 - 分类代码:匹配问题类型(例如:"性能慢" → ,"无法连接" →
performance,"配额提升" →connectivity)limits
步骤3:翻译并创建案例
如果用户提供中文描述:
- 翻译为专业、地道的英文
- 恰当使用AWS技术术语
- 保留特定标识符(账户ID、资源ARN、错误代码)不变
bash
aws support create-case \
--region us-east-1 \
--subject "Translated English subject" \
--communication-body "Translated English description with full details" \
--service-code "detected-service" \
--category-code "detected-category" \
--severity-code "low|normal|high|urgent|critical" \
--language "en"严重程度选择指南:
| 严重程度代码 | 使用场景 |
|---|---|
| low | 一般性问题咨询、非紧急需求 |
| normal | 生产系统出现轻微问题 |
| high | 生产系统功能大幅受损 |
| urgent | 生产系统功能严重受损 |
| critical | 生产系统完全宕机(仅企业支持计划可用) |
4. Reply to Case
4. 回复案例
Step 1: Translate if needed
If user provides Chinese reply, translate to professional English while preserving:
- Technical details and identifiers
- Specific error messages or logs
- Resource names and ARNs
Step 2: Send reply
bash
aws support add-communication-to-case \
--region us-east-1 \
--case-id "case-XXXXXXXX" \
--communication-body "Translated English reply"步骤1:按需翻译
如果用户提供中文回复,翻译为专业英文,同时保留:
- 技术细节和标识符
- 特定错误消息或日志
- 资源名称和ARN
步骤2:发送回复
bash
aws support add-communication-to-case \
--region us-east-1 \
--case-id "case-XXXXXXXX" \
--communication-body "Translated English reply"5. Handle Attachments
5. 处理附件
Upload attachment:
bash
undefined上传附件:
bash
undefinedFirst, base64 encode the file
首先,对文件进行base64编码
BASE64_DATA=$(base64 -i /path/to/file)
BASE64_DATA=$(base64 -i /path/to/file)
Add to attachment set
添加到附件集
aws support add-attachments-to-set
--region us-east-1
--attachments fileName="filename.ext",data="$BASE64_DATA"
--region us-east-1
--attachments fileName="filename.ext",data="$BASE64_DATA"
This returns an `attachmentSetId` to use when replying:
```bash
aws support add-communication-to-case \
--region us-east-1 \
--case-id "case-XXXXXXXX" \
--communication-body "Please see the attached file" \
--attachment-set-id "ATTACHMENT_SET_ID"Download attachment:
bash
aws support describe-attachment \
--region us-east-1 \
--attachment-id "attachment-id"aws support add-attachments-to-set
--region us-east-1
--attachments fileName="filename.ext",data="$BASE64_DATA"
--region us-east-1
--attachments fileName="filename.ext",data="$BASE64_DATA"
此命令会返回一个`attachmentSetId`,用于回复案例时使用:
```bash
aws support add-communication-to-case \
--region us-east-1 \
--case-id "case-XXXXXXXX" \
--communication-body "Please see the attached file" \
--attachment-set-id "ATTACHMENT_SET_ID"下载附件:
bash
aws support describe-attachment \
--region us-east-1 \
--attachment-id "attachment-id"6. Close/Resolve Case
6. 关闭/解决案例
bash
aws support resolve-case \
--region us-east-1 \
--case-id "case-XXXXXXXX"bash
aws support resolve-case \
--region us-east-1 \
--case-id "case-XXXXXXXX"Service Detection Keywords
服务检测关键词
| Keywords (CN/EN) | Service Code |
|---|---|
| EC2, 实例, 虚拟机 | amazon-ec2 |
| S3, 存储桶, 对象存储 | amazon-s3 |
| RDS, 数据库, MySQL, PostgreSQL | amazon-rds |
| Lambda, 函数, 无服务器 | aws-lambda |
| VPC, 网络, 子网, 安全组 | amazon-vpc |
| ECS, 容器, Docker | amazon-ecs |
| EKS, Kubernetes, K8s | amazon-eks |
| CloudFront, CDN, 分发 | amazon-cloudfront |
| Route53, DNS, 域名 | amazon-route53 |
| IAM, 权限, 角色, 策略 | aws-iam |
| 账单, 费用, billing | aws-billing |
| 账户, 账号, account | account-management |
| 关键词(中/英) | 服务代码 |
|---|---|
| EC2, 实例, 虚拟机 | amazon-ec2 |
| S3, 存储桶, 对象存储 | amazon-s3 |
| RDS, 数据库, MySQL, PostgreSQL | amazon-rds |
| Lambda, 函数, 无服务器 | aws-lambda |
| VPC, 网络, 子网, 安全组 | amazon-vpc |
| ECS, 容器, Docker | amazon-ecs |
| EKS, Kubernetes, K8s | amazon-eks |
| CloudFront, CDN, 分发 | amazon-cloudfront |
| Route53, DNS, 域名 | amazon-route53 |
| IAM, 权限, 角色, 策略 | aws-iam |
| 账单, 费用, billing | aws-billing |
| 账户, 账号, account | account-management |
Category Detection Keywords
分类检测关键词
| Keywords (CN/EN) | Category Code |
|---|---|
| 咨询, 指导, 如何, how to | general-guidance |
| 慢, 性能, 延迟, performance, latency | performance |
| 连接, 访问, 超时, connect, timeout | connectivity |
| 安全, 漏洞, security | security |
| 配置, 设置, configuration | configuration |
| 限额, 配额, 提升, limit, quota | limits |
| 关键词(中/英) | 分类代码 |
|---|---|
| 咨询, 指导, 如何, how to | general-guidance |
| 慢, 性能, 延迟, performance, latency | performance |
| 连接, 访问, 超时, connect, timeout | connectivity |
| 安全, 漏洞, security | security |
| 配置, 设置, configuration | configuration |
| 限额, 配额, 提升, limit, quota | limits |
Resources
资源
Refer to for complete CLI command reference and additional options.
references/aws-support-cli-reference.md完整的CLI命令参考及其他选项,请参阅。
references/aws-support-cli-reference.md