Search code examples
google-cloud-bigtable

setting ttl of google bigtable using gcloud


I was using aws dynamo db and used ttl property to delete record after some time but now i am moving to GCP,

In big table I can set expiration time for value hence I used Bigtable instead of Google Datastore

I know I can set that using Go CLI using command

cbt setgcpolicy my-table cf1 maxage=1d

But I want to set it using gcloud cli or while creating using console or deployment manager

Thanks in advance


Solution

  • You can't do this through gcloud or the Google Cloud Console. However, you can use the cbt tool, which is a component of the Cloud SDK (gcloud).

    Also, this Deployment Manager example should help with setting GC rules:

    tables:
      data:
        granularity: MILLIS
        columnFamilies:
          foo:
            gcRule:
              maxNumVersions: 2
          bar:
            gcRule:
              maxNumVersions: 2