1. Packages
  2. Alicloud Provider
  3. API Docs
  4. rds
  5. RdsBackup
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.rds.RdsBackup

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    Provides a RDS Backup resource.

    For information about RDS Backup and how to use it, see What is Backup.

    NOTE: Available since v1.149.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = new alicloud.rds.Instance("example", {
        engine: "MySQL",
        engineVersion: "5.6",
        instanceType: "rds.mysql.t1.small",
        instanceStorage: 30,
        instanceChargeType: "Postpaid",
        dbInstanceStorageType: "local_ssd",
    });
    const exampleRdsBackup = new alicloud.rds.RdsBackup("example", {dbInstanceId: example.id});
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.rds.Instance("example",
        engine="MySQL",
        engine_version="5.6",
        instance_type="rds.mysql.t1.small",
        instance_storage=30,
        instance_charge_type="Postpaid",
        db_instance_storage_type="local_ssd")
    example_rds_backup = alicloud.rds.RdsBackup("example", db_instance_id=example.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/rds"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := rds.NewInstance(ctx, "example", &rds.InstanceArgs{
    			Engine:                pulumi.String("MySQL"),
    			EngineVersion:         pulumi.String("5.6"),
    			InstanceType:          pulumi.String("rds.mysql.t1.small"),
    			InstanceStorage:       pulumi.Int(30),
    			InstanceChargeType:    pulumi.String("Postpaid"),
    			DbInstanceStorageType: pulumi.String("local_ssd"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = rds.NewRdsBackup(ctx, "example", &rds.RdsBackupArgs{
    			DbInstanceId: example.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AliCloud.Rds.Instance("example", new()
        {
            Engine = "MySQL",
            EngineVersion = "5.6",
            InstanceType = "rds.mysql.t1.small",
            InstanceStorage = 30,
            InstanceChargeType = "Postpaid",
            DbInstanceStorageType = "local_ssd",
        });
    
        var exampleRdsBackup = new AliCloud.Rds.RdsBackup("example", new()
        {
            DbInstanceId = example.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.rds.Instance;
    import com.pulumi.alicloud.rds.InstanceArgs;
    import com.pulumi.alicloud.rds.RdsBackup;
    import com.pulumi.alicloud.rds.RdsBackupArgs;
    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 example = new Instance("example", InstanceArgs.builder()
                .engine("MySQL")
                .engineVersion("5.6")
                .instanceType("rds.mysql.t1.small")
                .instanceStorage("30")
                .instanceChargeType("Postpaid")
                .dbInstanceStorageType("local_ssd")
                .build());
    
            var exampleRdsBackup = new RdsBackup("exampleRdsBackup", RdsBackupArgs.builder()
                .dbInstanceId(example.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: alicloud:rds:Instance
        properties:
          engine: MySQL
          engineVersion: '5.6'
          instanceType: rds.mysql.t1.small
          instanceStorage: '30'
          instanceChargeType: Postpaid
          dbInstanceStorageType: local_ssd
      exampleRdsBackup:
        type: alicloud:rds:RdsBackup
        name: example
        properties:
          dbInstanceId: ${example.id}
    

    Create RdsBackup Resource

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

    Constructor syntax

    new RdsBackup(name: string, args: RdsBackupArgs, opts?: CustomResourceOptions);
    @overload
    def RdsBackup(resource_name: str,
                  args: RdsBackupArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def RdsBackup(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  db_instance_id: Optional[str] = None,
                  backup_method: Optional[str] = None,
                  backup_strategy: Optional[str] = None,
                  backup_type: Optional[str] = None,
                  db_name: Optional[str] = None,
                  remove_from_state: Optional[bool] = None)
    func NewRdsBackup(ctx *Context, name string, args RdsBackupArgs, opts ...ResourceOption) (*RdsBackup, error)
    public RdsBackup(string name, RdsBackupArgs args, CustomResourceOptions? opts = null)
    public RdsBackup(String name, RdsBackupArgs args)
    public RdsBackup(String name, RdsBackupArgs args, CustomResourceOptions options)
    
    type: alicloud:rds:RdsBackup
    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 RdsBackupArgs
    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 RdsBackupArgs
    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 RdsBackupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RdsBackupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RdsBackupArgs
    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 rdsBackupResource = new AliCloud.Rds.RdsBackup("rdsBackupResource", new()
    {
        DbInstanceId = "string",
        BackupMethod = "string",
        BackupStrategy = "string",
        BackupType = "string",
        DbName = "string",
        RemoveFromState = false,
    });
    
    example, err := rds.NewRdsBackup(ctx, "rdsBackupResource", &rds.RdsBackupArgs{
    	DbInstanceId:    pulumi.String("string"),
    	BackupMethod:    pulumi.String("string"),
    	BackupStrategy:  pulumi.String("string"),
    	BackupType:      pulumi.String("string"),
    	DbName:          pulumi.String("string"),
    	RemoveFromState: pulumi.Bool(false),
    })
    
    var rdsBackupResource = new RdsBackup("rdsBackupResource", RdsBackupArgs.builder()
        .dbInstanceId("string")
        .backupMethod("string")
        .backupStrategy("string")
        .backupType("string")
        .dbName("string")
        .removeFromState(false)
        .build());
    
    rds_backup_resource = alicloud.rds.RdsBackup("rdsBackupResource",
        db_instance_id="string",
        backup_method="string",
        backup_strategy="string",
        backup_type="string",
        db_name="string",
        remove_from_state=False)
    
    const rdsBackupResource = new alicloud.rds.RdsBackup("rdsBackupResource", {
        dbInstanceId: "string",
        backupMethod: "string",
        backupStrategy: "string",
        backupType: "string",
        dbName: "string",
        removeFromState: false,
    });
    
    type: alicloud:rds:RdsBackup
    properties:
        backupMethod: string
        backupStrategy: string
        backupType: string
        dbInstanceId: string
        dbName: string
        removeFromState: false
    

    RdsBackup Resource Properties

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

    Inputs

    The RdsBackup resource accepts the following input properties:

    DbInstanceId string
    The db instance id.
    BackupMethod string
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    BackupStrategy string
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    BackupType string
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    DbName string
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    RemoveFromState bool
    Remove form state when resource cannot be deleted. Valid values: true and false.
    DbInstanceId string
    The db instance id.
    BackupMethod string
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    BackupStrategy string
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    BackupType string
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    DbName string
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    RemoveFromState bool
    Remove form state when resource cannot be deleted. Valid values: true and false.
    dbInstanceId String
    The db instance id.
    backupMethod String
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    backupStrategy String
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    backupType String
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    dbName String
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    removeFromState Boolean
    Remove form state when resource cannot be deleted. Valid values: true and false.
    dbInstanceId string
    The db instance id.
    backupMethod string
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    backupStrategy string
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    backupType string
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    dbName string
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    removeFromState boolean
    Remove form state when resource cannot be deleted. Valid values: true and false.
    db_instance_id str
    The db instance id.
    backup_method str
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    backup_strategy str
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    backup_type str
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    db_name str
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    remove_from_state bool
    Remove form state when resource cannot be deleted. Valid values: true and false.
    dbInstanceId String
    The db instance id.
    backupMethod String
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    backupStrategy String
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    backupType String
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    dbName String
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    removeFromState Boolean
    Remove form state when resource cannot be deleted. Valid values: true and false.

    Outputs

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

    BackupId string
    The backup id.
    Id string
    The provider-assigned unique ID for this managed resource.
    StoreStatus string
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.
    BackupId string
    The backup id.
    Id string
    The provider-assigned unique ID for this managed resource.
    StoreStatus string
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.
    backupId String
    The backup id.
    id String
    The provider-assigned unique ID for this managed resource.
    storeStatus String
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.
    backupId string
    The backup id.
    id string
    The provider-assigned unique ID for this managed resource.
    storeStatus string
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.
    backup_id str
    The backup id.
    id str
    The provider-assigned unique ID for this managed resource.
    store_status str
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.
    backupId String
    The backup id.
    id String
    The provider-assigned unique ID for this managed resource.
    storeStatus String
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.

    Look up Existing RdsBackup Resource

    Get an existing RdsBackup 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?: RdsBackupState, opts?: CustomResourceOptions): RdsBackup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            backup_id: Optional[str] = None,
            backup_method: Optional[str] = None,
            backup_strategy: Optional[str] = None,
            backup_type: Optional[str] = None,
            db_instance_id: Optional[str] = None,
            db_name: Optional[str] = None,
            remove_from_state: Optional[bool] = None,
            store_status: Optional[str] = None) -> RdsBackup
    func GetRdsBackup(ctx *Context, name string, id IDInput, state *RdsBackupState, opts ...ResourceOption) (*RdsBackup, error)
    public static RdsBackup Get(string name, Input<string> id, RdsBackupState? state, CustomResourceOptions? opts = null)
    public static RdsBackup get(String name, Output<String> id, RdsBackupState 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.
    The following state arguments are supported:
    BackupId string
    The backup id.
    BackupMethod string
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    BackupStrategy string
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    BackupType string
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    DbInstanceId string
    The db instance id.
    DbName string
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    RemoveFromState bool
    Remove form state when resource cannot be deleted. Valid values: true and false.
    StoreStatus string
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.
    BackupId string
    The backup id.
    BackupMethod string
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    BackupStrategy string
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    BackupType string
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    DbInstanceId string
    The db instance id.
    DbName string
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    RemoveFromState bool
    Remove form state when resource cannot be deleted. Valid values: true and false.
    StoreStatus string
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.
    backupId String
    The backup id.
    backupMethod String
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    backupStrategy String
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    backupType String
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    dbInstanceId String
    The db instance id.
    dbName String
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    removeFromState Boolean
    Remove form state when resource cannot be deleted. Valid values: true and false.
    storeStatus String
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.
    backupId string
    The backup id.
    backupMethod string
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    backupStrategy string
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    backupType string
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    dbInstanceId string
    The db instance id.
    dbName string
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    removeFromState boolean
    Remove form state when resource cannot be deleted. Valid values: true and false.
    storeStatus string
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.
    backup_id str
    The backup id.
    backup_method str
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    backup_strategy str
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    backup_type str
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    db_instance_id str
    The db instance id.
    db_name str
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    remove_from_state bool
    Remove form state when resource cannot be deleted. Valid values: true and false.
    store_status str
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.
    backupId String
    The backup id.
    backupMethod String
    The type of backup that you want to perform. Default value: Physical. Valid values: Logical, Physical and Snapshot.
    backupStrategy String
    The policy that you want to use for the backup task. Valid values:

    • db: specifies to perform a database-level backup.
    • instance: specifies to perform an instance-level backup.
    backupType String
    The method that you want to use for the backup task. Default value: Auto. Valid values:

    • Auto: specifies to automatically perform a full or incremental backup.
    • FullBackup: specifies to perform a full backup.
    dbInstanceId String
    The db instance id.
    dbName String
    The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
    removeFromState Boolean
    Remove form state when resource cannot be deleted. Valid values: true and false.
    storeStatus String
    Indicates whether the data backup file can be deleted. Valid values: Enabled and Disabled.

    Import

    RDS Backup can be imported using the id, e.g.

    $ pulumi import alicloud:rds/rdsBackup:RdsBackup example <db_instance_id>:<backup_id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi