Skip to main content

Update Bucket

Updates bucket properties including storage class, versioning, and labels.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • GCS Client Id - The client identifier obtained from the Connect node. Optional if credentials are provided directly.
  • Bucket Name - The name of the bucket to update.
  • Label Name - The name of a label to add or update. Leave empty to skip label update.
  • Label Value - The value for the label. Used only if Label Name is provided.

Options

  • Storage Class - Update bucket's storage class:
    • Standard - Frequently accessed data
    • Nearline - Accessed < once/month
    • Coldline - Accessed < once/quarter
    • Archive - Accessed < once/year
  • Enable Versioning - Enable or disable object versioning:
    • True - Keep multiple versions of objects
    • False - Disable versioning
  • Credentials - Google Cloud service account credentials (optional).

How It Works

The Update Bucket node modifies bucket properties. When executed, the node:

  1. Establishes connection using either GCS Client Id or credentials
  2. Validates bucket name and inputs
  3. Updates storage class if specified
  4. Updates versioning if specified
  5. Adds/updates label if label name and value provided
  6. Returns success after updates applied

Example

Update Storage Class

// Input:
// Bucket Name: "my-archive-bucket"
// Storage Class: Archive

// Changes bucket to Archive storage class
// Useful for cost optimization

Enable Versioning

// Input:
// Bucket Name: "important-data"
// Enable Versioning: True

// Protects against accidental deletion
// Keeps previous versions of objects

Add Label

// Input:
// Bucket Name: "production-data"
// Label Name: "environment"
// Label Value: "production"

// Adds or updates label for organization
// Useful for cost tracking

Multiple Updates

// You can update multiple properties:
// - Storage Class: Nearline
// - Enable Versioning: True
// - Label: cost-center = engineering

// All updates applied in single operation

Requirements

  • Either valid GCS Client Id OR credentials provided directly
  • Valid bucket name that exists
  • Appropriate IAM permissions:
    • storage.buckets.update permission
    • roles/storage.admin role

Error Handling

Error CodeDescription
ErrInvalidArgBucket Name is empty or invalid

Common error scenarios:

  • Bucket doesn't exist
  • Invalid storage class value
  • Insufficient permissions
  • Invalid label name/value format

Usage Notes

  • Storage class changes affect pricing and retrieval costs
  • Versioning protects data but increases storage costs
  • Labels are key for cost allocation and organization
  • Multiple properties can be updated in one call
  • Some properties (location, name) cannot be changed
  • Storage class changes apply to new objects immediately
  • Existing objects retain their storage class unless changed

Tips for Effective Use

  • Use storage classes to optimize costs based on access patterns
  • Enable versioning for critical data
  • Apply consistent labeling strategy across buckets
  • Document label naming conventions
  • Test storage class changes in development first
  • Monitor costs after storage class changes
  • Use labels for billing reports and cost allocation

Common Errors and Solutions

Error: "Bucket Name cannot be empty"

  • Solution: Provide valid bucket name

Storage class change fails

  • Solution: Some class changes require conditions
  • Verify source and target classes are compatible
  • Check if objects meet minimum storage duration

Versioning won't enable

  • Solution: Verify permissions
  • Check bucket configuration
  • Ensure no conflicts with retention policies

Label update fails

  • Solution: Ensure label name is valid (lowercase, hyphens, underscores)
  • Check label value format
  • Verify maximum label count not exceeded (64 labels max)

Use Cases

Cost Optimization

  • Move infrequently accessed data to Nearline/Coldline
  • Apply Archive class to old backups
  • Optimize storage costs based on usage

Data Protection

  • Enable versioning on critical buckets
  • Protect against accidental deletion
  • Maintain history of object changes

Organization and Governance

  • Apply environment labels (dev, staging, prod)
  • Add cost center labels for billing
  • Tag buckets by team or project

Compliance

  • Enable versioning for audit requirements
  • Label buckets for data classification
  • Track bucket ownership and purpose

Storage Class Change Considerations

  • Standard to Nearline/Coldline/Archive: Reduces costs, increases retrieval costs
  • Archive to Standard: Increases costs, improves access performance
  • Between Nearline/Coldline: Adjust based on access patterns
tip

Storage Class Guidelines:

  • Standard: Data accessed frequently (> monthly)
  • Nearline: Data accessed < once/month
  • Coldline: Data accessed < once/quarter
  • Archive: Data accessed < once/year

Label Best Practices

  • Use consistent naming conventions
  • Common labels: environment, team, cost-center, project, owner
  • Keep label values simple and standardized
  • Document label schema for organization
  • Use for billing reports and cost allocation
  • Maximum 64 labels per bucket