用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-aws --skill aws-s3-management命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | aws-s3-management |
| description | Configure S3 buckets with security, lifecycle, and replication policies |
| sasmp_version | 1.3.0 |
| bonded_agent | 03-aws-storage |
| bond_type | PRIMARY_BOND |
Manage S3 buckets with enterprise security and cost optimization.
| Attribute | Value |
|---|---|
| AWS Service | S3 |
| Complexity | Low-Medium |
| Est. Time | 5-15 min |
| Prerequisites | AWS account |
| Parameter | Type | Description | Validation |
|---|---|---|---|
| bucket_name | string | Globally unique name | ^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$ |
| region | string | AWS region | Valid region code |
| Parameter | Type | Default | Description |
|---|---|---|---|
| versioning | bool | false | Enable versioning |
| encryption | string | AES256 | SSE-S3, SSE-KMS, or none |
| public_access_block | bool | true | Block public access |
| lifecycle_rules | array | [] | Lifecycle configurations |
| cors_rules | array | [] | CORS configuration |
1. Validate bucket name availability
2. Create bucket with region
3. Configure Block Public Access
4. Enable encryption
5. Set versioning (if enabled)
6. Apply lifecycle rules
7. Configure logging
# Create bucket
aws s3api create-bucket \
--bucket my-secure-bucket \
--region us-east-1
# Block public access
aws s3api put-public-access-block \
--bucket my-secure-bucket \
--public-access-block-configuration \
"BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"
# Enable encryption
aws s3api put-bucket-encryption \
--bucket my-secure-bucket \
--server-side-encryption-configuration '{
"Rules": [{
"ApplyServerSideEncryptionByDefault": {
"SSEAlgorithm": "AES256"
}
}]
}'
# Enable versioning
aws s3api put-bucket-versioning \
--bucket my-secure-bucket \
--versioning-configuration Status=Enabled
{
"Rules": [
{
"ID": "MoveToGlacier",
"Status": "Enabled",
"Filter": {"Prefix": "logs/"},
"Transitions": [
{"Days": 30, "StorageClass": "STANDARD_IA"},
{"Days": 90, "StorageClass": "GLACIER"}
],
"Expiration": {"Days": 365}
}
]
}
def s3_operation_with_retry(operation, max_retries=3):
for attempt in range(max_retries):
try:
return operation()
except s3.exceptions.SlowDown:
wait = 2 ** attempt
time.sleep(wait)
except s3.exceptions.ServiceUnavailable:
time.sleep(2 ** attempt)
raise Exception("Max retries exceeded")
BucketSizeBytes - Total bucket sizeNumberOfObjects - Object countAllRequests - Request count4xxErrors / 5xxErrors - Error ratesbucket_owner bucket [time] remote_ip requester request_id operation key
| Symptom | Cause | Solution |
|---|---|---|
| BucketAlreadyExists | Name taken globally | Choose unique name |
| AccessDenied | IAM or bucket policy | Check both policies |
| SlowDown | Request rate exceeded | Add random prefix to keys |
| NoSuchBucket | Bucket deleted | Verify bucket exists |
Check order:
1. IAM user/role policy (s3:GetObject, etc.)
2. Bucket policy (Principal, Resource)
3. Block Public Access settings
4. Object ACL (if ACLs enabled)
5. VPC Endpoint policy (if using)
| Storage Class | Cost | Retrieval | Use Case |
|---|---|---|---|
| Standard | $$$ | Instant | Frequent access |
| Intelligent-Tiering | $$ | Instant | Unknown pattern |
| Standard-IA | $ | Instant | Infrequent |
| Glacier Instant | ¢ | Milliseconds | Archive, quick access |
| Glacier Flexible | ¢ | Minutes-hours | Archive |
| Glacier Deep Archive | ¢ | Hours | Long-term |
def test_s3_bucket_creation():
# Arrange
bucket_name = f"test-bucket-{uuid.uuid4().hex[:8]}"
# Act
s3.create_bucket(Bucket=bucket_name)
s3.put_public_access_block(
Bucket=bucket_name,
PublicAccessBlockConfiguration={
'BlockPublicAcls': True,
'IgnorePublicAcls': True,
'BlockPublicPolicy': True,
'RestrictPublicBuckets': True
}
)
# Assert
response = s3.get_public_access_block(Bucket=bucket_name)
assert response['PublicAccessBlockConfiguration']['BlockPublicAcls']
# Cleanup
s3.delete_bucket(Bucket=bucket_name)
assets/s3-lifecycle.json - Lifecycle configuration template