alicloud.rds.RdsBackup
Explore with Pulumi AI
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:
- Db
Instance stringId - The db instance id.
- Backup
Method string - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - Backup
Strategy 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.
- Backup
Type 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.
- Db
Name string - The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
- Remove
From boolState - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
.
- Db
Instance stringId - The db instance id.
- Backup
Method string - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - Backup
Strategy 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.
- Backup
Type 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.
- Db
Name string - The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
- Remove
From boolState - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
.
- db
Instance StringId - The db instance id.
- backup
Method String - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - backup
Strategy 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.
- backup
Type 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.
- db
Name String - The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
- remove
From BooleanState - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
.
- db
Instance stringId - The db instance id.
- backup
Method string - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - backup
Strategy 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.
- backup
Type 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.
- db
Name string - The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
- remove
From booleanState - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
.
- db_
instance_ strid - The db instance id.
- backup_
method str - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - 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_ boolstate - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
.
- db
Instance StringId - The db instance id.
- backup
Method String - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - backup
Strategy 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.
- backup
Type 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.
- db
Name String - The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
- remove
From BooleanState - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
.
Outputs
All input properties are implicitly available as output properties. Additionally, the RdsBackup resource produces the following output properties:
- Backup
Id string - The backup id.
- Id string
- The provider-assigned unique ID for this managed resource.
- Store
Status string - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
- Backup
Id string - The backup id.
- Id string
- The provider-assigned unique ID for this managed resource.
- Store
Status string - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
- backup
Id String - The backup id.
- id String
- The provider-assigned unique ID for this managed resource.
- store
Status String - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
- backup
Id string - The backup id.
- id string
- The provider-assigned unique ID for this managed resource.
- store
Status string - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
- 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
andDisabled
.
- backup
Id String - The backup id.
- id String
- The provider-assigned unique ID for this managed resource.
- store
Status String - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
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.
- Backup
Id string - The backup id.
- Backup
Method string - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - Backup
Strategy 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.
- Backup
Type 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.
- Db
Instance stringId - The db instance id.
- Db
Name string - The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
- Remove
From boolState - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
. - Store
Status string - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
- Backup
Id string - The backup id.
- Backup
Method string - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - Backup
Strategy 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.
- Backup
Type 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.
- Db
Instance stringId - The db instance id.
- Db
Name string - The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
- Remove
From boolState - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
. - Store
Status string - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
- backup
Id String - The backup id.
- backup
Method String - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - backup
Strategy 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.
- backup
Type 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.
- db
Instance StringId - The db instance id.
- db
Name String - The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
- remove
From BooleanState - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
. - store
Status String - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
- backup
Id string - The backup id.
- backup
Method string - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - backup
Strategy 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.
- backup
Type 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.
- db
Instance stringId - The db instance id.
- db
Name string - The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
- remove
From booleanState - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
. - store
Status string - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
- 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
andSnapshot
. - 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_ strid - 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_ boolstate - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
. - store_
status str - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
- backup
Id String - The backup id.
- backup
Method String - The type of backup that you want to perform. Default value:
Physical
. Valid values:Logical
,Physical
andSnapshot
. - backup
Strategy 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.
- backup
Type 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.
- db
Instance StringId - The db instance id.
- db
Name String - The names of the databases whose data you want to back up. Separate the names of the databases with commas (,).
- remove
From BooleanState - Remove form state when resource cannot be deleted. Valid values:
true
andfalse
. - store
Status String - Indicates whether the data backup file can be deleted. Valid values:
Enabled
andDisabled
.
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.