Bucket → Update
AI-generatedOverview
The node "Google Cloud Storage Enhanced" provides enhanced integration with Google Cloud Storage, allowing users to manage buckets and objects within their Google Cloud projects. Specifically for the Bucket - Update operation, it enables updating metadata and configuration of an existing storage bucket.
This operation is useful when you want to modify bucket properties such as access controls, lifecycle rules, labels, encryption settings, or other metadata without recreating the bucket. For example, you might update a bucket's storage class to optimize costs or change its CORS configuration to allow cross-origin requests from specific domains.
Practical scenarios include:
- Adjusting access permissions on a bucket after initial creation.
- Updating retention policies or versioning settings to comply with new data governance requirements.
- Changing bucket location or storage class to improve performance or reduce costs.
Properties
| Name | Meaning |
|---|---|
| Authentication | Method used to authenticate with Google Cloud: either Service Account or OAuth2. |
| Bucket Name | The name of the bucket to update. This is required to identify which bucket will be modified. |
| Projection | Determines the set of properties returned in the response. Options are: - All Properties (full) - No ACL (noAcl) |
| Filters | Optional filters applied during the update request: - Metageneration Match: Only update if the bucket's metageneration matches this value. - Metageneration Exclude: Only update if the metageneration does not match this value. |
| Predefined Access Control | Predefined access control settings to apply: - Predefined ACL: Sets a predefined set of access controls on the bucket (e.g., authenticatedRead, private, publicRead). - Predefined Default Object ACL: Sets default access controls for new objects in the bucket. |
| Additional Parameters | Various optional metadata fields to update on the bucket, including: - Access Control (acl): JSON array defining access controls. - Billing: Billing configuration. - CORS: Cross-Origin Resource Sharing settings. - Custom Placement Config: Region configuration. - Data Locations: Regions comprising a dual-region bucket. - Default Event Based Hold: Boolean to enable event-based hold. - Default Object ACL: Default object access controls. - Encryption: Encryption settings. - IAM Configuration: IAM policy configuration. - Labels: Key/value pairs for bucket labeling. - Lifecycle: Lifecycle management rules. - Location: Physical location of the bucket. - Logging: Logging configuration. - Retention Policy: Data retention settings. - Recovery Point Objective (RPO): Recovery objective setting. - Storage Class: Default storage class (e.g., STANDARD). - Versioning: Versioning configuration. - Website: Website hosting configuration. |
Output
The output json field contains the updated bucket resource representation as returned by the Google Cloud Storage API. This includes all the bucket metadata fields reflecting the changes made, such as:
- Bucket name
- Location
- Storage class
- Access control lists
- Labels
- Lifecycle rules
- Encryption settings
- Other metadata fields specified in the update
If multiple input items are processed, the output is an array of these updated bucket objects, each paired with the corresponding input item.
The node does not output binary data for this operation.
Dependencies
- Requires valid authentication credentials for Google Cloud Storage, either via a Service Account or OAuth2.
- Needs appropriate permissions on the Google Cloud project to update bucket metadata.
- Uses Google Cloud Storage REST API endpoints for bucket management.
- No additional environment variables beyond standard n8n credential setup are required.
Troubleshooting
Common Issues:
- Insufficient permissions: Ensure the authenticated user or service account has the
storage.buckets.updatepermission. - Invalid bucket name: Verify the bucket name exists and is correctly spelled.
- Metageneration mismatch errors: If using metageneration filters, ensure the values match the current bucket state; otherwise, the update will be rejected.
- Invalid JSON in additional parameters: When providing JSON fields like ACLs or lifecycle rules, ensure the JSON syntax is correct.
- Insufficient permissions: Ensure the authenticated user or service account has the
Error Messages:
- "403 Forbidden" — Usually indicates lack of permissions; check IAM roles.
- "404 Not Found" — Bucket does not exist or incorrect bucket name.
- "412 Precondition Failed" — Metageneration precondition failed; adjust filters accordingly.
- "400 Bad Request" — Malformed request, often due to invalid JSON or unsupported parameter values.
To resolve errors, verify credentials, bucket existence, and carefully review the parameters sent in the update request.