用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-aws --skill aws-iam-setup命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | aws-iam-setup |
| description | Configure AWS IAM users, roles, policies, and identity federation |
| sasmp_version | 1.3.0 |
| bonded_agent | 01-aws-fundamentals |
| bond_type | PRIMARY_BOND |
Configure secure identity and access management for AWS resources.
| Attribute | Value |
|---|---|
| AWS Service | IAM |
| Complexity | Medium |
| Est. Time | 15-30 min |
| Prerequisites | AWS account, admin access |
| Parameter | Type | Description | Validation |
|---|---|---|---|
| entity_type | string | user, role, group, policy | enum |
| entity_name | string | Name for the entity | ^[a-zA-Z0-9+=,.@_-]{1,64}$ |
| action | string | create, update, delete, attach | enum |
| Parameter | Type | Default | Description |
|---|---|---|---|
| path | string | / | IAM path for organization |
| max_session_duration | int | 3600 | Role session duration (seconds) |
| permissions_boundary | string | null | ARN of permissions boundary |
| tags | object | {} | Resource tags |
# Create user with console access
aws iam create-user --user-name $USERNAME --path /developers/
# Create access keys
aws iam create-access-key --user-name $USERNAME
# Attach managed policy
aws iam attach-user-policy \
--user-name $USERNAME \
--policy-arn arn:aws:iam::aws:policy/PowerUserAccess
# Create role with trust policy
aws iam create-role \
--role-name $ROLE_NAME \
--assume-role-policy-document file://trust-policy.json \
--max-session-duration 7200
# Attach policy
aws iam attach-role-policy \
--role-name $ROLE_NAME \
--policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {"Service": "ec2.amazonaws.com"},
"Action": "sts:AssumeRole"
}
]
}
def iam_operation_with_retry(operation, max_retries=3):
for attempt in range(max_retries):
try:
return operation()
except iam.exceptions.LimitExceededException:
time.sleep(2 ** attempt)
raise Exception("Max retries exceeded")
| Symptom | Cause | Solution |
|---|---|---|
| EntityAlreadyExists | Duplicate name | Use unique name or update |
| MalformedPolicyDocument | Invalid JSON | Validate policy syntax |
| LimitExceeded | Too many entities | Delete unused or request increase |
def test_iam_role_creation():
# Arrange
role_name = "test-role-" + str(uuid.uuid4())[:8]
# Act
role = create_iam_role(role_name, trust_policy)
# Assert
assert role["Arn"].endswith(role_name)
# Cleanup
delete_iam_role(role_name)
assets/iam-policies.yaml - Common policy templates