Managing turbo replication

Overview

This page describes how to use theturbo replication feature on adual-region bucket.

Required roles

In order to get the required permissions for using turbo replication, ask youradministrator to grant you the Storage Admin(roles/storage.admin) IAM role on the bucket.

This predefined role contains the permissions required to use turboreplication. To see the exact permissions that are required, expand theRequired permissions section:

Required permissions

  • storage.buckets.get
  • storage.buckets.update
  • storage.buckets.list
    • This permission is only required if you plan on using theGoogle Cloud console to perform the instructions on this page.

You might also be able to get these permissions withcustom roles or otherpredefined roles.

For instructions on granting roles on buckets, seeSet and manage IAM policies on buckets.

Set turbo replication

To enable or disable turbo replication on an existing bucket, complete thefollowing instructions:

Console

  1. In the Google Cloud console, go to the Cloud StorageBuckets page.

    Go to Buckets

  2. In the bucket list, click the name of the desired bucket.

  3. Click theConfiguration tab.

  4. In theReplication row, clickEdit.

    The window that appears indicates whether you are about toEnableturbo replication orDisable turbo replication.

  5. ClickSave to confirm the new setting.

Command line

Use thegcloud storage buckets update command with the--rpoflag:

gcloud storage buckets update gs://BUCKET_NAME --rpo=STATE

Where:

  • BUCKET_NAME is the name of the relevantbucket. For example,my-bucket.

  • STATE isASYNC_TURBO for enabling TurboReplication orDEFAULT for disabling Turbo Replication.

If successful, the response looks like:

Updating gs://my-bucket/...  Completed 1

Client libraries

C++

For more information, see theCloud StorageC++ API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

The following sample enables turbo replication on a bucket:

namespacegcs=::google::cloud::storage;using::google::cloud::StatusOr;[](gcs::Clientclient,std::stringconst&bucket_name){autoupdated=client.PatchBucket(bucket_name,gcs::BucketMetadataPatchBuilder().SetRpo(gcs::RpoAsyncTurbo()));if(!updated)throwstd::move(updated).status();std::cout <<"RPO is set to 'ASYNC_TURBO' for " <<updated->name() <<"\n";}

The following sample enables default replication on a bucket:

namespacegcs=::google::cloud::storage;using::google::cloud::StatusOr;[](gcs::Clientclient,std::stringconst&bucket_name){autoupdated=client.PatchBucket(bucket_name,gcs::BucketMetadataPatchBuilder().SetRpo(gcs::RpoDefault()));if(!updated)throwstd::move(updated).status();std::cout <<"RPO is set to 'default' for " <<updated->name() <<"\n";}

C#

For more information, see theCloud StorageC# API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

The following sample enables turbo replication on a bucket:

usingSystem;usingGoogle.Cloud.Storage.V1;publicclassSetRpoAsyncTurboSample{publicvoidSetRpoAsyncTurbo(stringbucketName="your-unique-bucket-name"){// Enabling turbo replication requires a bucket with dual-region configurationvarstorage=StorageClient.Create();varbucket=storage.GetBucket(bucketName);bucket.Rpo="ASYNC_TURBO";storage.UpdateBucket(bucket);Console.WriteLine($"Turbo replication enabled for bucket {bucketName}");}}

The following sample enables default replication on a bucket:

usingSystem;usingGoogle.Cloud.Storage.V1;publicclassSetRpoDefaultSample{publicvoidSetRpoDefault(stringbucketName="your-unique-bucket-name"){varstorage=StorageClient.Create();varbucket=storage.GetBucket(bucketName);bucket.Rpo="DEFAULT";storage.UpdateBucket(bucket);Console.WriteLine($"Turbo replication disabled for bucket {bucketName}");}}

Go

For more information, see theCloud StorageGo API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

The following sample enables turbo replication on a bucket:

import("context""fmt""io""time""cloud.google.com/go/storage")// setRPOAsyncTurbo enables turbo replication for the bucket by setting RPO to// "ASYNC_TURBO". The bucket must be dual-region to use this feature.funcsetRPOAsyncTurbo(wio.Writer,bucketNamestring)error{// bucketName := "bucket-name"ctx:=context.Background()client,err:=storage.NewClient(ctx)iferr!=nil{returnfmt.Errorf("storage.NewClient: %w",err)}deferclient.Close()ctx,cancel:=context.WithTimeout(ctx,time.Second*10)defercancel()bucket:=client.Bucket(bucketName)setRPO:=storage.BucketAttrsToUpdate{RPO:storage.RPOAsyncTurbo,}if_,err:=bucket.Update(ctx,setRPO);err!=nil{returnfmt.Errorf("Bucket(%q).Update: %w",bucketName,err)}fmt.Fprintf(w,"Turbo replication enabled for %v",bucketName)returnnil}

The following sample enables default replication on a bucket:

import("context""fmt""io""time""cloud.google.com/go/storage")// setRPODefault disables turbo replication for the bucket by setting RPO to// "DEFAULT".funcsetRPODefault(wio.Writer,bucketNamestring)error{// bucketName := "bucket-name"ctx:=context.Background()client,err:=storage.NewClient(ctx)iferr!=nil{returnfmt.Errorf("storage.NewClient: %w",err)}deferclient.Close()ctx,cancel:=context.WithTimeout(ctx,time.Second*10)defercancel()bucket:=client.Bucket(bucketName)setRPO:=storage.BucketAttrsToUpdate{RPO:storage.RPODefault,}if_,err:=bucket.Update(ctx,setRPO);err!=nil{returnfmt.Errorf("Bucket(%q).Update: %w",bucketName,err)}fmt.Fprintf(w,"Turbo replication disabled for %v",bucketName)returnnil}

Java

For more information, see theCloud StorageJava API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

The following sample enables turbo replication on a bucket:

importcom.google.cloud.storage.Bucket;importcom.google.cloud.storage.Rpo;importcom.google.cloud.storage.Storage;importcom.google.cloud.storage.StorageOptions;publicclassSetAsyncTurboRpo{publicstaticvoidsetAsyncTurboRpo(StringprojectId,StringbucketName){// The ID of your GCP project// String projectId = "your-project-id";// The ID of your GCS bucket// String bucketName = "your-unique-bucket-name";Storagestorage=StorageOptions.newBuilder().setProjectId(projectId).build().getService();Bucketbucket=storage.get(bucketName);bucket.toBuilder().setRpo(Rpo.ASYNC_TURBO).build().update();System.out.println("Turbo replication was enabled for "+bucketName);}}

The following sample enables default replication on a bucket:

importcom.google.cloud.storage.Bucket;importcom.google.cloud.storage.Rpo;importcom.google.cloud.storage.Storage;importcom.google.cloud.storage.StorageOptions;publicclassSetDefaultRpo{publicstaticvoidsetDefaultRpo(StringprojectId,StringbucketName){// The ID of your GCP project// String projectId = "your-project-id";// The ID of your GCS bucket// String bucketName = "your-unique-bucket-name";Storagestorage=StorageOptions.newBuilder().setProjectId(projectId).build().getService();Bucketbucket=storage.get(bucketName);bucket.toBuilder().setRpo(Rpo.DEFAULT).build().update();System.out.println("Replication was set to default for "+bucketName);}}

Node.js

For more information, see theCloud StorageNode.js API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

The following sample enables turbo replication on a bucket:

/** * TODO(developer): Uncomment the following lines before running the sample. */// The name of your GCS bucket in a dual-region// const bucketName = 'Name of a bucket, e.g. my-bucket';// Imports the Google Cloud client libraryconst{Storage}=require('@google-cloud/storage');// Creates a clientconststorage=newStorage();// Enable turbo replication for the bucket by setting rpo to ASYNC_TURBO.// The bucket must be a dual-region bucket.asyncfunctionsetRPOAsyncTurbo(){awaitstorage.bucket(bucketName).setMetadata({rpo:'ASYNC_TURBO',});console.log(`Turbo replication enabled for${bucketName}.`);}setRPOAsyncTurbo();

The following sample enables default replication on a bucket:

/** * TODO(developer): Uncomment the following lines before running the sample. */// The name of your GCS bucket in a dual-region// const bucketName = 'Name of a bucket, e.g. my-bucket';// Imports the Google Cloud client libraryconst{Storage}=require('@google-cloud/storage');// Creates a clientconststorage=newStorage();// Disable turbo replication for the bucket by setting RPO to default.// The bucket must be a dual-region bucket.asyncfunctionsetRPODefault(){awaitstorage.bucket(bucketName).setMetadata({rpo:'DEFAULT',});console.log(`Turbo replication disabled for${bucketName}.`);}setRPODefault();

PHP

For more information, see theCloud StoragePHP API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

The following sample enables turbo replication on a bucket:

use Google\Cloud\Storage\StorageClient;/** * Set the bucket's Turbo Replication(rpo) setting to `ASYNC_TURBO`. * The bucket must be a dual-region bucket. * * @param string $bucketName the name of your Cloud Storage bucket. *        (e.g. 'my-bucket') */function set_rpo_async_turbo(string $bucketName): void{    $storage = new StorageClient();    $bucket = $storage->bucket($bucketName);    $rpo = 'ASYNC_TURBO';    $bucket->update([        'rpo' => $rpo    ]);    printf(        'The replication behavior or recovery point objective (RPO) has been set to ASYNC_TURBO for %s.' . PHP_EOL,        $bucketName    );}

The following sample enables default replication on a bucket:

use Google\Cloud\Storage\StorageClient;/** * Set the bucket's replication behavior or recovery point objective (RPO) to `DEFAULT`. * * @param string $bucketName the name of your Cloud Storage bucket. *        (e.g. 'my-bucket') */function set_rpo_default(string $bucketName): void{    $storage = new StorageClient();    $bucket = $storage->bucket($bucketName);    $rpo = 'DEFAULT';    // Updating the rpo value of a multi-region bucket to DEFAULT has no effect    // and updating the rpo value of a regional bucket will throw an exception.    $bucket->update([        'rpo' => $rpo    ]);    printf(        'The replication behavior or recovery point objective (RPO) has been set to DEFAULT for %s.' . PHP_EOL,        $bucketName    );}

Python

For more information, see theCloud StoragePython API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

The following sample enables turbo replication on a bucket:

fromgoogle.cloudimportstoragefromgoogle.cloud.storage.constantsimportRPO_ASYNC_TURBOdefset_rpo_async_turbo(bucket_name):"""Sets the RPO to ASYNC_TURBO, enabling the turbo replication feature"""# The ID of your GCS bucket# bucket_name = "my-bucket"storage_client=storage.Client()bucket=storage_client.bucket(bucket_name)bucket.rpo=RPO_ASYNC_TURBObucket.patch()print(f"RPO is set to ASYNC_TURBO for{bucket.name}.")

The following sample enables default replication on a bucket:

fromgoogle.cloudimportstoragefromgoogle.cloud.storage.constantsimportRPO_DEFAULTdefset_rpo_default(bucket_name):"""Sets the RPO to DEFAULT, disabling the turbo replication feature"""# The ID of your GCS bucket# bucket_name = "my-bucket"storage_client=storage.Client()bucket=storage_client.bucket(bucket_name)bucket.rpo=RPO_DEFAULTbucket.patch()print(f"RPO is set to DEFAULT for{bucket.name}.")

Ruby

For more information, see theCloud StorageRuby API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

The following sample enables turbo replication on a bucket:

defset_rpo_async_turbobucket_name:# The ID of your GCS bucket# bucket_name = "your-unique-bucket-name"require"google/cloud/storage"storage=Google::Cloud::Storage.newbucket=storage.bucketbucket_name,location:"ASIA"bucket.rpo=:ASYNC_TURBOputs"Turbo replication is enabled for#{bucket_name}."end

The following sample enables default replication on a bucket:

defset_rpo_defaultbucket_name:# The ID of your GCS bucket# bucket_name = "your-unique-bucket-name"require"google/cloud/storage"storage=Google::Cloud::Storage.newbucket=storage.bucketbucket_namebucket.rpo=:DEFAULTputs"The replication behavior or recovery point objective (RPO) for#{bucket_name} is set to default."end

REST APIs

JSON API

  1. Have gcloud CLIinstalled and initialized, which lets you generate an access token for theAuthorization header.

  2. Create a JSON file that contains the following information:

    {"rpo":"STATE"}

    WhereSTATE isASYNC_TURBO for enablingTurbo Replication orDEFAULT for disabling Turbo Replication.

  3. UsecURL to call theJSON API with aPATCH Bucket request:

    curl -X PATCH --data-binary @JSON_FILE_NAME \  -H "Authorization: Bearer $(gcloud auth print-access-token)" \  -H "Content-Type: application/json" \  "https://storage.googleapis.com/storage/v1/b/BUCKET_NAME?fields=rpo"

    Where:

    • JSON_FILE_NAME is the path for the JSONfile that you created in Step 2.
    • BUCKET_NAME is the name of the relevantbucket. For example,my-bucket.

    If the request is successful, no response is returned.

XML API

This feature cannot be managed through the XML API. Use the JSON APIinstead.

Check a bucket's replication status

To check therecovery point objective (RPO) or replication status of abucket, complete the following instructions:

Console

  1. In the Google Cloud console, go to the Cloud StorageBuckets page.

    Go to Buckets

  2. In the bucket list, click the name of the bucket you want to verify.

  3. Click theConfiguration tab.

  4. If turbo replication is enabled on the bucket,Replication is set toTurbo.

Command line

Use thegcloud storage buckets describe command with the--format flag:

gcloud storage buckets describe gs://BUCKET_NAME --format="default(rpo)"

Where:

  • BUCKET_NAME is the name of the relevantbucket. For example,my-bucket.

If successful, the response looks like the following example:

rpo: ASYNC_TURBO

Client libraries

C++

For more information, see theCloud StorageC++ API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

namespacegcs=::google::cloud::storage;using::google::cloud::StatusOr;[](gcs::Clientclient,std::stringconst&bucket_name){autometadata=client.GetBucketMetadata(bucket_name);if(!metadata)throwstd::move(metadata).status();std::cout <<"RPO is " <<metadata->rpo() <<" for bucket "            <<metadata->name() <<"\n";}

C#

For more information, see theCloud StorageC# API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

usingSystem;usingGoogle.Cloud.Storage.V1;publicclassGetRpoSample{publicstringGetRpo(stringbucketName="your-unique-bucket-name"){varstorage=StorageClient.Create();varrpo=storage.GetBucket(bucketName).Rpo;Console.WriteLine($"The RPO Setting of bucket {bucketName} is {rpo}.");returnrpo;}}

Go

For more information, see theCloud StorageGo API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

import("context""fmt""io""time""cloud.google.com/go/storage")// getRPO gets the current RPO (Recovery Point Objective) setting// for the bucket, either "DEFAULT" or "ASYNC_TURBO".funcgetRPO(wio.Writer,bucketNamestring)error{// bucketName := "bucket-name"ctx:=context.Background()client,err:=storage.NewClient(ctx)iferr!=nil{returnfmt.Errorf("storage.NewClient: %w",err)}deferclient.Close()ctx,cancel:=context.WithTimeout(ctx,time.Second*10)defercancel()attrs,err:=client.Bucket(bucketName).Attrs(ctx)iferr!=nil{returnfmt.Errorf("Bucket(%q).Attrs: %w",bucketName,err)}fmt.Fprintf(w,"RPO is %s for %v",attrs.RPO,bucketName)returnnil}

Java

For more information, see theCloud StorageJava API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

importcom.google.cloud.storage.Bucket;importcom.google.cloud.storage.Storage;importcom.google.cloud.storage.StorageOptions;publicclassGetBucketRpo{publicstaticvoidgetBucketRpo(StringprojectId,StringbucketName){// The ID of your GCP project// String projectId = "your-project-id";// The ID of your GCS bucket// String bucketName = "your-unique-bucket-name";Storagestorage=StorageOptions.newBuilder().setProjectId(projectId).build().getService();Bucketbucket=storage.get(bucketName);Stringrpo=bucket.getRpo().toString();System.out.println("The RPO setting of bucket "+bucketName+" is "+rpo);}}

Node.js

For more information, see theCloud StorageNode.js API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

/** * TODO(developer): Uncomment the following lines before running the sample. */// The name of your GCS bucket in a dual-region// const bucketName = 'Name of a bucket, e.g. my-bucket';// Imports the Google Cloud client libraryconst{Storage}=require('@google-cloud/storage');// Creates a clientconststorage=newStorage();asyncfunctiongetRPO(){// Gets Bucket Metadata and prints RPO value (either 'default' or 'async_turbo').// If RPO is undefined, the bucket is a single region bucketconst[metadata]=awaitstorage.bucket(bucketName).getMetadata();console.log(`RPO is${metadata.rpo} for${bucketName}.`);}getRPO();

PHP

For more information, see theCloud StoragePHP API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

use Google\Cloud\Storage\StorageClient;/** * Get the bucket's recovery point objective (RPO) setting. * * @param string $bucketName the name of your Cloud Storage bucket. *        (e.g. 'my-bucket') */function get_rpo(string $bucketName): void{    $storage = new StorageClient();    $bucket = $storage->bucket($bucketName);    printf(        'The bucket\'s RPO value is: %s.' . PHP_EOL,        $bucket->info()['rpo']    );}

Python

For more information, see theCloud StoragePython API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

fromgoogle.cloudimportstoragedefget_rpo(bucket_name):"""Gets the RPO of the bucket"""# The ID of your GCS bucket# bucket_name = "my-bucket"storage_client=storage.Client()bucket=storage_client.get_bucket(bucket_name)rpo=bucket.rpoprint(f"RPO for{bucket.name} is{rpo}.")

Ruby

For more information, see theCloud StorageRuby API reference documentation.

To authenticate to Cloud Storage, set up Application Default Credentials. For more information, seeSet up authentication for client libraries.

defget_rpobucket_name:# The ID of your GCS bucket# bucket_name = "your-unique-bucket-name"require"google/cloud/storage"storage=Google::Cloud::Storage.newbucket=storage.bucketbucket_nameputs"The RPO setting of bucket '#{bucket_name}' is#{bucket.rpo}."end

REST APIs

JSON API

  1. Have gcloud CLIinstalled and initialized, which lets you generate an access token for theAuthorization header.

  2. UsecURL to call theJSON APIwith aGET Bucket request:

    curl -X GET \  -H "Authorization: Bearer $(gcloud auth print-access-token)" \  "https://storage.googleapis.com/storage/v1/b/BUCKET_NAME?fields=rpo"

    WhereBUCKET_NAME is the name of therelevant bucket. For example,my-bucket.

    The response looks like the following example:

    {"name":"my-bucket","projectNumber":"234...",..."rpo":"ASYNC_TURBO"}

    Notice therpo key. The valueASYNC_TURBO indicates thatturbo replication is enabled.DEFAULT indicates that defaultreplication is applied. Therpo field is always present for dual- and multi-region buckets, but is absent from single-region buckets.

XML API

This feature cannot be managed through the XML API. Use the JSON APIinstead.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.