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
Put Bucket CORS
AI-generatedOverview
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 accelerate settings.
The "Put Bucket CORS" operation specifically allows users to set or update the Cross-Origin Resource Sharing (CORS) configuration on an S3 bucket. This is useful when you want to control how resources in your bucket can be accessed from web pages hosted on different domains, enabling safe cross-origin requests.
Practical examples:
- Configuring a bucket to allow web applications hosted on other domains to read or write objects.
- Setting allowed HTTP methods (e.g., GET, PUT) and origins (e.g.,
*for all origins or specific domains). - Defining which headers are permitted in cross-origin requests.
Properties
| Name | Meaning |
|---|---|
| Bucket Name | The name of the S3 bucket where the CORS configuration will be applied. |
| CORS Rules | JSON array defining the CORS rules. Each rule specifies AllowedMethods, AllowedOrigins, and AllowedHeaders. Example: [{"AllowedMethods":["GET","PUT"],"AllowedOrigins":["*"],"AllowedHeaders":["*"]}] |
Output
The output JSON contains the following fields:
bucket: The name of the bucket where the CORS configuration was updated.corsRules: The array of CORS rules that were applied.message: Confirmation string indicating successful update of the bucket's CORS configuration.operation: The operation performed (putBucketCors).timestamp: ISO timestamp of when the operation was executed.success: Boolean indicating the success status (trueif successful).
Example output JSON snippet:
{
"bucket": "my-bucket-name",
"corsRules": [
{
"AllowedMethods": ["GET", "PUT"],
"AllowedOrigins": ["*"],
"AllowedHeaders": ["*"]
}
],
"message": "Bucket CORS configuration updated successfully",
"operation": "putBucketCors",
"timestamp": "2024-06-01T12:00:00.000Z",
"success": true
}
Dependencies
- Requires connection credentials for an S3-compatible service, including access key ID, secret access key, optional session token, region, and optionally a custom endpoint.
- Uses AWS SDK for JavaScript v3 under the hood.
- The node expects valid JSON input for the CORS rules property.
- No additional environment variables are required beyond the configured credentials.
Troubleshooting
- Invalid CORS rules JSON format: If the provided CORS rules JSON is malformed, the node throws an error indicating invalid JSON format. Ensure the JSON is correctly structured and valid.
- Access Denied or Permission Errors: Make sure the credentials used have sufficient permissions to modify the bucket's CORS configuration.
- Bucket Not Found: Verify that the specified bucket exists and is accessible with the provided credentials.
- Network or Endpoint Issues: Check network connectivity and ensure the endpoint URL (if custom) is correct and reachable.
- General AWS SDK errors: The node surfaces errors from the underlying SDK; reading the error message usually helps identify issues like invalid parameters or service limits.