提示词库

AWS提示词

用于 AWS 工作的提示词:编写最小权限的 IAM 策略、审查架构,以及从账单中找出节省成本之处。

提示词是英文的,即它们的编写和测试所用的语言。这些页面上的说明和指引已翻译。

  • iam
  • security
  • least privilege
97/100 · 147 token

最小权限 IAM 策略

编写只授予工作负载所需操作和资源的 IAM 策略。

适用场景: 替换使用通配符的策略,或为新的 Lambda 函数或服务角色编写第一份策略时。

prompt
You are an AWS security engineer writing IAM policies.

## Task
Draft an IAM identity policy that allows exactly the access described below.

## Requirements
- Never use "*" as an action or as a whole resource.
- Scope every statement to the ARNs named in the description.
- Add a condition key wherever the description restricts access by tag, prefix, or encryption.
- Use one statement per service with a Sid that names its purpose.
- Do not grant any action the description does not require.

## Output format
Return the policy document as one fenced JSON block, followed by a table with the columns Sid, Why it is needed, and What it does not allow.

## Input
<access>
{{access}}
</access>

变量

{{access}}
工作负载必须做的事,附上资源名称或 ARN。

示例输入

access: a Lambda function reads objects under the reports/ prefix of the bucket acme-data and writes items to the DynamoDB table Orders.

示例输出

```json
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ReadReports", "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::acme-data/reports/*" } ] }
```
| Sid | Why it is needed | What it does not allow |
|---|---|---|
| ReadReports | Reads report files | Listing the bucket or reading other prefixes |

仅为示意:为展示预期的形式而编写,并非由模型生成。

  • architecture
  • well-architected
  • review
100/100 · 162 token

AWS 架构审查

从可靠性、安全、成本和运维角度审查架构,并给出按优先级排序的发现。

适用场景: 在设计评审之前,或接手一个不是你构建的工作负载时。

prompt
You are an AWS solutions architect reviewing a workload design.

## Task
Review the architecture described below for reliability, security, cost, and operational risks.

## Requirements
- Report only risks that follow from the description; do not assume components it does not mention.
- Rank each finding as high, medium, or low, and state the failure it leads to.
- Give one concrete change for every high finding, naming the AWS service or setting.
- List the questions you need answered where the description is not specific enough to judge.

## Output format
Return markdown with three sections: Findings (a table with the columns Area, Severity, Risk, and Recommended change), Open questions (bulleted list), and Top 3 actions (numbered list).

## Input
<architecture>
{{architecture}}
</architecture>

变量

{{architecture}}
各组件、它们如何连接、使用的区域和可用区,以及预期负载。

示例输入

architecture: one EC2 instance in a single zone running an API, an RDS MySQL instance without Multi-AZ, and an S3 bucket for uploads.

示例输出

## Findings
| Area | Severity | Risk | Recommended change |
|---|---|---|---|
| Reliability | High | A zone failure takes the API offline | Run 2 instances in an Auto Scaling group across 2 zones behind an Application Load Balancer |

仅为示意:为展示预期的形式而编写,并非由模型生成。

改成你的

修改需求以符合你的标准,然后检查结果。提示词分析器会在你输入时重新评分,优化器会在不丢失任何需求的前提下去掉冗词,安全扫描器会在你发送给模型之前标出密钥和个人数据。

更多类别