Generated banner for Google Cloud Storage Bucket Architect
Generated logo for Google Cloud Storage Bucket Architect

Google Cloud Storage Bucket Architect

GoogleOfficialPublished by Google

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • No issues found

From the author

Creates Cloud Storage on Google Cloud (also known colloquially as GCS) buckets. Analyzes the workload (sensitive data, media hosting, ingestion, web hosting, archiving, backup, logging, analytics, AI/ML, or general-purpose), validates project-level security settings, and designs a secure-by-default, cost-effective configuration (location, storage class, uniform bucket-level access, public access prevention, soft delete, lifecycle) before creating it. Use whenever a user wants to create, make, set up, provision, or spin up a bucket, or needs object storage for an app, service, pipeline, or dataset — even a "simple" or "default" bucket, or when bucket creation is one step in a larger workflow. Outputs or executes the creation via gcloud, the JSON/REST API, Terraform, or SDK client libraries (C++, Java, Python, Go). Don't use for anything other than creating new buckets — for uploads, downloads, access changes, or reconfiguring existing buckets, use google-cloud-storage-basics.
— the description by Google

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This agent acts as a specialized architect for Google Cloud Storage (GCS). It guides users through a structured, three-phase process to design and provision storage buckets. By analyzing the intended workload—such as media hosting, backups, or AI/ML—the agent ensures that every bucket is configured with secure-by-default settings, including uniform bucket-level access, public access prevention, and appropriate lifecycle policies. It provides actionable output in various formats, including gcloud commands, REST API calls, Terraform, or SDK code snippets, while strictly requiring user confirmation before executing any infrastructure changes.

What it does

  • Analyzes workload requirements to recommend optimal storage classes and bucket configurations.
  • Validates project-level security settings to identify potential policy gaps.
  • Generates secure-by-default bucket architectures including encryption and access controls.
  • Provides infrastructure-as-code or CLI commands for bucket provisioning.
  • Performs read-only checks for bucket name availability.
  • Ensures safe execution by requiring explicit user confirmation for all infrastructure changes.

When to use it

  • When you need to provision a new storage bucket on Google Cloud.
  • When you require an expert recommendation for bucket settings based on a specific use case.
  • When you need to generate Terraform, SDK, or CLI code for bucket creation.
  • When you want to ensure your storage infrastructure follows security best practices.

Advantages

  • Reduces configuration errors through a structured, multi-phase planning process.
  • Promotes security-first design with mandatory secure-by-default settings.
  • Provides flexibility by supporting multiple output formats like Terraform and various SDKs.
  • Prevents accidental infrastructure changes by requiring explicit confirmation.

Usage examples

“I need a bucket for storing sensitive financial documents that must be kept for 7 years.”
The agent will analyze the compliance requirements, recommend Archive storage class with Bucket Lock and CMEK, and provide the configuration plan.
“Help me set up a bucket for hosting static website assets.”
The agent will propose a configuration optimized for public web hosting, including appropriate access controls and lifecycle policies.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/google/google-cloud-storage-bucket-architect/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip google-cloud-storage-bucket-architect.zip -d .agents/skills

Documentation by Google

Cloud Storage Bucket Architect

You are a Use-Case Driven Cloud Storage Bucket Architect agent on Google Cloud. Your job is to help users design and create Cloud Storage buckets that are secure, cost-effective, and optimized for their specific use cases. You validate project-level settings to ensure baseline security and provide the configuration in the user's preferred format, or execute the creation if authorized.

[!IMPORTANT]

You MUST ground your recommendations in the specific use case of the user. Always prefer secure-by-default configurations (UBLA enabled, restricted CSEK, soft-delete enabled) unless the user explicitly requests otherwise.

[!CAUTION]

CRITICAL: Never execute mutating commands, including bucket creation/update/deletion (e.g., gcloud, REST API calls), without first presenting the exact configuration/command and obtaining explicit confirmation from the user.

Philosophy

Creating Cloud Storage buckets involves many architectural choices (storage class, location, security settings, lifecycle policies). Instead of just creating a default bucket, you analyze the user's workload requirements and apply industry best practices and Google's internal expertise to draft a tailored architecture plan. You also check project-level constraints to warn the user about potential security gaps or policy violations.

[!NOTE]

For help with location-related questions about Cloud Storage, refer to the public documentation for Cloud Storage: Storage Locations

Attribution

Tag every Cloud Storage command you run or provide to the user while using this skill, so usage can be attributed. The tag identifies only the skill and its version; it carries no user data. Do not use attribution for SDK or Terraform snippets.

  • gcloud: Prefix every gcloud invocation you execute or output (including project checks, bucket name checks, creation/update commands, and any auxiliary gcloud commands in recommendations) with the metrics environment variables. The only exception is gcloud auth print-access-token when used inside a REST curl command, because REST already records attribution through the User-Agent header. Set the prefix inline on each gcloud command; shell state may not persist between commands. Use this append form verbatim. It keeps any attribution the host environment already set (for example an IDE plugin tagging agent activity through the same variable) and adds the skill tag after it, so neither value clobbers the other:

    CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-bucket-architect)" \
    gcloud <command> [flags]

    Do not use gcloud config set for this: it would persist beyond the current task and mislabel unrelated usage.

  • REST (cURL): Set the User-Agent header verbatim:

    User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-bucket-architect)

Phase Summary Table

PhaseInputsOutputsReference
1. Preflight/Project ChecksProject IDDefault project security checksreferences/phase_project_checks.md
2. Draft Bucket Create PlanUser use case, requirementsRecommended bucket configuration plan with bucket name availability statusreferences/phase_draft_plan.md
3. Output Based on User IntentPlan, preferred formatCommand/Snippet for bucket creationreferences/phase_output.md

Workflow Execution

[!IMPORTANT]

Do not skip phases: You must complete Phase N before proceeding to Phase N+1. Decisions should be made based on relevant findings grounded in the reference files for each phase. Do not optimize or deviate. Even if the user requests ONLY the final code/commands, or asks for them "immediately", you MUST still perform and display the Phase 1 assessment and Phase 2 plan in your response.

When invoked, the agent MUST follow this exact sequence:

  1. Start at Phase 1 (Preflight/Project Checks): Assess project-level settings by following references/phase_project_checks.md and follow its output format before proceeding.

  2. Proceed to Phase 2 (Draft Bucket Create Plan): Identify the use case and draft the bucket's configuration by following references/phase_draft_plan.md. This phase includes running the read-only, attributed bucket name availability check described in the reference; a taken name must be resolved before the plan is presented. As described in the reference, stop and wait for confirmation from the user that the plan looks good before proceeding, unless the user has already explicitly requested the final commands or code snippet in their initial prompt.

  3. Proceed to Phase 3 (Output Based on User Intent): Generate the final output by following references/phase_output.md but DO NOT execute any commands.

    As described in the reference, the preferred output format should be clear (gcloud, API (REST), Terraform, or SDK).

    • For gcloud and REST, offer to execute the creation and only proceed after explicit confirmation.

    • For Terraform and SDK, display the snippet for the user to integrate.

Error Handling

ProblemCauseFix
Execution failure during creationNetwork issue, permission error during API callReport the error details to the user and suggest manual execution with the generated command/snippet.
Creation fails with 409 or "already exists" errorThe bucket name became taken after the check, or the check was not verifiedPropose a different name, re-run the availability check, and regenerate the output.

References

Phases
Bucket Use Cases
Provisioning & Output Formats
SDK Language-Specific Guides
  • C++ SDK Guide: Code examples and patterns for the Cloud Storage C++ client library.

  • Go SDK Guide: Code examples and patterns for the Cloud Storage Go client library.

  • Java SDK Guide: Code examples and patterns for the Cloud Storage Java client library.

  • Python SDK Guide: Code examples and patterns for the Cloud Storage Python client library.

Files

references/rest.md

Cloud Storage JSON API Reference

[!IMPORTANT]

DO NOT EXECUTE THESE COMMANDS AUTOMATICALLY. The purpose of this guide is to define the mapping and translation rules to generate the correct command structure. These generated commands must be presented to the user for confirmation and are only executed in a subsequent phase if explicit confirmation is granted by the user.

This guide describes how to translate a Draft Bucket Creation Plan (from Phase 2) into the corresponding JSON API (REST) request bodies/cURL commands.

Official Documentation Reference


Translation Mapping Table

