vkcs.DbBackup
Explore with Pulumi AI
Provides a db backup resource. This can be used to create and delete db backup.
New since v0.1.4.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vkcs from "@pulumi/vkcs";
const mysqlBackup = new vkcs.DbBackup("mysqlBackup", {dbmsId: vkcs_db_instance.mysql.id});
import pulumi
import pulumi_vkcs as vkcs
mysql_backup = vkcs.DbBackup("mysqlBackup", dbms_id=vkcs_db_instance["mysql"]["id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/vkcs/vkcs"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vkcs.NewDbBackup(ctx, "mysqlBackup", &vkcs.DbBackupArgs{
DbmsId: pulumi.Any(vkcs_db_instance.Mysql.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vkcs = Pulumi.Vkcs;
return await Deployment.RunAsync(() =>
{
var mysqlBackup = new Vkcs.DbBackup("mysqlBackup", new()
{
DbmsId = vkcs_db_instance.Mysql.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vkcs.DbBackup;
import com.pulumi.vkcs.DbBackupArgs;
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 mysqlBackup = new DbBackup("mysqlBackup", DbBackupArgs.builder()
.dbmsId(vkcs_db_instance.mysql().id())
.build());
}
}
resources:
mysqlBackup:
type: vkcs:DbBackup
properties:
dbmsId: ${vkcs_db_instance.mysql.id}
Create DbBackup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DbBackup(name: string, args: DbBackupArgs, opts?: CustomResourceOptions);
@overload
def DbBackup(resource_name: str,
args: DbBackupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DbBackup(resource_name: str,
opts: Optional[ResourceOptions] = None,
dbms_id: Optional[str] = None,
container_prefix: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None,
timeouts: Optional[DbBackupTimeoutsArgs] = None)
func NewDbBackup(ctx *Context, name string, args DbBackupArgs, opts ...ResourceOption) (*DbBackup, error)
public DbBackup(string name, DbBackupArgs args, CustomResourceOptions? opts = null)
public DbBackup(String name, DbBackupArgs args)
public DbBackup(String name, DbBackupArgs args, CustomResourceOptions options)
type: vkcs:DbBackup
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 DbBackupArgs
- 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 DbBackupArgs
- 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 DbBackupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DbBackupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DbBackupArgs
- 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 dbBackupResource = new Vkcs.DbBackup("dbBackupResource", new()
{
DbmsId = "string",
ContainerPrefix = "string",
Description = "string",
Name = "string",
Region = "string",
Timeouts = new Vkcs.Inputs.DbBackupTimeoutsArgs
{
Create = "string",
Delete = "string",
},
});
example, err := vkcs.NewDbBackup(ctx, "dbBackupResource", &vkcs.DbBackupArgs{
DbmsId: pulumi.String("string"),
ContainerPrefix: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Region: pulumi.String("string"),
Timeouts: &vkcs.DbBackupTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
},
})
var dbBackupResource = new DbBackup("dbBackupResource", DbBackupArgs.builder()
.dbmsId("string")
.containerPrefix("string")
.description("string")
.name("string")
.region("string")
.timeouts(DbBackupTimeoutsArgs.builder()
.create("string")
.delete("string")
.build())
.build());
db_backup_resource = vkcs.DbBackup("dbBackupResource",
dbms_id="string",
container_prefix="string",
description="string",
name="string",
region="string",
timeouts={
"create": "string",
"delete": "string",
})
const dbBackupResource = new vkcs.DbBackup("dbBackupResource", {
dbmsId: "string",
containerPrefix: "string",
description: "string",
name: "string",
region: "string",
timeouts: {
create: "string",
"delete": "string",
},
});
type: vkcs:DbBackup
properties:
containerPrefix: string
dbmsId: string
description: string
name: string
region: string
timeouts:
create: string
delete: string
DbBackup 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 DbBackup resource accepts the following input properties:
- Dbms
Id string - required string → ID of the instance or cluster, to create backup of.
- Container
Prefix string - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- Description string
- optional string → The description of the backup
- Name string
- required string → The name of the backup. Changing this creates a new backup
- Region string
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - Timeouts
Db
Backup Timeouts
- Dbms
Id string - required string → ID of the instance or cluster, to create backup of.
- Container
Prefix string - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- Description string
- optional string → The description of the backup
- Name string
- required string → The name of the backup. Changing this creates a new backup
- Region string
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - Timeouts
Db
Backup Timeouts Args
- dbms
Id String - required string → ID of the instance or cluster, to create backup of.
- container
Prefix String - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- description String
- optional string → The description of the backup
- name String
- required string → The name of the backup. Changing this creates a new backup
- region String
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - timeouts
Db
Backup Timeouts
- dbms
Id string - required string → ID of the instance or cluster, to create backup of.
- container
Prefix string - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- description string
- optional string → The description of the backup
- name string
- required string → The name of the backup. Changing this creates a new backup
- region string
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - timeouts
Db
Backup Timeouts
- dbms_
id str - required string → ID of the instance or cluster, to create backup of.
- container_
prefix str - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- description str
- optional string → The description of the backup
- name str
- required string → The name of the backup. Changing this creates a new backup
- region str
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - timeouts
Db
Backup Timeouts Args
- dbms
Id String - required string → ID of the instance or cluster, to create backup of.
- container
Prefix String - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- description String
- optional string → The description of the backup
- name String
- required string → The name of the backup. Changing this creates a new backup
- region String
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the DbBackup resource produces the following output properties:
- Created string
- string → Backup creation timestamp
- Datastores
List<Db
Backup Datastore> - list → Object that represents datastore of backup
- Dbms
Type string - string → Type of dbms for the backup, can be "instance" or "cluster".
- Id string
- The provider-assigned unique ID for this managed resource.
- Location
Ref string - string → Location of backup data on backup storage
- Meta string
- string → Metadata of the backup
- Size double
- number → Backup's volume size
- Updated string
- string → Timestamp of backup's last update
- Wal
Size double - number → Backup's WAL volume size
- Created string
- string → Backup creation timestamp
- Datastores
[]Db
Backup Datastore - list → Object that represents datastore of backup
- Dbms
Type string - string → Type of dbms for the backup, can be "instance" or "cluster".
- Id string
- The provider-assigned unique ID for this managed resource.
- Location
Ref string - string → Location of backup data on backup storage
- Meta string
- string → Metadata of the backup
- Size float64
- number → Backup's volume size
- Updated string
- string → Timestamp of backup's last update
- Wal
Size float64 - number → Backup's WAL volume size
- created String
- string → Backup creation timestamp
- datastores
List<Db
Backup Datastore> - list → Object that represents datastore of backup
- dbms
Type String - string → Type of dbms for the backup, can be "instance" or "cluster".
- id String
- The provider-assigned unique ID for this managed resource.
- location
Ref String - string → Location of backup data on backup storage
- meta String
- string → Metadata of the backup
- size Double
- number → Backup's volume size
- updated String
- string → Timestamp of backup's last update
- wal
Size Double - number → Backup's WAL volume size
- created string
- string → Backup creation timestamp
- datastores
Db
Backup Datastore[] - list → Object that represents datastore of backup
- dbms
Type string - string → Type of dbms for the backup, can be "instance" or "cluster".
- id string
- The provider-assigned unique ID for this managed resource.
- location
Ref string - string → Location of backup data on backup storage
- meta string
- string → Metadata of the backup
- size number
- number → Backup's volume size
- updated string
- string → Timestamp of backup's last update
- wal
Size number - number → Backup's WAL volume size
- created str
- string → Backup creation timestamp
- datastores
Sequence[Db
Backup Datastore] - list → Object that represents datastore of backup
- dbms_
type str - string → Type of dbms for the backup, can be "instance" or "cluster".
- id str
- The provider-assigned unique ID for this managed resource.
- location_
ref str - string → Location of backup data on backup storage
- meta str
- string → Metadata of the backup
- size float
- number → Backup's volume size
- updated str
- string → Timestamp of backup's last update
- wal_
size float - number → Backup's WAL volume size
- created String
- string → Backup creation timestamp
- datastores List<Property Map>
- list → Object that represents datastore of backup
- dbms
Type String - string → Type of dbms for the backup, can be "instance" or "cluster".
- id String
- The provider-assigned unique ID for this managed resource.
- location
Ref String - string → Location of backup data on backup storage
- meta String
- string → Metadata of the backup
- size Number
- number → Backup's volume size
- updated String
- string → Timestamp of backup's last update
- wal
Size Number - number → Backup's WAL volume size
Look up Existing DbBackup Resource
Get an existing DbBackup 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?: DbBackupState, opts?: CustomResourceOptions): DbBackup
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
container_prefix: Optional[str] = None,
created: Optional[str] = None,
datastores: Optional[Sequence[DbBackupDatastoreArgs]] = None,
dbms_id: Optional[str] = None,
dbms_type: Optional[str] = None,
description: Optional[str] = None,
location_ref: Optional[str] = None,
meta: Optional[str] = None,
name: Optional[str] = None,
region: Optional[str] = None,
size: Optional[float] = None,
timeouts: Optional[DbBackupTimeoutsArgs] = None,
updated: Optional[str] = None,
wal_size: Optional[float] = None) -> DbBackup
func GetDbBackup(ctx *Context, name string, id IDInput, state *DbBackupState, opts ...ResourceOption) (*DbBackup, error)
public static DbBackup Get(string name, Input<string> id, DbBackupState? state, CustomResourceOptions? opts = null)
public static DbBackup get(String name, Output<String> id, DbBackupState state, CustomResourceOptions options)
resources: _: type: vkcs:DbBackup get: id: ${id}
- 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.
- Container
Prefix string - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- Created string
- string → Backup creation timestamp
- Datastores
List<Db
Backup Datastore> - list → Object that represents datastore of backup
- Dbms
Id string - required string → ID of the instance or cluster, to create backup of.
- Dbms
Type string - string → Type of dbms for the backup, can be "instance" or "cluster".
- Description string
- optional string → The description of the backup
- Location
Ref string - string → Location of backup data on backup storage
- Meta string
- string → Metadata of the backup
- Name string
- required string → The name of the backup. Changing this creates a new backup
- Region string
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - Size double
- number → Backup's volume size
- Timeouts
Db
Backup Timeouts - Updated string
- string → Timestamp of backup's last update
- Wal
Size double - number → Backup's WAL volume size
- Container
Prefix string - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- Created string
- string → Backup creation timestamp
- Datastores
[]Db
Backup Datastore Args - list → Object that represents datastore of backup
- Dbms
Id string - required string → ID of the instance or cluster, to create backup of.
- Dbms
Type string - string → Type of dbms for the backup, can be "instance" or "cluster".
- Description string
- optional string → The description of the backup
- Location
Ref string - string → Location of backup data on backup storage
- Meta string
- string → Metadata of the backup
- Name string
- required string → The name of the backup. Changing this creates a new backup
- Region string
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - Size float64
- number → Backup's volume size
- Timeouts
Db
Backup Timeouts Args - Updated string
- string → Timestamp of backup's last update
- Wal
Size float64 - number → Backup's WAL volume size
- container
Prefix String - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- created String
- string → Backup creation timestamp
- datastores
List<Db
Backup Datastore> - list → Object that represents datastore of backup
- dbms
Id String - required string → ID of the instance or cluster, to create backup of.
- dbms
Type String - string → Type of dbms for the backup, can be "instance" or "cluster".
- description String
- optional string → The description of the backup
- location
Ref String - string → Location of backup data on backup storage
- meta String
- string → Metadata of the backup
- name String
- required string → The name of the backup. Changing this creates a new backup
- region String
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - size Double
- number → Backup's volume size
- timeouts
Db
Backup Timeouts - updated String
- string → Timestamp of backup's last update
- wal
Size Double - number → Backup's WAL volume size
- container
Prefix string - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- created string
- string → Backup creation timestamp
- datastores
Db
Backup Datastore[] - list → Object that represents datastore of backup
- dbms
Id string - required string → ID of the instance or cluster, to create backup of.
- dbms
Type string - string → Type of dbms for the backup, can be "instance" or "cluster".
- description string
- optional string → The description of the backup
- location
Ref string - string → Location of backup data on backup storage
- meta string
- string → Metadata of the backup
- name string
- required string → The name of the backup. Changing this creates a new backup
- region string
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - size number
- number → Backup's volume size
- timeouts
Db
Backup Timeouts - updated string
- string → Timestamp of backup's last update
- wal
Size number - number → Backup's WAL volume size
- container_
prefix str - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- created str
- string → Backup creation timestamp
- datastores
Sequence[Db
Backup Datastore Args] - list → Object that represents datastore of backup
- dbms_
id str - required string → ID of the instance or cluster, to create backup of.
- dbms_
type str - string → Type of dbms for the backup, can be "instance" or "cluster".
- description str
- optional string → The description of the backup
- location_
ref str - string → Location of backup data on backup storage
- meta str
- string → Metadata of the backup
- name str
- required string → The name of the backup. Changing this creates a new backup
- region str
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - size float
- number → Backup's volume size
- timeouts
Db
Backup Timeouts Args - updated str
- string → Timestamp of backup's last update
- wal_
size float - number → Backup's WAL volume size
- container
Prefix String - optional string → Prefix of S3 bucket ([prefix] - [project_id]) to store backup data. Default: databasebackups
- created String
- string → Backup creation timestamp
- datastores List<Property Map>
- list → Object that represents datastore of backup
- dbms
Id String - required string → ID of the instance or cluster, to create backup of.
- dbms
Type String - string → Type of dbms for the backup, can be "instance" or "cluster".
- description String
- optional string → The description of the backup
- location
Ref String - string → Location of backup data on backup storage
- meta String
- string → Metadata of the backup
- name String
- required string → The name of the backup. Changing this creates a new backup
- region String
- optional string → The region in which to obtain the service client. If omitted, the
region
argument of the provider is used.New since v0.4.0. - size Number
- number → Backup's volume size
- timeouts Property Map
- updated String
- string → Timestamp of backup's last update
- wal
Size Number - number → Backup's WAL volume size
Supporting Types
DbBackupDatastore, DbBackupDatastoreArgs
DbBackupTimeouts, DbBackupTimeoutsArgs
- Create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- Create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- create String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- create str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- create String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- delete String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
Import
Backups can be imported using the id
, e.g.
$ pulumi import vkcs:index/dbBackup:DbBackup mybackup 67b86ce7-0924-48a6-8a18-683cfc6b4183
After the import you can use terraform show to view imported fields and write their values to your .tf file.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vkcs vk-cs/terraform-provider-vkcs
- License
- Notes
- This Pulumi package is based on the
vkcs
Terraform Provider.