AWS S3 storage handler for fractary-file plugin
Executes S3 file operations (upload, download, delete, list, read, presigned URLs) using AWS CLI with profile, IAM role, or access key authentication. Automatically triggered when performing file operations on S3 storage.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-file@fractaryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/delete.shscripts/download.shscripts/get-url.shscripts/list.shscripts/read.shscripts/upload.sh<CRITICAL_RULES>
With AWS Profile (Recommended - uses ~/.aws/config):
{
"handlers": {
"s3": {
"region": "us-east-1",
"bucket_name": "my-bucket",
"auth_method": "profile",
"profile": "test-deploy",
"endpoint": null,
"public_url": null
}
}
}
With IAM Roles (Recommended for EC2/ECS/EKS):
{
"handlers": {
"s3": {
"region": "us-east-1",
"bucket_name": "my-bucket",
"auth_method": "iam"
}
}
}
With Access Keys (Less secure, use environment variables):
{
"handlers": {
"s3": {
"region": "us-east-1",
"bucket_name": "my-bucket",
"auth_method": "keys",
"access_key_id": "${AWS_ACCESS_KEY_ID}",
"secret_access_key": "${AWS_SECRET_ACCESS_KEY}",
"endpoint": null,
"public_url": null
}
}
}
Configuration Fields:
region: AWS region (required, default: "us-east-1")bucket_name: S3 bucket name (required)auth_method: Authentication method - "profile" | "iam" | "keys" (default: "profile")profile: AWS profile name from ~/.aws/config (required if auth_method is "profile")access_key_id: AWS access key (required if auth_method is "keys")secret_access_key: AWS secret key (required if auth_method is "keys")endpoint: Custom endpoint for S3-compatible services (optional)public_url: Public URL for bucket (optional)Security Best Practices:
${AWS_ACCESS_KEY_ID}See docs/s3-setup-guide.md for detailed setup instructions. </CONFIGURATION>
<WORKFLOW> 1. Load handler configuration from request 2. Validate operation parameters 3. Determine authentication method (profile, iam, or keys) 4. Set AWS_PROFILE environment variable if using profile authentication 5. Expand environment variables in credentials (if using keys) 6. Prepare S3-specific parameters (region, bucket, credentials) 7. Execute AWS CLI command via script 8. Parse script output 9. Return structured result to agentParameter Flow:
Authentication Precedence:
{
"success": true,
"message": "Operation completed successfully",
"url": "https://my-bucket.s3.us-east-1.amazonaws.com/path/to/file",
"size_bytes": 1024,
"checksum": "sha256:abc123..."
}
Public File Upload:
{
"success": true,
"message": "File uploaded successfully (public)",
"url": "https://my-bucket.s3.us-east-1.amazonaws.com/docs/document.pdf",
"size_bytes": 2048,
"checksum": "sha256:def456..."
}
Presigned URL:
{
"success": true,
"message": "Presigned URL generated",
"url": "https://my-bucket.s3.amazonaws.com/file?X-Amz-Signature=...",
"expires_in": 3600
}
</OUTPUTS>
<ERROR_HANDLING>
<IAM_ROLES> When running in AWS (EC2, ECS, EKS, Lambda), use IAM roles instead of credentials:
Benefits:
Required IAM Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "FractaryFilePlugin",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:ListBucket",
"s3:GetObjectMetadata"
],
"Resource": [
"arn:aws:s3:::my-bucket",
"arn:aws:s3:::my-bucket/*"
]
}
]
}
See docs/iam-permissions.md for detailed permission configurations. </IAM_ROLES>