S3 Operations
Overview¶
In this lab, you'll use your AI coding agent to create and configure an Amazon S3 bucket with security best practices — versioning, encryption, public access blocking, and lifecycle rules — all through natural language prompts to the MCP Server.
What You'll Learn¶
- How to create and configure S3 buckets through your agent's MCP Server connection
- How to apply security best practices (encryption, public access blocking) via natural language
- How lifecycle rules automate object management
Instructions¶
Explore¶
Try to accomplish this goal using your agent. Here are some hints if you get stuck:
- Ask your agent to create a bucket with a unique name that includes your participant ID
- Tell your agent you want versioning enabled, server-side encryption with AES-256, and all public access blocked
- Ask your agent to add a lifecycle rule that transitions objects to Glacier after 90 days
Step-by-step Walkthrough
- Open your agent and enter the following prompt:
Create an S3 bucket named
workshop-secure-{participant-id}with the following configuration: versioning enabled, server-side encryption using AES-256, all public access blocked, and a lifecycle rule that transitions objects to S3 Glacier after 90 days.
Replace {participant-id} with your actual participant ID from the Workshop Studio console.
- Your agent will make several API calls through the MCP Server:
CreateBucketto create the bucketPutBucketVersioningto enable versioningPutBucketEncryptionto configure SSE-AES256PutPublicAccessBlockto block all public access-
PutBucketLifecycleConfigurationto add the Glacier transition rule -
Verify the configuration by asking your agent:
Show me the current configuration of the workshop-secure bucket — versioning status, encryption settings, public access block, and lifecycle rules.
- Your agent should confirm all settings are correctly applied.
Validation¶
Open the CloudWatch Dashboard in the AWS Console. The Module 3 widget checks:
- ✅ S3 bucket versioning is Enabled
- ✅ Public access block is set to block all
You can also ask your agent:
Check if my workshop-secure bucket has versioning enabled and public access fully blocked.
Agent-Specific Tips¶
Claude Code can chain multiple S3 configuration calls in a single response. If the bucket already exists, ask Claude to just update the configuration:
Kiro will use the AWS MCP tools to make API calls. You can ask Kiro to explain each API call it makes:
Cursor with the AWS toolkit can execute the S3 operations through the MCP Server. Be explicit about the bucket name to avoid Cursor creating a random name: