Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

OssBackupPlan

Provides a HBR Oss Backup Plan resource.

For information about HBR Oss Backup Plan and how to use it, see What is Oss Backup Plan.

NOTE: Available in v1.131.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-test112358";
        var defaultVault = new AliCloud.Hbr.Vault("defaultVault", new AliCloud.Hbr.VaultArgs
        {
            VaultName = name,
        });
        var defaultBucket = new AliCloud.Oss.Bucket("defaultBucket", new AliCloud.Oss.BucketArgs
        {
            BucketName = name,
        });
        var defaultOssBackupPlan = new AliCloud.Hbr.OssBackupPlan("defaultOssBackupPlan", new AliCloud.Hbr.OssBackupPlanArgs
        {
            OssBackupPlanName = name,
            Prefix = "/",
            Bucket = defaultBucket.BucketName,
            VaultId = defaultVault.Id,
            Schedule = "I|1602673264|PT2H",
            BackupType = "COMPLETE",
            Retention = "2",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/hbr"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oss"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		name := "tf-test112358"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		defaultVault, err := hbr.NewVault(ctx, "defaultVault", &hbr.VaultArgs{
			VaultName: pulumi.String(name),
		})
		if err != nil {
			return err
		}
		defaultBucket, err := oss.NewBucket(ctx, "defaultBucket", &oss.BucketArgs{
			Bucket: pulumi.String(name),
		})
		if err != nil {
			return err
		}
		_, err = hbr.NewOssBackupPlan(ctx, "defaultOssBackupPlan", &hbr.OssBackupPlanArgs{
			OssBackupPlanName: pulumi.String(name),
			Prefix:            pulumi.String("/"),
			Bucket:            defaultBucket.Bucket,
			VaultId:           defaultVault.ID(),
			Schedule:          pulumi.String("I|1602673264|PT2H"),
			BackupType:        pulumi.String("COMPLETE"),
			Retention:         pulumi.String("2"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.hbr.Vault;
import com.pulumi.alicloud.hbr.VaultArgs;
import com.pulumi.alicloud.oss.Bucket;
import com.pulumi.alicloud.oss.BucketArgs;
import com.pulumi.alicloud.hbr.OssBackupPlan;
import com.pulumi.alicloud.hbr.OssBackupPlanArgs;
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) {
        final var config = ctx.config();
        final var name = config.get("name").orElse("tf-test112358");
        var defaultVault = new Vault("defaultVault", VaultArgs.builder()        
            .vaultName(name)
            .build());

        var defaultBucket = new Bucket("defaultBucket", BucketArgs.builder()        
            .bucket(name)
            .build());

        var defaultOssBackupPlan = new OssBackupPlan("defaultOssBackupPlan", OssBackupPlanArgs.builder()        
            .ossBackupPlanName(name)
            .prefix("/")
            .bucket(defaultBucket.bucket())
            .vaultId(defaultVault.id())
            .schedule("I|1602673264|PT2H")
            .backupType("COMPLETE")
            .retention("2")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-test112358"
default_vault = alicloud.hbr.Vault("defaultVault", vault_name=name)
default_bucket = alicloud.oss.Bucket("defaultBucket", bucket=name)
default_oss_backup_plan = alicloud.hbr.OssBackupPlan("defaultOssBackupPlan",
    oss_backup_plan_name=name,
    prefix="/",
    bucket=default_bucket.bucket,
    vault_id=default_vault.id,
    schedule="I|1602673264|PT2H",
    backup_type="COMPLETE",
    retention="2")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "tf-test112358";
const defaultVault = new alicloud.hbr.Vault("defaultVault", {vaultName: name});
const defaultBucket = new alicloud.oss.Bucket("defaultBucket", {bucket: name});
const defaultOssBackupPlan = new alicloud.hbr.OssBackupPlan("defaultOssBackupPlan", {
    ossBackupPlanName: name,
    prefix: "/",
    bucket: defaultBucket.bucket,
    vaultId: defaultVault.id,
    schedule: "I|1602673264|PT2H",
    backupType: "COMPLETE",
    retention: "2",
});
configuration:
  name:
    type: string
    default: tf-test112358
resources:
  defaultVault:
    type: alicloud:hbr:Vault
    properties:
      vaultName: ${name}
  defaultBucket:
    type: alicloud:oss:Bucket
    properties:
      bucket: ${name}
  defaultOssBackupPlan:
    type: alicloud:hbr:OssBackupPlan
    properties:
      ossBackupPlanName: ${name}
      prefix: /
      bucket: ${defaultBucket.bucket}
      vaultId: ${defaultVault.id}
      schedule: I|1602673264|PT2H
      backupType: COMPLETE
      retention: 2

Create a OssBackupPlan Resource

new OssBackupPlan(name: string, args: OssBackupPlanArgs, opts?: CustomResourceOptions);
@overload
def OssBackupPlan(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  backup_type: Optional[str] = None,
                  bucket: Optional[str] = None,
                  disabled: Optional[bool] = None,
                  oss_backup_plan_name: Optional[str] = None,
                  prefix: Optional[str] = None,
                  retention: Optional[str] = None,
                  schedule: Optional[str] = None,
                  vault_id: Optional[str] = None)
@overload
def OssBackupPlan(resource_name: str,
                  args: OssBackupPlanArgs,
                  opts: Optional[ResourceOptions] = None)
func NewOssBackupPlan(ctx *Context, name string, args OssBackupPlanArgs, opts ...ResourceOption) (*OssBackupPlan, error)
public OssBackupPlan(string name, OssBackupPlanArgs args, CustomResourceOptions? opts = null)
public OssBackupPlan(String name, OssBackupPlanArgs args)
public OssBackupPlan(String name, OssBackupPlanArgs args, CustomResourceOptions options)
type: alicloud:hbr:OssBackupPlan
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args OssBackupPlanArgs
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 OssBackupPlanArgs
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 OssBackupPlanArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args OssBackupPlanArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args OssBackupPlanArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

OssBackupPlan 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 OssBackupPlan resource accepts the following input properties:

BackupType string

Backup type. Valid values: COMPLETE.

Bucket string

The name of OSS bucket.

OssBackupPlanName string

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

Retention string

Backup retention days, the minimum is 1.

Schedule string

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

VaultId string

The ID of backup vault.

Disabled bool

Whether to disable the backup task. Valid values: true, false.

Prefix string

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

BackupType string

Backup type. Valid values: COMPLETE.

Bucket string

The name of OSS bucket.

OssBackupPlanName string

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

Retention string

Backup retention days, the minimum is 1.

Schedule string

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

VaultId string

The ID of backup vault.

Disabled bool

Whether to disable the backup task. Valid values: true, false.

Prefix string

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

backupType String

Backup type. Valid values: COMPLETE.

bucket String

The name of OSS bucket.

ossBackupPlanName String

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

retention String

Backup retention days, the minimum is 1.

schedule String

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

vaultId String

The ID of backup vault.

disabled Boolean

Whether to disable the backup task. Valid values: true, false.

prefix String

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

backupType string

Backup type. Valid values: COMPLETE.

bucket string

The name of OSS bucket.

ossBackupPlanName string

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

retention string

Backup retention days, the minimum is 1.

schedule string

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

vaultId string

The ID of backup vault.

disabled boolean

Whether to disable the backup task. Valid values: true, false.

prefix string

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

backup_type str

Backup type. Valid values: COMPLETE.

bucket str

The name of OSS bucket.

oss_backup_plan_name str

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

retention str

Backup retention days, the minimum is 1.

schedule str

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

vault_id str

The ID of backup vault.

disabled bool

Whether to disable the backup task. Valid values: true, false.

prefix str

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

backupType String

Backup type. Valid values: COMPLETE.

bucket String

The name of OSS bucket.

ossBackupPlanName String

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

retention String

Backup retention days, the minimum is 1.

schedule String

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

vaultId String

The ID of backup vault.

disabled Boolean

Whether to disable the backup task. Valid values: true, false.

prefix String

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

Outputs

All input properties are implicitly available as output properties. Additionally, the OssBackupPlan 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 an Existing OssBackupPlan Resource

Get an existing OssBackupPlan 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?: OssBackupPlanState, opts?: CustomResourceOptions): OssBackupPlan
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        backup_type: Optional[str] = None,
        bucket: Optional[str] = None,
        disabled: Optional[bool] = None,
        oss_backup_plan_name: Optional[str] = None,
        prefix: Optional[str] = None,
        retention: Optional[str] = None,
        schedule: Optional[str] = None,
        vault_id: Optional[str] = None) -> OssBackupPlan
func GetOssBackupPlan(ctx *Context, name string, id IDInput, state *OssBackupPlanState, opts ...ResourceOption) (*OssBackupPlan, error)
public static OssBackupPlan Get(string name, Input<string> id, OssBackupPlanState? state, CustomResourceOptions? opts = null)
public static OssBackupPlan get(String name, Output<String> id, OssBackupPlanState 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:
BackupType string

Backup type. Valid values: COMPLETE.

Bucket string

The name of OSS bucket.

Disabled bool

Whether to disable the backup task. Valid values: true, false.

OssBackupPlanName string

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

Prefix string

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

Retention string

Backup retention days, the minimum is 1.

Schedule string

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

VaultId string

The ID of backup vault.

BackupType string

Backup type. Valid values: COMPLETE.

Bucket string

The name of OSS bucket.

Disabled bool

Whether to disable the backup task. Valid values: true, false.

OssBackupPlanName string

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

Prefix string

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

Retention string

Backup retention days, the minimum is 1.

Schedule string

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

VaultId string

The ID of backup vault.

backupType String

Backup type. Valid values: COMPLETE.

bucket String

The name of OSS bucket.

disabled Boolean

Whether to disable the backup task. Valid values: true, false.

ossBackupPlanName String

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

prefix String

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

retention String

Backup retention days, the minimum is 1.

schedule String

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

vaultId String

The ID of backup vault.

backupType string

Backup type. Valid values: COMPLETE.

bucket string

The name of OSS bucket.

disabled boolean

Whether to disable the backup task. Valid values: true, false.

ossBackupPlanName string

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

prefix string

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

retention string

Backup retention days, the minimum is 1.

schedule string

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

vaultId string

The ID of backup vault.

backup_type str

Backup type. Valid values: COMPLETE.

bucket str

The name of OSS bucket.

disabled bool

Whether to disable the backup task. Valid values: true, false.

oss_backup_plan_name str

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

prefix str

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

retention str

Backup retention days, the minimum is 1.

schedule str

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

vault_id str

The ID of backup vault.

backupType String

Backup type. Valid values: COMPLETE.

bucket String

The name of OSS bucket.

disabled Boolean

Whether to disable the backup task. Valid values: true, false.

ossBackupPlanName String

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

prefix String

Backup prefix. Once specified, only objects with matching prefixes will be backed up.

retention String

Backup retention days, the minimum is 1.

schedule String

Backup strategy. Optional format: I|{startTime}|{interval}. It means to execute a backup task every {interval} starting from {startTime}. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.

vaultId String

The ID of backup vault.

Import

HBR Oss Backup Plan can be imported using the id, e.g.

 $ pulumi import alicloud:hbr/ossBackupPlan:OssBackupPlan example <id>

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.