N8N Tools - S3 Enhanced icon

N8N Tools - S3 Enhanced

Enhanced S3 operations with presigned URLs, multipart upload, and advanced features

Overview

This node provides enhanced integration with S3-compatible storage services, enabling a wide range of bucket and object management operations. It supports advanced features such as generating presigned URLs for secure temporary access, multipart uploads for large files, and detailed bucket configurations including CORS, lifecycle, policies, tagging, versioning, logging, notifications, replication, encryption, website hosting, metrics, analytics, inventory, request payment, and acceleration.

Common scenarios where this node is beneficial include:

  • Automating file uploads and downloads to/from S3 buckets.
  • Managing bucket configurations programmatically (e.g., setting CORS rules or lifecycle policies).
  • Generating presigned URLs to securely share objects without exposing credentials.
  • Handling large file uploads efficiently using multipart upload.
  • Managing access control and metadata for buckets and objects.
  • Querying object content using SQL expressions.

Practical example: You can use this node to generate a presigned URL that allows a client to upload a file directly to an S3 bucket without needing AWS credentials, or to retrieve the CORS configuration of a bucket to verify cross-origin access settings.


Properties

Name Meaning
Bucket Name Name of the S3 bucket to operate on.

For the "Get Bucket CORS" operation specifically, only the Bucket Name property is required.


Output

The output JSON structure for the "Get Bucket CORS" operation includes:

  • bucket: The name of the bucket queried.
  • corsRules: An array of CORS rule objects configured on the bucket.

Example output JSON snippet:

{
  "bucket": "my-bucket-name",
  "corsRules": [
    {
      "AllowedMethods": ["GET", "PUT"],
      "AllowedOrigins": ["*"],
      "AllowedHeaders": ["*"]
    }
  ],
  "operation": "getBucketCors",
  "timestamp": "2024-06-01T12:00:00.000Z",
  "success": true
}

This output provides the current Cross-Origin Resource Sharing (CORS) configuration of the specified bucket.


Dependencies

  • Requires an S3-compatible storage service endpoint.
  • Requires valid API credentials with permissions to perform the requested bucket operations.
  • Uses AWS SDK clients internally for communication with the S3 service.
  • Node expects credentials to be provided via n8n's credential system (an API key credential with access key ID and secret access key).
  • No additional environment variables are explicitly required beyond standard credential setup.

Troubleshooting

Common Issues

  • Invalid Credentials: If the access key ID or secret access key is incorrect, connection tests will fail.
  • Access Denied: Insufficient permissions on the S3 bucket or account may cause errors.
  • Invalid Bucket Name: Specifying a non-existent or incorrectly named bucket will result in errors.
  • Malformed JSON Input: For operations requiring JSON input (not applicable here), invalid JSON will cause errors.

Error Messages and Resolutions

  • "S3 operation failed: <message>" — General failure during the operation; check the message for details.
  • "Invalid Access Key ID. Please check your credentials." — The access key ID is incorrect.
  • "Invalid Secret Access Key. Please check your credentials." — The secret access key is incorrect.
  • "Access denied. Check your credentials and permissions." — The credentials lack necessary permissions.
  • "Cannot connect to endpoint. Check your endpoint URL and network connection." — Network or endpoint configuration issue.
  • "Unknown operation: getBucketCors" — Operation name mismatch; ensure correct operation selection.
  • "Invalid CORS rules JSON format" — Not applicable for Get Bucket CORS but relevant for Put Bucket CORS.

To resolve issues, verify credentials, bucket names, permissions, and network connectivity.


Links and References


Summary

This node's "Get Bucket CORS" operation fetches the CORS configuration of a specified S3 bucket, allowing users to inspect how cross-origin requests are handled by the bucket. It requires only the bucket name as input and returns the CORS rules in JSON format. This is useful for managing web applications that interact with S3 resources across different origins.

Discussion