Draft Plan Field / SettingREST API Resource Field / PathNotes / Action
Bucket NamenameString in request body. Must be globally unique.
ProjectQuery Parameter: ?project=[project-id]Passed in the query string of the request URL.
LocationlocationString. E.g., us-central1, US. For zonal buckets (using the Rapid storage class), use the region (e.g., us-east1) if the plan specifies a zone.
PlacementcustomPlacementConfig.dataLocationsArray of strings. E.g., ["us-east1", "us-west1"] (for custom dual-regions), or ["us-east1-a"] (for zonal buckets).
Replication Speed (RPO)rpoString. E.g., "ASYNC_TURBO" (for dual-region buckets).
Storage ClassstorageClassString. E.g., "STANDARD", "NEARLINE", "COLDLINE", "ARCHIVE".
UBLAiamConfiguration.uniformBucketLevelAccess.enabledBoolean. Always set to true.
Public Access PreventioniamConfiguration.publicAccessPreventionString. "enforced" or "inherited".
Soft DeletesoftDeletePolicy.retentionDurationSecondsInteger (seconds). E.g. 604800 (7 days). Set to 0 to disable.
Object Versioningversioning.enabledBoolean. Enables/disables versioning.
Encryption (CMEK)encryption.defaultKmsKeyNameString. Full key ID: projects/.../cryptoKeys/...
Restrict Encryption (CSEK)encryption enforcement fieldsConfiguration for restricting encryption methods. See below.
Autoclassautoclass.enabledBoolean. Set to true to enable.
Hierarchical NamespacehierarchicalNamespace.enabledBoolean. Set to true to enable.
LabelslabelsObject (key-value pairs of strings).
IP FilteringipFilterObject. Defines IP restriction rules. See below.
Lifecycle Policies (OLM)lifecycle.ruleArray of rules. See template below.
CORScorsArray of CORS rule objects.
Website Configurationwebsite.mainPageSuffix / website.notFoundPageStrings for index and 404 pages.
Public IAM Policystorage.buckets.setIamPolicySeparate PUT request to set IAM policy (adding allUsers as roles/storage.objectViewer).
Pub/Sub Notificationsstorage.notifications.insertSeparate POST request to POST https://storage.googleapis.com/storage/v1/b/BUCKET_NAME/notificationConfigs.
Bucket Retention PeriodretentionPolicy.retentionPeriodInteger seconds. E.g. 7776000 (90 days).
Lock Bucket Retention Policystorage.buckets.lockRetentionPolicySeparate POST request to lock. Irreversible.
Object Retention (Object Lock)Query Parameter: enableObjectRetention=trueBoolean. Set to true during bucket creation (buckets.insert) to permanently enable object retention.
Set Object RetentionObject retention propertyProperty on object: {"mode": "Locked", "retainUntilTime": "..."}. Applied via PATCH to object or during upload.
Rapid Cachestorage.anywhereCaches.insertSeparate POST request to POST https://storage.googleapis.com/storage/v1/b/BUCKET_NAME/anywhereCaches.

Helper Configuration Templates

Encryption Enforcement (CSEK Restriction)

Unlike the gcloud CLI which abstracts these settings into short names at the root, the JSON API requires the full config names nested under the encryption object:

{
  "encryption": {
    "googleManagedEncryptionEnforcementConfig": {
      "restrictionMode": "NotRestricted"
    },
    "customerManagedEncryptionEnforcementConfig": {
      "restrictionMode": "NotRestricted"
    },
    "customerSuppliedEncryptionEnforcementConfig": {
      "restrictionMode": "FullyRestricted"
    }
  }
}
IP Filtering
{
  "ipFilter": {
    "mode": "Enabled",
    "publicNetworkSource": {
      "allowedIpCidrRanges": [
        "192.0.2.0/24"
      ]
    },
    "vpcNetworkSources": [
      {
        "network": "projects/PROJECT_ID/global/networks/NETWORK_NAME",
        "allowedIpCidrRanges": [
          "10.0.0.0/16"
        ]
      }
    ],
    "allowCrossOrgVpcs": false,
    "allowAllServiceAgentAccess": true
  }
}
Lifecycle Policy (OLM)
{
  "lifecycle": {
    "rule": [
      {
        "action": {
          "type": "Delete"
        },
        "condition": {
          "age": 365
        }
      }
    ]
  }
}
CORS Configuration
{
  "cors": [
    {
      "origin": ["http://example.appspot.com"],
      "method": ["GET", "PUT", "POST", "DELETE"],
      "responseHeader": ["Content-Type", "Authorization"],
      "maxAgeSeconds": 3600
    }
  ]
}

Executing REST Requests via cURL

To execute the REST API requests documented below using curl, you must include an Authorization header with a valid OAuth 2.0 access token, and the User-Agent header for attribution.

You can retrieve a token using the Google Cloud SDK (gcloud):

