Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)48k · #3865

aws-s3

Skill này làm gì

Công cụ này giúp quản lý lưu trữ tệp trên đám mây của Amazon (AWS S3). Bạn có thể tạo các vị trí an toàn để lưu tệp, xác định ai được truy cập và đặt quy tắc tự động sắp xếp hoặc xóa các tệp cũ.

Khi nào nên dùng

  • ✓Khi bạn tạo một vị trí lưu trữ an toàn mới cho các tệp quan trọng.
  • ✓Khi bạn xác định ai được xem hoặc chỉnh sửa tệp của mình.
  • ✓Khi bạn sắp xếp tệp để các tệp cũ được chuyển sang kho lưu trữ rẻ hơn hoặc bị xóa.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/aws-s3/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/aws-s3/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Thiết lập một 'bucket' mới để lưu ảnh khách hàng, chặn truy cập công khai và bật mã hóa.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn dùng các lệnh cụ thể để yêu cầu AWS thực hiện. Ví dụ, một lệnh tạo 'bucket', một lệnh chặn truy cập công khai, và một lệnh bật mã hóa để bảo vệ dữ liệu của bạn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

AWS S3

Manage Amazon S3 object storage with production-grade security, lifecycle policies, replication, and access controls.

When to Use This Skill

  • Creating S3 buckets with security hardening (encryption, public access block, versioning)
  • Writing bucket policies to enforce HTTPS, restrict IP ranges, or grant cross-account access
  • Setting up lifecycle rules to transition objects between storage classes
  • Configuring cross-region replication for disaster recovery
  • Generating presigned URLs for temporary access to private objects
  • Setting up static website hosting or CloudFront origins
  • Troubleshooting access denied errors or policy conflicts

Prerequisites

  • AWS CLI v2 installed and configured
  • IAM permissions: s3:*, s3-object-lambda:*, kms:* (for SSE-KMS)
  • For replication: IAM role with replication permissions and destination bucket in target region
  • For logging: a separate logging bucket with appropriate ACL

Create and Secure a Bucket

# Create a bucket (us-east-1 does not need LocationConstraint)
aws s3api create-bucket \
  --bucket my-app-data-prod \
  --region us-east-1

# Create a bucket in another region
aws s3api create-bucket \
  --bucket my-app-data-dr \
  --region us-west-2 \
  --create-bucket-configuration LocationConstraint=us-west-2

# Block ALL public access (always do this first)
aws s3api put-public-access-block \
  --bucket my-app-data-prod \
  --public-access-block-configuration '{
    "BlockPublicAcls": true,
    "IgnorePublicAcls": true,
    "BlockPublicPolicy": true,
    "RestrictPublicBuckets": true
  }'

# Enable versioning
aws s3api put-bucket-versioning \
  --bucket my-app-data-prod \
  --versioning-configuration Status=Enabled

# Enable server-side encryption with SSE-KMS
aws s3api put-bucket-encryption \
  --bucket my-app-data-prod \
  --server-side-encryption-configuration '{
    "Rules": [{
      "ApplyServerSideEncryptionByDefault": {
        "SSEAlgorithm": "aws:kms",
        "KMSMasterKeyID": "alias/s3-key"
      },
      "BucketKeyEnabled": true
    }]
  }'

# Enable access logging
aws s3api put-bucket-logging \
  --bucket my-app-data-prod \
  --bucket-logging-status '{
    "LoggingEnabled": {
      "TargetBucket": "my-access-logs-bucket",
      "TargetPrefix": "s3-logs/my-app-data-prod/"
    }
  }'

# Add tags
aws s3api put-bucket-tagging \
  --bucket my-app-data-prod \
  --tagging '{
    "TagSet": [
      {"Key": "Environment", "Value": "production"},
      {"Key": "Team", "Value": "platform"},
      {"Key": "DataClassification", "Value": "confidential"}
    ]
  }'

Bucket Policies

# Apply a bucket policy (enforce HTTPS and restrict to VPC endpoint)
aws s3api put-bucket-policy \
  --bucket my-app-data-prod \
  --policy '{
    "Version": "2012-10-17",
    "Statement": [
      {
        "Sid": "DenyInsecureTransport",
        "Effect": "Deny",
        "Principal": "*",
        "Action": "s3:*",
        "Resource": [
          "arn:aws:s3:::my-app-data-prod",
          "arn:aws:s3:::my-app-data-prod/*"
        ],
        "Condition": {
          "Bool": {"aws:SecureTransport": "false"}
        }
      },
      {
        "Sid": "RestrictToVPCEndpoint",
        "Effect": "Deny",
        "Principal": "*",
        "Action": "s3:*",
        "Resource": [
          "arn:aws:s3:::my-app-data-prod",
          "arn:aws:s3:::my-app-data-prod/*"
        ],
        "Condition": {
          "StringNotEquals": {
            "aws:sourceVpce": "vpce-abc123"
          }
        }
      }
    ]
  }'

Cross-account access policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "CrossAccountRead",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::987654321098:role/DataAnalystRole"
      },
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::my-app-data-prod",
        "arn:aws:s3:::my-app-data-prod/shared/*"
      ]
    }
  ]
}

Lifecycle Rules

# Apply a comprehensive lifecycle configuration
aws s3api put-bucket-lifecycle-configuration \
  --bucket my-app-data-prod \
  --lifecycle-configuration '{
    "Rules": [
      {
        "ID": "TierDownOldData",
        "Status": "Enabled",
        "Filter": {"Prefix": "data/"},
        "Transitions": [
          {"Days": 30, "StorageClass": "STANDARD_IA"},
          {"Days": 90, "StorageClass": "GLACIER_IR"},
          {"Days": 180, "StorageClass": "GLACIER"},

…
Câu hỏi thường gặp

“Bucket” là gì?

Hãy coi 'bucket' như một thư mục hoặc ổ cứng trên đám mây Amazon nơi bạn lưu tệp.

“Bảo mật” trong ngữ cảnh này nghĩa là gì?

Nghĩa là chỉ những người hoặc hệ thống được ủy quyền mới truy cập được tệp của bạn, và dữ liệu được bảo vệ khỏi truy cập trái phép hoặc mất mát.

“Lifecycle rules” là gì?

Đó là các chỉ dẫn để AWS tự động chuyển tệp sang lựa chọn lưu trữ rẻ hơn sau một thời gian, hoặc xóa chúng khi không còn cần thiết, giúp tiết kiệm tiền.

Chi tiết

Mô tả gốc của tác giả

Configure S3 buckets, policies, and lifecycle rules. Implement versioning, replication, and security. Use when managing object storage on AWS.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#3865
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự