1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. spanner
  5. BackupSchedule
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.spanner.BackupSchedule

Explore with Pulumi AI

A backup schedule for a Cloud Spanner Database. This resource is owned by the database it is backing up, and is deleted along with the database. The actual backups are not though.

To get more information about BackupSchedule, see:

Warning: This resource creates a Spanner Backup Schedule on a project that already has a Spanner database. This resource is owned by the database it is backing up, and is deleted along with the database. The actual backups are not though.

Example Usage

Spanner Backup Schedule Daily Full

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const main = new gcp.spanner.Instance("main", {
    name: "instance-id",
    config: "regional-europe-west1",
    displayName: "main-instance",
    numNodes: 1,
});
const database = new gcp.spanner.Database("database", {
    instance: main.name,
    name: "database-id",
    versionRetentionPeriod: "3d",
    ddls: [
        "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)",
        "CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)",
    ],
    deletionProtection: true,
});
const full_backup = new gcp.spanner.BackupSchedule("full-backup", {
    instance: main.name,
    database: database.name,
    name: "backup-schedule-id",
    retentionDuration: "31620000s",
    spec: {
        cronSpec: {
            text: "0 12 * * *",
        },
    },
    fullBackupSpec: {},
    encryptionConfig: {
        encryptionType: "USE_DATABASE_ENCRYPTION",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

main = gcp.spanner.Instance("main",
    name="instance-id",
    config="regional-europe-west1",
    display_name="main-instance",
    num_nodes=1)
database = gcp.spanner.Database("database",
    instance=main.name,
    name="database-id",
    version_retention_period="3d",
    ddls=[
        "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)",
        "CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)",
    ],
    deletion_protection=True)
full_backup = gcp.spanner.BackupSchedule("full-backup",
    instance=main.name,
    database=database.name,
    name="backup-schedule-id",
    retention_duration="31620000s",
    spec={
        "cron_spec": {
            "text": "0 12 * * *",
        },
    },
    full_backup_spec={},
    encryption_config={
        "encryption_type": "USE_DATABASE_ENCRYPTION",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/spanner"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := spanner.NewInstance(ctx, "main", &spanner.InstanceArgs{
			Name:        pulumi.String("instance-id"),
			Config:      pulumi.String("regional-europe-west1"),
			DisplayName: pulumi.String("main-instance"),
			NumNodes:    pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		database, err := spanner.NewDatabase(ctx, "database", &spanner.DatabaseArgs{
			Instance:               main.Name,
			Name:                   pulumi.String("database-id"),
			VersionRetentionPeriod: pulumi.String("3d"),
			Ddls: pulumi.StringArray{
				pulumi.String("CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)"),
				pulumi.String("CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)"),
			},
			DeletionProtection: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = spanner.NewBackupSchedule(ctx, "full-backup", &spanner.BackupScheduleArgs{
			Instance:          main.Name,
			Database:          database.Name,
			Name:              pulumi.String("backup-schedule-id"),
			RetentionDuration: pulumi.String("31620000s"),
			Spec: &spanner.BackupScheduleSpecArgs{
				CronSpec: &spanner.BackupScheduleSpecCronSpecArgs{
					Text: pulumi.String("0 12 * * *"),
				},
			},
			FullBackupSpec: &spanner.BackupScheduleFullBackupSpecArgs{},
			EncryptionConfig: &spanner.BackupScheduleEncryptionConfigArgs{
				EncryptionType: pulumi.String("USE_DATABASE_ENCRYPTION"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var main = new Gcp.Spanner.Instance("main", new()
    {
        Name = "instance-id",
        Config = "regional-europe-west1",
        DisplayName = "main-instance",
        NumNodes = 1,
    });

    var database = new Gcp.Spanner.Database("database", new()
    {
        Instance = main.Name,
        Name = "database-id",
        VersionRetentionPeriod = "3d",
        Ddls = new[]
        {
            "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)",
            "CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)",
        },
        DeletionProtection = true,
    });

    var full_backup = new Gcp.Spanner.BackupSchedule("full-backup", new()
    {
        Instance = main.Name,
        Database = database.Name,
        Name = "backup-schedule-id",
        RetentionDuration = "31620000s",
        Spec = new Gcp.Spanner.Inputs.BackupScheduleSpecArgs
        {
            CronSpec = new Gcp.Spanner.Inputs.BackupScheduleSpecCronSpecArgs
            {
                Text = "0 12 * * *",
            },
        },
        FullBackupSpec = null,
        EncryptionConfig = new Gcp.Spanner.Inputs.BackupScheduleEncryptionConfigArgs
        {
            EncryptionType = "USE_DATABASE_ENCRYPTION",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.spanner.Instance;
import com.pulumi.gcp.spanner.InstanceArgs;
import com.pulumi.gcp.spanner.Database;
import com.pulumi.gcp.spanner.DatabaseArgs;
import com.pulumi.gcp.spanner.BackupSchedule;
import com.pulumi.gcp.spanner.BackupScheduleArgs;
import com.pulumi.gcp.spanner.inputs.BackupScheduleSpecArgs;
import com.pulumi.gcp.spanner.inputs.BackupScheduleSpecCronSpecArgs;
import com.pulumi.gcp.spanner.inputs.BackupScheduleFullBackupSpecArgs;
import com.pulumi.gcp.spanner.inputs.BackupScheduleEncryptionConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var main = new Instance("main", InstanceArgs.builder()
            .name("instance-id")
            .config("regional-europe-west1")
            .displayName("main-instance")
            .numNodes(1)
            .build());

        var database = new Database("database", DatabaseArgs.builder()
            .instance(main.name())
            .name("database-id")
            .versionRetentionPeriod("3d")
            .ddls(            
                "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)",
                "CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)")
            .deletionProtection(true)
            .build());

        var full_backup = new BackupSchedule("full-backup", BackupScheduleArgs.builder()
            .instance(main.name())
            .database(database.name())
            .name("backup-schedule-id")
            .retentionDuration("31620000s")
            .spec(BackupScheduleSpecArgs.builder()
                .cronSpec(BackupScheduleSpecCronSpecArgs.builder()
                    .text("0 12 * * *")
                    .build())
                .build())
            .fullBackupSpec(BackupScheduleFullBackupSpecArgs.builder()
                .build())
            .encryptionConfig(BackupScheduleEncryptionConfigArgs.builder()
                .encryptionType("USE_DATABASE_ENCRYPTION")
                .build())
            .build());

    }
}
Copy
resources:
  main:
    type: gcp:spanner:Instance
    properties:
      name: instance-id
      config: regional-europe-west1
      displayName: main-instance
      numNodes: 1
  database:
    type: gcp:spanner:Database
    properties:
      instance: ${main.name}
      name: database-id
      versionRetentionPeriod: 3d
      ddls:
        - CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)
        - CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)
      deletionProtection: true
  full-backup:
    type: gcp:spanner:BackupSchedule
    properties:
      instance: ${main.name}
      database: ${database.name}
      name: backup-schedule-id
      retentionDuration: 31620000s
      spec:
        cronSpec:
          text: 0 12 * * *
      fullBackupSpec: {}
      encryptionConfig:
        encryptionType: USE_DATABASE_ENCRYPTION
Copy

Spanner Backup Schedule Daily Incremental

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const main = new gcp.spanner.Instance("main", {
    name: "instance-id",
    config: "regional-europe-west1",
    displayName: "main-instance",
    numNodes: 1,
    edition: "ENTERPRISE",
});
const database = new gcp.spanner.Database("database", {
    instance: main.name,
    name: "database-id",
    versionRetentionPeriod: "3d",
    ddls: [
        "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)",
        "CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)",
    ],
    deletionProtection: true,
});
const incremental_backup = new gcp.spanner.BackupSchedule("incremental-backup", {
    instance: main.name,
    database: database.name,
    name: "backup-schedule-id",
    retentionDuration: "31620000s",
    spec: {
        cronSpec: {
            text: "0 12 * * *",
        },
    },
    incrementalBackupSpec: {},
    encryptionConfig: {
        encryptionType: "GOOGLE_DEFAULT_ENCRYPTION",
    },
});
Copy
import pulumi
import pulumi_gcp as gcp

main = gcp.spanner.Instance("main",
    name="instance-id",
    config="regional-europe-west1",
    display_name="main-instance",
    num_nodes=1,
    edition="ENTERPRISE")
database = gcp.spanner.Database("database",
    instance=main.name,
    name="database-id",
    version_retention_period="3d",
    ddls=[
        "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)",
        "CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)",
    ],
    deletion_protection=True)
incremental_backup = gcp.spanner.BackupSchedule("incremental-backup",
    instance=main.name,
    database=database.name,
    name="backup-schedule-id",
    retention_duration="31620000s",
    spec={
        "cron_spec": {
            "text": "0 12 * * *",
        },
    },
    incremental_backup_spec={},
    encryption_config={
        "encryption_type": "GOOGLE_DEFAULT_ENCRYPTION",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/spanner"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := spanner.NewInstance(ctx, "main", &spanner.InstanceArgs{
			Name:        pulumi.String("instance-id"),
			Config:      pulumi.String("regional-europe-west1"),
			DisplayName: pulumi.String("main-instance"),
			NumNodes:    pulumi.Int(1),
			Edition:     pulumi.String("ENTERPRISE"),
		})
		if err != nil {
			return err
		}
		database, err := spanner.NewDatabase(ctx, "database", &spanner.DatabaseArgs{
			Instance:               main.Name,
			Name:                   pulumi.String("database-id"),
			VersionRetentionPeriod: pulumi.String("3d"),
			Ddls: pulumi.StringArray{
				pulumi.String("CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)"),
				pulumi.String("CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)"),
			},
			DeletionProtection: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = spanner.NewBackupSchedule(ctx, "incremental-backup", &spanner.BackupScheduleArgs{
			Instance:          main.Name,
			Database:          database.Name,
			Name:              pulumi.String("backup-schedule-id"),
			RetentionDuration: pulumi.String("31620000s"),
			Spec: &spanner.BackupScheduleSpecArgs{
				CronSpec: &spanner.BackupScheduleSpecCronSpecArgs{
					Text: pulumi.String("0 12 * * *"),
				},
			},
			IncrementalBackupSpec: &spanner.BackupScheduleIncrementalBackupSpecArgs{},
			EncryptionConfig: &spanner.BackupScheduleEncryptionConfigArgs{
				EncryptionType: pulumi.String("GOOGLE_DEFAULT_ENCRYPTION"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var main = new Gcp.Spanner.Instance("main", new()
    {
        Name = "instance-id",
        Config = "regional-europe-west1",
        DisplayName = "main-instance",
        NumNodes = 1,
        Edition = "ENTERPRISE",
    });

    var database = new Gcp.Spanner.Database("database", new()
    {
        Instance = main.Name,
        Name = "database-id",
        VersionRetentionPeriod = "3d",
        Ddls = new[]
        {
            "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)",
            "CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)",
        },
        DeletionProtection = true,
    });

    var incremental_backup = new Gcp.Spanner.BackupSchedule("incremental-backup", new()
    {
        Instance = main.Name,
        Database = database.Name,
        Name = "backup-schedule-id",
        RetentionDuration = "31620000s",
        Spec = new Gcp.Spanner.Inputs.BackupScheduleSpecArgs
        {
            CronSpec = new Gcp.Spanner.Inputs.BackupScheduleSpecCronSpecArgs
            {
                Text = "0 12 * * *",
            },
        },
        IncrementalBackupSpec = null,
        EncryptionConfig = new Gcp.Spanner.Inputs.BackupScheduleEncryptionConfigArgs
        {
            EncryptionType = "GOOGLE_DEFAULT_ENCRYPTION",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.spanner.Instance;
import com.pulumi.gcp.spanner.InstanceArgs;
import com.pulumi.gcp.spanner.Database;
import com.pulumi.gcp.spanner.DatabaseArgs;
import com.pulumi.gcp.spanner.BackupSchedule;
import com.pulumi.gcp.spanner.BackupScheduleArgs;
import com.pulumi.gcp.spanner.inputs.BackupScheduleSpecArgs;
import com.pulumi.gcp.spanner.inputs.BackupScheduleSpecCronSpecArgs;
import com.pulumi.gcp.spanner.inputs.BackupScheduleIncrementalBackupSpecArgs;
import com.pulumi.gcp.spanner.inputs.BackupScheduleEncryptionConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var main = new Instance("main", InstanceArgs.builder()
            .name("instance-id")
            .config("regional-europe-west1")
            .displayName("main-instance")
            .numNodes(1)
            .edition("ENTERPRISE")
            .build());

        var database = new Database("database", DatabaseArgs.builder()
            .instance(main.name())
            .name("database-id")
            .versionRetentionPeriod("3d")
            .ddls(            
                "CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)",
                "CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)")
            .deletionProtection(true)
            .build());

        var incremental_backup = new BackupSchedule("incremental-backup", BackupScheduleArgs.builder()
            .instance(main.name())
            .database(database.name())
            .name("backup-schedule-id")
            .retentionDuration("31620000s")
            .spec(BackupScheduleSpecArgs.builder()
                .cronSpec(BackupScheduleSpecCronSpecArgs.builder()
                    .text("0 12 * * *")
                    .build())
                .build())
            .incrementalBackupSpec(BackupScheduleIncrementalBackupSpecArgs.builder()
                .build())
            .encryptionConfig(BackupScheduleEncryptionConfigArgs.builder()
                .encryptionType("GOOGLE_DEFAULT_ENCRYPTION")
                .build())
            .build());

    }
}
Copy
resources:
  main:
    type: gcp:spanner:Instance
    properties:
      name: instance-id
      config: regional-europe-west1
      displayName: main-instance
      numNodes: 1
      edition: ENTERPRISE
  database:
    type: gcp:spanner:Database
    properties:
      instance: ${main.name}
      name: database-id
      versionRetentionPeriod: 3d
      ddls:
        - CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)
        - CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)
      deletionProtection: true
  incremental-backup:
    type: gcp:spanner:BackupSchedule
    properties:
      instance: ${main.name}
      database: ${database.name}
      name: backup-schedule-id
      retentionDuration: 31620000s
      spec:
        cronSpec:
          text: 0 12 * * *
      incrementalBackupSpec: {}
      encryptionConfig:
        encryptionType: GOOGLE_DEFAULT_ENCRYPTION
Copy

Create BackupSchedule Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new BackupSchedule(name: string, args: BackupScheduleArgs, opts?: CustomResourceOptions);
@overload
def BackupSchedule(resource_name: str,
                   args: BackupScheduleArgs,
                   opts: Optional[ResourceOptions] = None)

@overload
def BackupSchedule(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   database: Optional[str] = None,
                   instance: Optional[str] = None,
                   retention_duration: Optional[str] = None,
                   encryption_config: Optional[BackupScheduleEncryptionConfigArgs] = None,
                   full_backup_spec: Optional[BackupScheduleFullBackupSpecArgs] = None,
                   incremental_backup_spec: Optional[BackupScheduleIncrementalBackupSpecArgs] = None,
                   name: Optional[str] = None,
                   project: Optional[str] = None,
                   spec: Optional[BackupScheduleSpecArgs] = None)
func NewBackupSchedule(ctx *Context, name string, args BackupScheduleArgs, opts ...ResourceOption) (*BackupSchedule, error)
public BackupSchedule(string name, BackupScheduleArgs args, CustomResourceOptions? opts = null)
public BackupSchedule(String name, BackupScheduleArgs args)
public BackupSchedule(String name, BackupScheduleArgs args, CustomResourceOptions options)
type: gcp:spanner:BackupSchedule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. BackupScheduleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. BackupScheduleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. BackupScheduleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. BackupScheduleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. BackupScheduleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var gcpBackupScheduleResource = new Gcp.Spanner.BackupSchedule("gcpBackupScheduleResource", new()
{
    Database = "string",
    Instance = "string",
    RetentionDuration = "string",
    EncryptionConfig = new Gcp.Spanner.Inputs.BackupScheduleEncryptionConfigArgs
    {
        EncryptionType = "string",
        KmsKeyName = "string",
    },
    FullBackupSpec = null,
    IncrementalBackupSpec = null,
    Name = "string",
    Project = "string",
    Spec = new Gcp.Spanner.Inputs.BackupScheduleSpecArgs
    {
        CronSpec = new Gcp.Spanner.Inputs.BackupScheduleSpecCronSpecArgs
        {
            Text = "string",
        },
    },
});
Copy
example, err := spanner.NewBackupSchedule(ctx, "gcpBackupScheduleResource", &spanner.BackupScheduleArgs{
	Database:          pulumi.String("string"),
	Instance:          pulumi.String("string"),
	RetentionDuration: pulumi.String("string"),
	EncryptionConfig: &spanner.BackupScheduleEncryptionConfigArgs{
		EncryptionType: pulumi.String("string"),
		KmsKeyName:     pulumi.String("string"),
	},
	FullBackupSpec:        &spanner.BackupScheduleFullBackupSpecArgs{},
	IncrementalBackupSpec: &spanner.BackupScheduleIncrementalBackupSpecArgs{},
	Name:                  pulumi.String("string"),
	Project:               pulumi.String("string"),
	Spec: &spanner.BackupScheduleSpecArgs{
		CronSpec: &spanner.BackupScheduleSpecCronSpecArgs{
			Text: pulumi.String("string"),
		},
	},
})
Copy
var gcpBackupScheduleResource = new BackupSchedule("gcpBackupScheduleResource", BackupScheduleArgs.builder()
    .database("string")
    .instance("string")
    .retentionDuration("string")
    .encryptionConfig(BackupScheduleEncryptionConfigArgs.builder()
        .encryptionType("string")
        .kmsKeyName("string")
        .build())
    .fullBackupSpec()
    .incrementalBackupSpec()
    .name("string")
    .project("string")
    .spec(BackupScheduleSpecArgs.builder()
        .cronSpec(BackupScheduleSpecCronSpecArgs.builder()
            .text("string")
            .build())
        .build())
    .build());
Copy
gcp_backup_schedule_resource = gcp.spanner.BackupSchedule("gcpBackupScheduleResource",
    database="string",
    instance="string",
    retention_duration="string",
    encryption_config={
        "encryption_type": "string",
        "kms_key_name": "string",
    },
    full_backup_spec={},
    incremental_backup_spec={},
    name="string",
    project="string",
    spec={
        "cron_spec": {
            "text": "string",
        },
    })
Copy
const gcpBackupScheduleResource = new gcp.spanner.BackupSchedule("gcpBackupScheduleResource", {
    database: "string",
    instance: "string",
    retentionDuration: "string",
    encryptionConfig: {
        encryptionType: "string",
        kmsKeyName: "string",
    },
    fullBackupSpec: {},
    incrementalBackupSpec: {},
    name: "string",
    project: "string",
    spec: {
        cronSpec: {
            text: "string",
        },
    },
});
Copy
type: gcp:spanner:BackupSchedule
properties:
    database: string
    encryptionConfig:
        encryptionType: string
        kmsKeyName: string
    fullBackupSpec: {}
    incrementalBackupSpec: {}
    instance: string
    name: string
    project: string
    retentionDuration: string
    spec:
        cronSpec:
            text: string
Copy

BackupSchedule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The BackupSchedule resource accepts the following input properties:

Database
This property is required.
Changes to this property will trigger replacement.
string
The database to create the backup schedule on.


Instance
This property is required.
Changes to this property will trigger replacement.
string
The instance to create the database on.
RetentionDuration This property is required. string
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
EncryptionConfig BackupScheduleEncryptionConfig
Configuration for the encryption of the backup schedule. Structure is documented below.
FullBackupSpec Changes to this property will trigger replacement. BackupScheduleFullBackupSpec
The schedule creates only full backups..
IncrementalBackupSpec Changes to this property will trigger replacement. BackupScheduleIncrementalBackupSpec
The schedule creates incremental backup chains.
Name Changes to this property will trigger replacement. string
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Spec BackupScheduleSpec
Defines specifications of the backup schedule. Structure is documented below.
Database
This property is required.
Changes to this property will trigger replacement.
string
The database to create the backup schedule on.


Instance
This property is required.
Changes to this property will trigger replacement.
string
The instance to create the database on.
RetentionDuration This property is required. string
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
EncryptionConfig BackupScheduleEncryptionConfigArgs
Configuration for the encryption of the backup schedule. Structure is documented below.
FullBackupSpec Changes to this property will trigger replacement. BackupScheduleFullBackupSpecArgs
The schedule creates only full backups..
IncrementalBackupSpec Changes to this property will trigger replacement. BackupScheduleIncrementalBackupSpecArgs
The schedule creates incremental backup chains.
Name Changes to this property will trigger replacement. string
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Spec BackupScheduleSpecArgs
Defines specifications of the backup schedule. Structure is documented below.
database
This property is required.
Changes to this property will trigger replacement.
String
The database to create the backup schedule on.


instance
This property is required.
Changes to this property will trigger replacement.
String
The instance to create the database on.
retentionDuration This property is required. String
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
encryptionConfig BackupScheduleEncryptionConfig
Configuration for the encryption of the backup schedule. Structure is documented below.
fullBackupSpec Changes to this property will trigger replacement. BackupScheduleFullBackupSpec
The schedule creates only full backups..
incrementalBackupSpec Changes to this property will trigger replacement. BackupScheduleIncrementalBackupSpec
The schedule creates incremental backup chains.
name Changes to this property will trigger replacement. String
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
spec BackupScheduleSpec
Defines specifications of the backup schedule. Structure is documented below.
database
This property is required.
Changes to this property will trigger replacement.
string
The database to create the backup schedule on.


instance
This property is required.
Changes to this property will trigger replacement.
string
The instance to create the database on.
retentionDuration This property is required. string
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
encryptionConfig BackupScheduleEncryptionConfig
Configuration for the encryption of the backup schedule. Structure is documented below.
fullBackupSpec Changes to this property will trigger replacement. BackupScheduleFullBackupSpec
The schedule creates only full backups..
incrementalBackupSpec Changes to this property will trigger replacement. BackupScheduleIncrementalBackupSpec
The schedule creates incremental backup chains.
name Changes to this property will trigger replacement. string
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
spec BackupScheduleSpec
Defines specifications of the backup schedule. Structure is documented below.
database
This property is required.
Changes to this property will trigger replacement.
str
The database to create the backup schedule on.


instance
This property is required.
Changes to this property will trigger replacement.
str
The instance to create the database on.
retention_duration This property is required. str
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
encryption_config BackupScheduleEncryptionConfigArgs
Configuration for the encryption of the backup schedule. Structure is documented below.
full_backup_spec Changes to this property will trigger replacement. BackupScheduleFullBackupSpecArgs
The schedule creates only full backups..
incremental_backup_spec Changes to this property will trigger replacement. BackupScheduleIncrementalBackupSpecArgs
The schedule creates incremental backup chains.
name Changes to this property will trigger replacement. str
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
spec BackupScheduleSpecArgs
Defines specifications of the backup schedule. Structure is documented below.
database
This property is required.
Changes to this property will trigger replacement.
String
The database to create the backup schedule on.


instance
This property is required.
Changes to this property will trigger replacement.
String
The instance to create the database on.
retentionDuration This property is required. String
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
encryptionConfig Property Map
Configuration for the encryption of the backup schedule. Structure is documented below.
fullBackupSpec Changes to this property will trigger replacement. Property Map
The schedule creates only full backups..
incrementalBackupSpec Changes to this property will trigger replacement. Property Map
The schedule creates incremental backup chains.
name Changes to this property will trigger replacement. String
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
spec Property Map
Defines specifications of the backup schedule. Structure is documented below.

Outputs

All input properties are implicitly available as output properties. Additionally, the BackupSchedule resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing BackupSchedule Resource

Get an existing BackupSchedule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: BackupScheduleState, opts?: CustomResourceOptions): BackupSchedule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        database: Optional[str] = None,
        encryption_config: Optional[BackupScheduleEncryptionConfigArgs] = None,
        full_backup_spec: Optional[BackupScheduleFullBackupSpecArgs] = None,
        incremental_backup_spec: Optional[BackupScheduleIncrementalBackupSpecArgs] = None,
        instance: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        retention_duration: Optional[str] = None,
        spec: Optional[BackupScheduleSpecArgs] = None) -> BackupSchedule
func GetBackupSchedule(ctx *Context, name string, id IDInput, state *BackupScheduleState, opts ...ResourceOption) (*BackupSchedule, error)
public static BackupSchedule Get(string name, Input<string> id, BackupScheduleState? state, CustomResourceOptions? opts = null)
public static BackupSchedule get(String name, Output<String> id, BackupScheduleState state, CustomResourceOptions options)
resources:  _:    type: gcp:spanner:BackupSchedule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Database Changes to this property will trigger replacement. string
The database to create the backup schedule on.


EncryptionConfig BackupScheduleEncryptionConfig
Configuration for the encryption of the backup schedule. Structure is documented below.
FullBackupSpec Changes to this property will trigger replacement. BackupScheduleFullBackupSpec
The schedule creates only full backups..
IncrementalBackupSpec Changes to this property will trigger replacement. BackupScheduleIncrementalBackupSpec
The schedule creates incremental backup chains.
Instance Changes to this property will trigger replacement. string
The instance to create the database on.
Name Changes to this property will trigger replacement. string
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
RetentionDuration string
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
Spec BackupScheduleSpec
Defines specifications of the backup schedule. Structure is documented below.
Database Changes to this property will trigger replacement. string
The database to create the backup schedule on.


EncryptionConfig BackupScheduleEncryptionConfigArgs
Configuration for the encryption of the backup schedule. Structure is documented below.
FullBackupSpec Changes to this property will trigger replacement. BackupScheduleFullBackupSpecArgs
The schedule creates only full backups..
IncrementalBackupSpec Changes to this property will trigger replacement. BackupScheduleIncrementalBackupSpecArgs
The schedule creates incremental backup chains.
Instance Changes to this property will trigger replacement. string
The instance to create the database on.
Name Changes to this property will trigger replacement. string
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
RetentionDuration string
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
Spec BackupScheduleSpecArgs
Defines specifications of the backup schedule. Structure is documented below.
database Changes to this property will trigger replacement. String
The database to create the backup schedule on.


encryptionConfig BackupScheduleEncryptionConfig
Configuration for the encryption of the backup schedule. Structure is documented below.
fullBackupSpec Changes to this property will trigger replacement. BackupScheduleFullBackupSpec
The schedule creates only full backups..
incrementalBackupSpec Changes to this property will trigger replacement. BackupScheduleIncrementalBackupSpec
The schedule creates incremental backup chains.
instance Changes to this property will trigger replacement. String
The instance to create the database on.
name Changes to this property will trigger replacement. String
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
retentionDuration String
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
spec BackupScheduleSpec
Defines specifications of the backup schedule. Structure is documented below.
database Changes to this property will trigger replacement. string
The database to create the backup schedule on.


encryptionConfig BackupScheduleEncryptionConfig
Configuration for the encryption of the backup schedule. Structure is documented below.
fullBackupSpec Changes to this property will trigger replacement. BackupScheduleFullBackupSpec
The schedule creates only full backups..
incrementalBackupSpec Changes to this property will trigger replacement. BackupScheduleIncrementalBackupSpec
The schedule creates incremental backup chains.
instance Changes to this property will trigger replacement. string
The instance to create the database on.
name Changes to this property will trigger replacement. string
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
retentionDuration string
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
spec BackupScheduleSpec
Defines specifications of the backup schedule. Structure is documented below.
database Changes to this property will trigger replacement. str
The database to create the backup schedule on.


encryption_config BackupScheduleEncryptionConfigArgs
Configuration for the encryption of the backup schedule. Structure is documented below.
full_backup_spec Changes to this property will trigger replacement. BackupScheduleFullBackupSpecArgs
The schedule creates only full backups..
incremental_backup_spec Changes to this property will trigger replacement. BackupScheduleIncrementalBackupSpecArgs
The schedule creates incremental backup chains.
instance Changes to this property will trigger replacement. str
The instance to create the database on.
name Changes to this property will trigger replacement. str
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
retention_duration str
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
spec BackupScheduleSpecArgs
Defines specifications of the backup schedule. Structure is documented below.
database Changes to this property will trigger replacement. String
The database to create the backup schedule on.


encryptionConfig Property Map
Configuration for the encryption of the backup schedule. Structure is documented below.
fullBackupSpec Changes to this property will trigger replacement. Property Map
The schedule creates only full backups..
incrementalBackupSpec Changes to this property will trigger replacement. Property Map
The schedule creates incremental backup chains.
instance Changes to this property will trigger replacement. String
The instance to create the database on.
name Changes to this property will trigger replacement. String
A unique identifier for the backup schedule, which cannot be changed after the backup schedule is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
retentionDuration String
At what relative time in the future, compared to its creation time, the backup should be deleted, e.g. keep backups for 7 days. A duration in seconds with up to nine fractional digits, ending with 's'. Example: '3.5s'. You can set this to a value up to 366 days.
spec Property Map
Defines specifications of the backup schedule. Structure is documented below.

Supporting Types

BackupScheduleEncryptionConfig
, BackupScheduleEncryptionConfigArgs

EncryptionType This property is required. string
The encryption type of backups created by the backup schedule. Possible values are USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, or CUSTOMER_MANAGED_ENCRYPTION. If you use CUSTOMER_MANAGED_ENCRYPTION, you must specify a kmsKeyName. If your backup type is incremental-backup, the encryption type must be GOOGLE_DEFAULT_ENCRYPTION. Possible values are: USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, CUSTOMER_MANAGED_ENCRYPTION.
KmsKeyName string
The resource name of the Cloud KMS key to use for encryption. Format: 'projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}'
EncryptionType This property is required. string
The encryption type of backups created by the backup schedule. Possible values are USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, or CUSTOMER_MANAGED_ENCRYPTION. If you use CUSTOMER_MANAGED_ENCRYPTION, you must specify a kmsKeyName. If your backup type is incremental-backup, the encryption type must be GOOGLE_DEFAULT_ENCRYPTION. Possible values are: USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, CUSTOMER_MANAGED_ENCRYPTION.
KmsKeyName string
The resource name of the Cloud KMS key to use for encryption. Format: 'projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}'
encryptionType This property is required. String
The encryption type of backups created by the backup schedule. Possible values are USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, or CUSTOMER_MANAGED_ENCRYPTION. If you use CUSTOMER_MANAGED_ENCRYPTION, you must specify a kmsKeyName. If your backup type is incremental-backup, the encryption type must be GOOGLE_DEFAULT_ENCRYPTION. Possible values are: USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, CUSTOMER_MANAGED_ENCRYPTION.
kmsKeyName String
The resource name of the Cloud KMS key to use for encryption. Format: 'projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}'
encryptionType This property is required. string
The encryption type of backups created by the backup schedule. Possible values are USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, or CUSTOMER_MANAGED_ENCRYPTION. If you use CUSTOMER_MANAGED_ENCRYPTION, you must specify a kmsKeyName. If your backup type is incremental-backup, the encryption type must be GOOGLE_DEFAULT_ENCRYPTION. Possible values are: USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, CUSTOMER_MANAGED_ENCRYPTION.
kmsKeyName string
The resource name of the Cloud KMS key to use for encryption. Format: 'projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}'
encryption_type This property is required. str
The encryption type of backups created by the backup schedule. Possible values are USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, or CUSTOMER_MANAGED_ENCRYPTION. If you use CUSTOMER_MANAGED_ENCRYPTION, you must specify a kmsKeyName. If your backup type is incremental-backup, the encryption type must be GOOGLE_DEFAULT_ENCRYPTION. Possible values are: USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, CUSTOMER_MANAGED_ENCRYPTION.
kms_key_name str
The resource name of the Cloud KMS key to use for encryption. Format: 'projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}'
encryptionType This property is required. String
The encryption type of backups created by the backup schedule. Possible values are USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, or CUSTOMER_MANAGED_ENCRYPTION. If you use CUSTOMER_MANAGED_ENCRYPTION, you must specify a kmsKeyName. If your backup type is incremental-backup, the encryption type must be GOOGLE_DEFAULT_ENCRYPTION. Possible values are: USE_DATABASE_ENCRYPTION, GOOGLE_DEFAULT_ENCRYPTION, CUSTOMER_MANAGED_ENCRYPTION.
kmsKeyName String
The resource name of the Cloud KMS key to use for encryption. Format: 'projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}'

BackupScheduleSpec
, BackupScheduleSpecArgs

CronSpec BackupScheduleSpecCronSpec
Cron style schedule specification.. Structure is documented below.
CronSpec BackupScheduleSpecCronSpec
Cron style schedule specification.. Structure is documented below.
cronSpec BackupScheduleSpecCronSpec
Cron style schedule specification.. Structure is documented below.
cronSpec BackupScheduleSpecCronSpec
Cron style schedule specification.. Structure is documented below.
cron_spec BackupScheduleSpecCronSpec
Cron style schedule specification.. Structure is documented below.
cronSpec Property Map
Cron style schedule specification.. Structure is documented below.

BackupScheduleSpecCronSpec
, BackupScheduleSpecCronSpecArgs

Text string
Textual representation of the crontab. User can customize the backup frequency and the backup version time using the cron expression. The version time must be in UTC timzeone. The backup will contain an externally consistent copy of the database at the version time. Allowed frequencies are 12 hour, 1 day, 1 week and 1 month. Examples of valid cron specifications: 0 2/12 * * * : every 12 hours at (2, 14) hours past midnight in UTC. 0 2,14 * * * : every 12 hours at (2,14) hours past midnight in UTC. 0 2 * * * : once a day at 2 past midnight in UTC. 0 2 * * 0 : once a week every Sunday at 2 past midnight in UTC. 0 2 8 * * : once a month on 8th day at 2 past midnight in UTC.
Text string
Textual representation of the crontab. User can customize the backup frequency and the backup version time using the cron expression. The version time must be in UTC timzeone. The backup will contain an externally consistent copy of the database at the version time. Allowed frequencies are 12 hour, 1 day, 1 week and 1 month. Examples of valid cron specifications: 0 2/12 * * * : every 12 hours at (2, 14) hours past midnight in UTC. 0 2,14 * * * : every 12 hours at (2,14) hours past midnight in UTC. 0 2 * * * : once a day at 2 past midnight in UTC. 0 2 * * 0 : once a week every Sunday at 2 past midnight in UTC. 0 2 8 * * : once a month on 8th day at 2 past midnight in UTC.
text String
Textual representation of the crontab. User can customize the backup frequency and the backup version time using the cron expression. The version time must be in UTC timzeone. The backup will contain an externally consistent copy of the database at the version time. Allowed frequencies are 12 hour, 1 day, 1 week and 1 month. Examples of valid cron specifications: 0 2/12 * * * : every 12 hours at (2, 14) hours past midnight in UTC. 0 2,14 * * * : every 12 hours at (2,14) hours past midnight in UTC. 0 2 * * * : once a day at 2 past midnight in UTC. 0 2 * * 0 : once a week every Sunday at 2 past midnight in UTC. 0 2 8 * * : once a month on 8th day at 2 past midnight in UTC.
text string
Textual representation of the crontab. User can customize the backup frequency and the backup version time using the cron expression. The version time must be in UTC timzeone. The backup will contain an externally consistent copy of the database at the version time. Allowed frequencies are 12 hour, 1 day, 1 week and 1 month. Examples of valid cron specifications: 0 2/12 * * * : every 12 hours at (2, 14) hours past midnight in UTC. 0 2,14 * * * : every 12 hours at (2,14) hours past midnight in UTC. 0 2 * * * : once a day at 2 past midnight in UTC. 0 2 * * 0 : once a week every Sunday at 2 past midnight in UTC. 0 2 8 * * : once a month on 8th day at 2 past midnight in UTC.
text str
Textual representation of the crontab. User can customize the backup frequency and the backup version time using the cron expression. The version time must be in UTC timzeone. The backup will contain an externally consistent copy of the database at the version time. Allowed frequencies are 12 hour, 1 day, 1 week and 1 month. Examples of valid cron specifications: 0 2/12 * * * : every 12 hours at (2, 14) hours past midnight in UTC. 0 2,14 * * * : every 12 hours at (2,14) hours past midnight in UTC. 0 2 * * * : once a day at 2 past midnight in UTC. 0 2 * * 0 : once a week every Sunday at 2 past midnight in UTC. 0 2 8 * * : once a month on 8th day at 2 past midnight in UTC.
text String
Textual representation of the crontab. User can customize the backup frequency and the backup version time using the cron expression. The version time must be in UTC timzeone. The backup will contain an externally consistent copy of the database at the version time. Allowed frequencies are 12 hour, 1 day, 1 week and 1 month. Examples of valid cron specifications: 0 2/12 * * * : every 12 hours at (2, 14) hours past midnight in UTC. 0 2,14 * * * : every 12 hours at (2,14) hours past midnight in UTC. 0 2 * * * : once a day at 2 past midnight in UTC. 0 2 * * 0 : once a week every Sunday at 2 past midnight in UTC. 0 2 8 * * : once a month on 8th day at 2 past midnight in UTC.

Import

BackupSchedule can be imported using any of these accepted formats:

  • projects/{{project}}/instances/{{instance}}/databases/{{database}}/backupSchedules/{{name}}

  • {{project}}/{{instance}}/{{database}}/{{name}}

  • {{instance}}/{{database}}/{{name}}

When using the pulumi import command, BackupSchedule can be imported using one of the formats above. For example:

$ pulumi import gcp:spanner/backupSchedule:BackupSchedule default projects/{{project}}/instances/{{instance}}/databases/{{database}}/backupSchedules/{{name}}
Copy
$ pulumi import gcp:spanner/backupSchedule:BackupSchedule default {{project}}/{{instance}}/{{database}}/{{name}}
Copy
$ pulumi import gcp:spanner/backupSchedule:BackupSchedule default {{instance}}/{{database}}/{{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.