curl -X POST \
  "https://storage.googleapis.com/storage/v1/b?project=PROJECT_ID" \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-bucket-architect)" \
  -H "Content-Type: application/json" \
  -d @body.json

Where:

  • body.json contains the JSON request payload.

  • $(gcloud auth print-access-token) dynamically generates a short-lived access token for your currently active gcloud credentials. This token helper does not require the CLOUDSDK_METRICS_ENVIRONMENT prefix because attribution for REST is already recorded via the User-Agent header.


REST API Request Examples

All creation requests are sent to: POST https://storage.googleapis.com/storage/v1/b?project=PROJECT_ID

All update/patch requests are sent to: PATCH https://storage.googleapis.com/storage/v1/b/BUCKET_NAME

All headers must include:

  • Authorization: Bearer <token>

  • User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-bucket-architect)

  • Content-Type: application/json

Example 1: Standard Secure Bucket (Baseline)
Input Draft Plan
*   **Bucket Name**: `my-company-secure-bucket`
*   **Project**: `my-security-project`
*   **Location**: `us-east1`
*   **Storage Class**: `STANDARD`
*   **UBLA**: Enabled
*   **Public Access Prevention (PAP)**: Enforced
*   **Soft Delete**: Enabled (7 days)
*   **Encryption Enforcement**: CSEK Restricted
Output REST Request

Method/URL: POST https://storage.googleapis.com/storage/v1/b?project=my-security-project

Request Body:

{
  "name": "my-company-secure-bucket",
  "location": "us-east1",
  "storageClass": "STANDARD",
  "iamConfiguration": {
    "uniformBucketLevelAccess": {
      "enabled": true
    },
    "publicAccessPrevention": "enforced"
  },
  "softDeletePolicy": {
    "retentionDurationSeconds": 604800
  },
  "encryption": {
    "customerSuppliedEncryptionEnforcementConfig": {
      "restrictionMode": "FullyRestricted"
    }
  }
}

Example 2: Sensitive Data / Compliance
Input Draft Plan
*   **Bucket Name**: `my-compliance-pii-bucket`
*   **Project**: `my-compliance-project`
*   **Location**: `us-central1`
*   **Storage Class**: `STANDARD` (Autoclass will handle transitions)
*   **UBLA**: Enabled
*   **Public Access Prevention (PAP)**: Enforced
*   **Encryption Enforcement**: Restrict CSEK
*   **Encryption**: Customer-Managed Key (CMEK)
*   **Soft Delete**: Enabled (7 days)
*   **Bucket Lock (Retention Policy)**: Enabled (90 days, Unlocked)
*   **Use-case specific settings**:
    *   Autoclass: Enabled
    *   CMEK Key ID: `projects/my-kms-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key`
    *   Labels: `data-class=pii`, `owner=security-team`
    *   Lifecycle: Abort incomplete multipart uploads after 7 days
    *   IP Filtering: Restrict access to `192.0.2.0/24` (Corporate Range) and VPC networks (`10.0.0.0/16`) without cross-org VPCs.
Output REST Request

Method/URL: POST https://storage.googleapis.com/storage/v1/b?project=my-compliance-project

Request Body:

{
  "name": "my-compliance-pii-bucket",
  "location": "us-central1",
  "storageClass": "STANDARD",
  "iamConfiguration": {
    "uniformBucketLevelAccess": {
      "enabled": true
    },
    "publicAccessPrevention": "enforced"
  },
  "encryption": {
    "defaultKmsKeyName": "projects/my-kms-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key",
    "customerSuppliedEncryptionEnforcementConfig": {
      "restrictionMode": "FullyRestricted"
    },
    "customerManagedEncryptionEnforcementConfig": {
      "restrictionMode": "NotRestricted"
    },
    "googleManagedEncryptionEnforcementConfig": {
      "restrictionMode": "NotRestricted"
    }
  },
  "softDeletePolicy": {
    "retentionDurationSeconds": 604800
  },
  "retentionPolicy": {
    "retentionPeriod": 7776000
  },
  "autoclass": {
    "enabled": true
  },
  "labels": {
    "data-class": "pii",
    "owner": "security-team"
  },
  "lifecycle": {
    "rule": [
      {
        "action": {
          "type": "AbortIncompleteMultipartUpload"
        },
        "condition": {
          "age": 7
        }
      }
    ]
  },
  "ipFilter": {
    "mode": "Enabled",
    "allowAllServiceAgentAccess": true,
    "publicNetworkSource": {
      "allowedIpCidrRanges": ["192.0.2.0/24"]
    },
    "vpcNetworkSources": [
      {
        "network": "projects/my-project/global/networks/my-vpc-network",
        "allowedIpCidrRanges": ["10.0.0.0/16"]
      }
    ],
    "allowCrossOrgVpcs": false
  }
}

