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:
- API documentation
- How-to Guides
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: {},
});
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={})
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{},
})
if err != nil {
return err
}
return nil
})
}
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,
});
});
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 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()
.build());
}
}
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: {}
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: {},
});
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={})
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{},
})
if err != nil {
return err
}
return nil
})
}
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,
});
});
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 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()
.build());
}
}
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: {}
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,
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 string
- The unique name of the resource.
- args BackupScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args BackupScheduleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BackupScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
FullBackupSpec = null,
IncrementalBackupSpec = null,
Name = "string",
Project = "string",
Spec = new Gcp.Spanner.Inputs.BackupScheduleSpecArgs
{
CronSpec = new Gcp.Spanner.Inputs.BackupScheduleSpecCronSpecArgs
{
Text = "string",
},
},
});
example, err := spanner.NewBackupSchedule(ctx, "gcpBackupScheduleResource", &spanner.BackupScheduleArgs{
Database: pulumi.String("string"),
Instance: pulumi.String("string"),
RetentionDuration: 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"),
},
},
})
var gcpBackupScheduleResource = new BackupSchedule("gcpBackupScheduleResource", BackupScheduleArgs.builder()
.database("string")
.instance("string")
.retentionDuration("string")
.fullBackupSpec()
.incrementalBackupSpec()
.name("string")
.project("string")
.spec(BackupScheduleSpecArgs.builder()
.cronSpec(BackupScheduleSpecCronSpecArgs.builder()
.text("string")
.build())
.build())
.build());
gcp_backup_schedule_resource = gcp.spanner.BackupSchedule("gcpBackupScheduleResource",
database="string",
instance="string",
retention_duration="string",
full_backup_spec={},
incremental_backup_spec={},
name="string",
project="string",
spec={
"cron_spec": {
"text": "string",
},
})
const gcpBackupScheduleResource = new gcp.spanner.BackupSchedule("gcpBackupScheduleResource", {
database: "string",
instance: "string",
retentionDuration: "string",
fullBackupSpec: {},
incrementalBackupSpec: {},
name: "string",
project: "string",
spec: {
cronSpec: {
text: "string",
},
},
});
type: gcp:spanner:BackupSchedule
properties:
database: string
fullBackupSpec: {}
incrementalBackupSpec: {}
instance: string
name: string
project: string
retentionDuration: string
spec:
cronSpec:
text: string
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 string
- The database to create the backup schedule on.
- Instance string
- The instance to create the database on.
- Retention
Duration 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.
- Full
Backup BackupSpec Schedule Full Backup Spec - The schedule creates only full backups..
- Incremental
Backup BackupSpec Schedule Incremental Backup Spec - The schedule creates incremental backup chains.
- Name 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 string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Spec
Backup
Schedule Spec - Defines specifications of the backup schedule. Structure is documented below.
- Database string
- The database to create the backup schedule on.
- Instance string
- The instance to create the database on.
- Retention
Duration 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.
- Full
Backup BackupSpec Schedule Full Backup Spec Args - The schedule creates only full backups..
- Incremental
Backup BackupSpec Schedule Incremental Backup Spec Args - The schedule creates incremental backup chains.
- Name 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 string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Spec
Backup
Schedule Spec Args - Defines specifications of the backup schedule. Structure is documented below.
- database String
- The database to create the backup schedule on.
- instance String
- The instance to create the database on.
- retention
Duration 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.
- full
Backup BackupSpec Schedule Full Backup Spec - The schedule creates only full backups..
- incremental
Backup BackupSpec Schedule Incremental Backup Spec - The schedule creates incremental backup chains.
- name 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 String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- spec
Backup
Schedule Spec - Defines specifications of the backup schedule. Structure is documented below.
- database string
- The database to create the backup schedule on.
- instance string
- The instance to create the database on.
- retention
Duration 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.
- full
Backup BackupSpec Schedule Full Backup Spec - The schedule creates only full backups..
- incremental
Backup BackupSpec Schedule Incremental Backup Spec - The schedule creates incremental backup chains.
- name 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 string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- spec
Backup
Schedule Spec - Defines specifications of the backup schedule. Structure is documented below.
- database str
- The database to create the backup schedule on.
- instance str
- The instance to create the database on.
- 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.
- full_
backup_ Backupspec Schedule Full Backup Spec Args - The schedule creates only full backups..
- incremental_
backup_ Backupspec Schedule Incremental Backup Spec Args - The schedule creates incremental backup chains.
- name 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 str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- spec
Backup
Schedule Spec Args - Defines specifications of the backup schedule. Structure is documented below.
- database String
- The database to create the backup schedule on.
- instance String
- The instance to create the database on.
- retention
Duration 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.
- full
Backup Property MapSpec - The schedule creates only full backups..
- incremental
Backup Property MapSpec - The schedule creates incremental backup chains.
- name 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 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,
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)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Database string
- The database to create the backup schedule on.
- Full
Backup BackupSpec Schedule Full Backup Spec - The schedule creates only full backups..
- Incremental
Backup BackupSpec Schedule Incremental Backup Spec - The schedule creates incremental backup chains.
- Instance string
- The instance to create the database on.
- Name 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 string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Retention
Duration 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
Backup
Schedule Spec - Defines specifications of the backup schedule. Structure is documented below.
- Database string
- The database to create the backup schedule on.
- Full
Backup BackupSpec Schedule Full Backup Spec Args - The schedule creates only full backups..
- Incremental
Backup BackupSpec Schedule Incremental Backup Spec Args - The schedule creates incremental backup chains.
- Instance string
- The instance to create the database on.
- Name 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 string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Retention
Duration 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
Backup
Schedule Spec Args - Defines specifications of the backup schedule. Structure is documented below.
- database String
- The database to create the backup schedule on.
- full
Backup BackupSpec Schedule Full Backup Spec - The schedule creates only full backups..
- incremental
Backup BackupSpec Schedule Incremental Backup Spec - The schedule creates incremental backup chains.
- instance String
- The instance to create the database on.
- name 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 String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- retention
Duration 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
Backup
Schedule Spec - Defines specifications of the backup schedule. Structure is documented below.
- database string
- The database to create the backup schedule on.
- full
Backup BackupSpec Schedule Full Backup Spec - The schedule creates only full backups..
- incremental
Backup BackupSpec Schedule Incremental Backup Spec - The schedule creates incremental backup chains.
- instance string
- The instance to create the database on.
- name 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 string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- retention
Duration 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
Backup
Schedule Spec - Defines specifications of the backup schedule. Structure is documented below.
- database str
- The database to create the backup schedule on.
- full_
backup_ Backupspec Schedule Full Backup Spec Args - The schedule creates only full backups..
- incremental_
backup_ Backupspec Schedule Incremental Backup Spec Args - The schedule creates incremental backup chains.
- instance str
- The instance to create the database on.
- name 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 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
Backup
Schedule Spec Args - Defines specifications of the backup schedule. Structure is documented below.
- database String
- The database to create the backup schedule on.
- full
Backup Property MapSpec - The schedule creates only full backups..
- incremental
Backup Property MapSpec - The schedule creates incremental backup chains.
- instance String
- The instance to create the database on.
- name 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 String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- retention
Duration 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
BackupScheduleSpec, BackupScheduleSpecArgs
- Cron
Spec BackupSchedule Spec Cron Spec - Cron style schedule specification.. Structure is documented below.
- Cron
Spec BackupSchedule Spec Cron Spec - Cron style schedule specification.. Structure is documented below.
- cron
Spec BackupSchedule Spec Cron Spec - Cron style schedule specification.. Structure is documented below.
- cron
Spec BackupSchedule Spec Cron Spec - Cron style schedule specification.. Structure is documented below.
- cron_
spec BackupSchedule Spec Cron Spec - Cron style schedule specification.. Structure is documented below.
- cron
Spec 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}}
$ pulumi import gcp:spanner/backupSchedule:BackupSchedule default {{project}}/{{instance}}/{{database}}/{{name}}
$ pulumi import gcp:spanner/backupSchedule:BackupSchedule default {{instance}}/{{database}}/{{name}}
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.