N8N Tools - S3 Enhanced
Actions66
- Generate Presigned URL
- Generate Presigned POST
- Create Bucket
- Delete Bucket
- List Buckets
- Upload Object
- Download Object
- Delete Object
- List Objects
- Copy Object
- Get Object ACL
- Put Object ACL
- Get Bucket ACL
- Put Bucket ACL
- Get Bucket CORS
- Put Bucket CORS
- Delete Bucket CORS
- Get Bucket Lifecycle
- Put Bucket Lifecycle
- Delete Bucket Lifecycle
- Get Bucket Policy
- Put Bucket Policy
- Delete Bucket Policy
- Get Object Tagging
- Put Object Tagging
- Delete Object Tagging
- Get Bucket Tagging
- Put Bucket Tagging
- Delete Bucket Tagging
- Create Multipart Upload
- Upload Part
- Complete Multipart Upload
- Abort Multipart Upload
- List Parts
- List Multipart Uploads
- Get Bucket Versioning
- Put Bucket Versioning
- Get Bucket Logging
- Put Bucket Logging
- Get Bucket Notification
- Put Bucket Notification
- Get Bucket Replication
- Put Bucket Replication
- Delete Bucket Replication
- Get Bucket Encryption
- Put Bucket Encryption
- Delete Bucket Encryption
- Get Bucket Website
- Put Bucket Website
- Delete Bucket Website
- Get Bucket Metrics
- Put Bucket Metrics
- Delete Bucket Metrics
- Get Bucket Analytics
- Put Bucket Analytics
- Delete Bucket Analytics
- Get Bucket Inventory
- Put Bucket Inventory
- Delete Bucket Inventory
- Get Bucket Request Payment
- Put Bucket Request Payment
- Get Bucket Accelerate
- Put Bucket Accelerate
- Head Object
- Restore Object
- Select Object Content
Overview
This node provides enhanced operations for managing and interacting with S3-compatible object storage services. It supports a wide range of bucket and object management features, including creating and deleting buckets, uploading and downloading objects, managing access control lists (ACLs), bucket policies, CORS configurations, lifecycle rules, tagging, multipart uploads, versioning, logging, notifications, replication, encryption, website hosting, metrics, analytics, inventory, request payment settings, accelerate configuration, and more.
The "Put Bucket Policy" operation specifically allows users to set or update the policy of an S3 bucket by providing a JSON-formatted bucket policy document.
Common scenarios where this node is beneficial:
- Automating bucket policy updates to enforce security or access rules.
- Managing bucket configurations programmatically as part of CI/CD pipelines.
- Integrating S3 bucket management into workflows without manual AWS Console interaction.
- Handling complex bucket policies in JSON format directly within n8n.
Practical example:
- You want to restrict public access to a bucket by applying a specific bucket policy JSON that denies all public access except from certain IP addresses. Using this node's "Put Bucket Policy" operation, you can input the bucket name and the JSON policy to apply it automatically.
Properties
| Name | Meaning |
|---|---|
| Bucket Name | The name of the S3 bucket to which the policy will be applied. |
| Bucket Policy | The bucket policy as a JSON object defining permissions and access rules for the bucket. |
The Bucket Policy property expects a valid JSON object representing the bucket policy. For example:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-bucket-name/*"
}
]
}
Output
The output JSON contains the following fields:
bucket: The name of the bucket for which the policy was set.policy: The parsed JSON object of the bucket policy that was applied.message: A confirmation string indicating successful update, e.g.,"Bucket policy updated successfully".operation: The operation performed, here"putBucketPolicy".timestamp: ISO timestamp when the operation was executed.success: Boolean indicating if the operation succeeded (true).
Example output JSON:
{
"bucket": "my-bucket-name",
"policy": {
"Version": "2012-10-17",
"Statement": []
},
"message": "Bucket policy updated successfully",
"operation": "putBucketPolicy",
"timestamp": "2024-06-01T12:00:00.000Z",
"success": true
}
Dependencies
- Requires an S3-compatible storage service accessible via API.
- Needs credentials with sufficient permissions to put bucket policies.
- The node uses AWS SDK v3 clients internally to communicate with the S3 service.
- Requires proper configuration of credentials in n8n with access key ID, secret access key, and optionally region, endpoint, session token, and path style settings.
Troubleshooting
Common issues
- Invalid JSON format for bucket policy: If the provided bucket policy JSON is malformed, the node throws an error indicating invalid JSON format. Ensure the policy is valid JSON.
- Insufficient permissions: If the credentials do not have permission to modify bucket policies, the operation will fail with an access denied error.
- Incorrect bucket name: Providing a non-existent or misspelled bucket name will cause errors.
- Network or endpoint issues: Connection failures may occur if the endpoint URL is incorrect or network connectivity is unavailable.
Common error messages and resolutions
"Invalid bucket policy JSON format": Check and correct the JSON syntax of the bucket policy input."Access denied. Check your credentials and permissions.": Verify that the API key credential has the necessary IAM permissions to put bucket policies."S3 operation failed: <error message>": General failure; inspect the detailed error message for clues."Cannot connect to endpoint. Check your endpoint URL and network connection.": Validate the endpoint URL and network access.