(Note: The retention policy is created unlocked. To lock it (making it permanent and irreversible), send an empty POST request to: POST https://storage.googleapis.com/storage/v1/b/my-compliance-pii-bucket/lockRetentionPolicy?ifMetagenerationMatch=METAGENERATION).


Example 3: Static Website Hosting
Input Draft Plan
*   **Bucket Name**: `www.my-company-site.com`
*   **Project**: `my-frontend-project`
*   **Location**: `US`
*   **Storage Class**: `STANDARD`
*   **UBLA**: Enabled
*   **Public Access Prevention (PAP)**: Inherited (Disabled to allow public website access)
*   **Soft Delete**: Enabled (7 days)
*   **Use-case specific settings**:
    *   Website Config: Main page `index.html`, Error page `404.html`
    *   Public Access: Required (allUsers -> storage.objectViewer)
    *   CORS: Allowed GET/HEAD/OPTIONS from any domain
    *   Versioning: Enabled
Output REST Request

1. Create the Bucket:

Method/URL: POST https://storage.googleapis.com/storage/v1/b?project=my-frontend-project

Request Body:

{
  "name": "www.my-company-site.com",
  "location": "US",
  "storageClass": "STANDARD",
  "iamConfiguration": {
    "uniformBucketLevelAccess": {
      "enabled": true
    },
    "publicAccessPrevention": "inherited"
  },
  "softDeletePolicy": {
    "retentionDurationSeconds": 604800
  }
}

2. Configure Website, CORS, and Versioning:

Method/URL: PATCH https://storage.googleapis.com/storage/v1/b/www.my-company-site.com

Request Body:

{
  "website": {
    "mainPageSuffix": "index.html",
    "notFoundPage": "404.html"
  },
  "cors": [
    {
      "origin": ["*"],
      "method": ["GET", "HEAD", "OPTIONS"],
      "responseHeader": ["Content-Type"],
      "maxAgeSeconds": 3600
    }
  ],
  "versioning": {
    "enabled": true
  }
}

3. Set Public Read Access (Read-Modify-Write):

[!WARNING] Setting the IAM policy (PUT /iam) replaces the entire existing policy. To avoid silently dropping default project convenience bindings or other existing permissions, you must perform a read-modify-write operation: GET the current policy, append the new binding, and PUT the updated policy back.

Step 3a: Get the current IAM Policy:

Method/URL: GET https://storage.googleapis.com/storage/v1/b/www.my-company-site.com/iam

Response Body (Example of current policy):

{
  "kind": "storage#policy",
  "resourceId": "projects/_/buckets/www.my-company-site.com",
  "bindings": [
    {
      "role": "roles/storage.legacyBucketOwner",
      "members": [
        "projectOwner:my-frontend-project",
        "projectEditor:my-frontend-project"
      ]
    },
    {
      "role": "roles/storage.legacyBucketReader",
      "members": [
        "projectViewer:my-frontend-project"
      ]
    }
  ],
  "etag": "CAE="
}

Step 3b: Append the public read binding and update the policy:

Method/URL: PUT https://storage.googleapis.com/storage/v1/b/www.my-company-site.com/iam

Request Body (Merged with the new binding, keeping the etag):

{
  "kind": "storage#policy",
  "resourceId": "projects/_/buckets/www.my-company-site.com",
  "bindings": [
    {
      "role": "roles/storage.legacyBucketOwner",
      "members": [
        "projectOwner:my-frontend-project",
        "projectEditor:my-frontend-project"
      ]
    },
    {
      "role": "roles/storage.legacyBucketReader",
      "members": [
        "projectViewer:my-frontend-project"
      ]
    },
    {
      "role": "roles/storage.objectViewer",
      "members": [
        "allUsers"
      ]
    }
  ],
  "etag": "CAE="
}

Example 4: AI/ML Checkpointing (Zonal Buckets)
Input Draft Plan
*   **Bucket Name**: `my-training-checkpoints-us-east1-b`
*   **Project**: `my-ai-project`
*   **Location**: `us-east1` (Region)
*   **Placement**: `us-east1-b` (Zone-level co-location for high performance)
*   **Storage Class**: `RAPID` (Must be explicitly specified for zonal buckets)
*   **UBLA**: Enabled (Required for Hierarchical Namespace)
*   **Public Access Prevention (PAP)**: Enforced
*   **Encryption**: Google-managed key
*   **Soft Delete**: Disabled (Not supported for zonal buckets)
*   **Use-case specific settings**:
    *   Hierarchical Namespace: Enabled (Required for Zonal buckets)
    *   Lifecycle: Delete checkpoint files older than 14 days
Output REST Request

Method/URL: POST https://storage.googleapis.com/storage/v1/b?project=my-ai-project

Request Body:

{
  "name": "my-training-checkpoints-us-east1-b",
  "location": "us-east1",
  "storageClass": "RAPID",
  "customPlacementConfig": {
    "dataLocations": ["us-east1-b"]
  },
  "iamConfiguration": {
    "uniformBucketLevelAccess": {
      "enabled": true
    },
    "publicAccessPrevention": "enforced"
  },
  "hierarchicalNamespace": {
    "enabled": true
  },
  "lifecycle": {
    "rule": [
      {
        "action": {
          "type": "Delete"
        },
        "condition": {
          "age": 14
        }
      }
    ]
  }
}

Example 5: WORM Archive with Object Lock (Per-Object Retention)
Input Draft Plan
*   **Bucket Name**: `my-legal-archive-bucket`
*   **Project**: `my-legal-project`
*   **Location**: `us-east1`
*   **UBLA**: Enabled
*   **Public Access Prevention (PAP)**: Enforced
*   **Soft Delete**: Enabled (7 days)
*   **Encryption**: Customer-Managed Key (CMEK) (Highly Recommended)
*   **Use-case specific settings**:
    *   Storage Class: `ARCHIVE`
    *   Object Lock (Per-Object Retention): Enabled
    *   CMEK Key ID: `projects/my-kms-project/locations/us-east1/keyRings/my-keyring/cryptoKeys/my-key`
    *   Labels: `compliance-type=regulatory`, `retention-period=7y` (Highly Recommended tags)
    *   Lifecycle: Delete objects older than 7 years (2555 days)
Output REST Request

Method/URL: POST https://storage.googleapis.com/storage/v1/b?project=my-legal-project&enableObjectRetention=true

Request Body:

{
  "name": "my-legal-archive-bucket",
  "location": "us-east1",
  "storageClass": "ARCHIVE",
  "iamConfiguration": {
    "uniformBucketLevelAccess": {
      "enabled": true
    },
    "publicAccessPrevention": "enforced"
  },
  "encryption": {
    "defaultKmsKeyName": "projects/my-kms-project/locations/us-east1/keyRings/my-keyring/cryptoKeys/my-key"
  },
  "softDeletePolicy": {
    "retentionDurationSeconds": 604800
  },
  "labels": {
    "compliance-type": "regulatory",
    "retention-period": "7y"
  },
  "lifecycle": {
    "rule": [
      {
        "action": {
          "type": "Delete"
        },
        "condition": {
          "age": 2555
        }
      }
    ]
  }
}

Object Operations for Object Lock

Set Object Retention on Upload

Upload an object with a specific retention period. POST https://storage.googleapis.com/upload/storage/v1/b/my-legal-archive-bucket/o?uploadType=multipart

Multipart Request Body (Metadata part):

[!CAUTION]

Locking a retention policy is permanent and irreversible. Once locked, the retention period cannot be reduced or removed.

{
  "name": "compliance_report_2026.pdf",
  "retention": {
    "mode": "Unlocked",
    "retainUntilTime": "2030-12-31T23:59:59Z"
  }
}
Set Object Retention on Existing Object

[!IMPORTANT] If you are modifying an existing Unlocked retention configuration on an object, you must append ?overrideUnlockedRetention=true to the request URL if you want to:

  • Change the mode to Locked.

  • Reduce the retainUntilTime.

  • Remove the retention configuration.

If this parameter is omitted when performing these actions on an object with existing Unlocked retention, the request will fail.

Update an existing object to apply retention. PATCH https://storage.googleapis.com/storage/v1/b/my-legal-archive-bucket/o/compliance_report_2026.pdf?overrideUnlockedRetention=true

Request Body:

{
  "retention": {
    "mode": "Locked",
    "retainUntilTime": "2030-12-31T23:59:59Z"
  }
}

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Google
Publisher
Google (Official)
Source
google/skills · skills/cloud/google-cloud-storage-bucket-architect · commit 2194d3b
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google or Google.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download google-cloud-storage-bucket-architect.zip