Alibaba Cloud

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

ReplicationVault

Provides a Hybrid Backup Recovery (HBR) Replication Vault resource.

For information about Hybrid Backup Recovery (HBR) Replication Vault and how to use it, see What is Replication Vault.

NOTE: Available in v1.152.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-testAccReplicationVault";
        var regionSource = config.Get("regionSource") ?? "you Replication value source region";
        var source = new AliCloud.Provider("source", new AliCloud.ProviderArgs
        {
            Region = regionSource,
        });
        var defaultVault = new AliCloud.Hbr.Vault("defaultVault", new AliCloud.Hbr.VaultArgs
        {
            VaultName = name,
        }, new CustomResourceOptions
        {
            Provider = alicloud.Source,
        });
        var defaultReplicationVaultRegions = Output.Create(AliCloud.Hbr.GetReplicationVaultRegions.InvokeAsync());
        var regionReplication = defaultReplicationVaultRegions.Apply(defaultReplicationVaultRegions => defaultReplicationVaultRegions.Regions?[0]?.ReplicationRegionId);
        var replication = new AliCloud.Provider("replication", new AliCloud.ProviderArgs
        {
            Region = regionReplication,
        });
        var defaultReplicationVault = new AliCloud.Hbr.ReplicationVault("defaultReplicationVault", new AliCloud.Hbr.ReplicationVaultArgs
        {
            ReplicationSourceRegionId = regionReplication,
            ReplicationSourceVaultId = defaultVault.Id,
            VaultName = name,
            VaultStorageClass = "STANDARD",
            Description = name,
        }, new CustomResourceOptions
        {
            Provider = alicloud.Replication,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/hbr"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/providers"
	"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-testAccReplicationVault"
		if param := cfg.Get("name"); param != "" {
			name = param
		}
		regionSource := "you Replication value source region"
		if param := cfg.Get("regionSource"); param != "" {
			regionSource = param
		}
		_, err := providers.Newalicloud(ctx, "source", &providers.alicloudArgs{
			Region: regionSource,
		})
		if err != nil {
			return err
		}
		defaultVault, err := hbr.NewVault(ctx, "defaultVault", &hbr.VaultArgs{
			VaultName: pulumi.String(name),
		}, pulumi.Provider(alicloud.Source))
		if err != nil {
			return err
		}
		defaultReplicationVaultRegions, err := hbr.GetReplicationVaultRegions(ctx, nil, nil)
		if err != nil {
			return err
		}
		regionReplication := defaultReplicationVaultRegions.Regions[0].ReplicationRegionId
		_, err = providers.Newalicloud(ctx, "replication", &providers.alicloudArgs{
			Region: regionReplication,
		})
		if err != nil {
			return err
		}
		_, err = hbr.NewReplicationVault(ctx, "defaultReplicationVault", &hbr.ReplicationVaultArgs{
			ReplicationSourceRegionId: pulumi.String(regionReplication),
			ReplicationSourceVaultId:  defaultVault.ID(),
			VaultName:                 pulumi.String(name),
			VaultStorageClass:         pulumi.String("STANDARD"),
			Description:               pulumi.String(name),
		}, pulumi.Provider(alicloud.Replication))
		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.pulumi.providers.alicloud;
import com.pulumi.pulumi.providers.ProviderArgs;
import com.pulumi.alicloud.hbr.Vault;
import com.pulumi.alicloud.hbr.VaultArgs;
import com.pulumi.alicloud.hbr.HbrFunctions;
import com.pulumi.alicloud.hbr.inputs.GetReplicationVaultRegionsArgs;
import com.pulumi.alicloud.hbr.ReplicationVault;
import com.pulumi.alicloud.hbr.ReplicationVaultArgs;
import com.pulumi.resources.CustomResourceOptions;
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-testAccReplicationVault");
        final var regionSource = config.get("regionSource").orElse("you Replication value source region");
        var source = new Provider("source", ProviderArgs.builder()        
            .region(regionSource)
            .build());

        var defaultVault = new Vault("defaultVault", VaultArgs.builder()        
            .vaultName(name)
            .build(), CustomResourceOptions.builder()
                .provider(alicloud.source())
                .build());

        final var defaultReplicationVaultRegions = HbrFunctions.getReplicationVaultRegions();

        final var regionReplication = defaultReplicationVaultRegions.applyValue(getReplicationVaultRegionsResult -> getReplicationVaultRegionsResult.regions()[0].replicationRegionId());

        var replication = new Provider("replication", ProviderArgs.builder()        
            .region(regionReplication)
            .build());

        var defaultReplicationVault = new ReplicationVault("defaultReplicationVault", ReplicationVaultArgs.builder()        
            .replicationSourceRegionId(regionReplication)
            .replicationSourceVaultId(defaultVault.id())
            .vaultName(name)
            .vaultStorageClass("STANDARD")
            .description(name)
            .build(), CustomResourceOptions.builder()
                .provider(alicloud.replication())
                .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud
import pulumi_pulumi as pulumi

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-testAccReplicationVault"
region_source = config.get("regionSource")
if region_source is None:
    region_source = "you Replication value source region"
source = pulumi.providers.Alicloud("source", region=region_source)
default_vault = alicloud.hbr.Vault("defaultVault", vault_name=name,
opts=pulumi.ResourceOptions(provider=alicloud["source"]))
default_replication_vault_regions = alicloud.hbr.get_replication_vault_regions()
region_replication = default_replication_vault_regions.regions[0].replication_region_id
replication = pulumi.providers.Alicloud("replication", region=region_replication)
default_replication_vault = alicloud.hbr.ReplicationVault("defaultReplicationVault",
    replication_source_region_id=region_replication,
    replication_source_vault_id=default_vault.id,
    vault_name=name,
    vault_storage_class="STANDARD",
    description=name,
    opts=pulumi.ResourceOptions(provider=alicloud["replication"]))
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const config = new pulumi.Config();
const name = config.get("name") || "tf-testAccReplicationVault";
const regionSource = config.get("regionSource") || "you Replication value source region";
const source = new alicloud.Provider("source", {region: regionSource});
const defaultVault = new alicloud.hbr.Vault("defaultVault", {vaultName: name}, {
    provider: alicloud.source,
});
const defaultReplicationVaultRegions = alicloud.hbr.getReplicationVaultRegions({});
const regionReplication = defaultReplicationVaultRegions.then(defaultReplicationVaultRegions => defaultReplicationVaultRegions.regions?[0]?.replicationRegionId);
const replication = new alicloud.Provider("replication", {region: regionReplication});
const defaultReplicationVault = new alicloud.hbr.ReplicationVault("defaultReplicationVault", {
    replicationSourceRegionId: regionReplication,
    replicationSourceVaultId: defaultVault.id,
    vaultName: name,
    vaultStorageClass: "STANDARD",
    description: name,
}, {
    provider: alicloud.replication,
});
configuration:
  name:
    type: string
    default: tf-testAccReplicationVault
  regionSource:
    type: string
    default: you Replication value source region
resources:
  source:
    type: pulumi:providers:alicloud
    properties:
      region: ${regionSource}
  defaultVault:
    type: alicloud:hbr:Vault
    properties:
      vaultName: ${name}
    options:
      provider: ${alicloud.source}
  replication:
    type: pulumi:providers:alicloud
    properties:
      region: ${regionReplication}
  defaultReplicationVault:
    type: alicloud:hbr:ReplicationVault
    properties:
      replicationSourceRegionId: ${regionReplication}
      replicationSourceVaultId: ${defaultVault.id}
      vaultName: ${name}
      vaultStorageClass: STANDARD
      description: ${name}
    options:
      provider: ${alicloud.replication}
variables:
  defaultReplicationVaultRegions:
    Fn::Invoke:
      Function: alicloud:hbr:getReplicationVaultRegions
      Arguments: {}
  regionReplication: ${defaultReplicationVaultRegions.regions[0].replicationRegionId}

Create a ReplicationVault Resource

new ReplicationVault(name: string, args: ReplicationVaultArgs, opts?: CustomResourceOptions);
@overload
def ReplicationVault(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     description: Optional[str] = None,
                     replication_source_region_id: Optional[str] = None,
                     replication_source_vault_id: Optional[str] = None,
                     vault_name: Optional[str] = None,
                     vault_storage_class: Optional[str] = None)
@overload
def ReplicationVault(resource_name: str,
                     args: ReplicationVaultArgs,
                     opts: Optional[ResourceOptions] = None)
func NewReplicationVault(ctx *Context, name string, args ReplicationVaultArgs, opts ...ResourceOption) (*ReplicationVault, error)
public ReplicationVault(string name, ReplicationVaultArgs args, CustomResourceOptions? opts = null)
public ReplicationVault(String name, ReplicationVaultArgs args)
public ReplicationVault(String name, ReplicationVaultArgs args, CustomResourceOptions options)
type: alicloud:hbr:ReplicationVault
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

ReplicationSourceRegionId string

The ID of the region where the source vault resides.

ReplicationSourceVaultId string

The ID of the source vault.

VaultName string

The name of the backup vault. The name must be 1 to 64 characters in length.

Description string

The description of the backup vault. The description must be 0 to 255 characters in length.

VaultStorageClass string

The storage type of the backup vault. Valid values: STANDARD.

ReplicationSourceRegionId string

The ID of the region where the source vault resides.

ReplicationSourceVaultId string

The ID of the source vault.

VaultName string

The name of the backup vault. The name must be 1 to 64 characters in length.

Description string

The description of the backup vault. The description must be 0 to 255 characters in length.

VaultStorageClass string

The storage type of the backup vault. Valid values: STANDARD.

replicationSourceRegionId String

The ID of the region where the source vault resides.

replicationSourceVaultId String

The ID of the source vault.

vaultName String

The name of the backup vault. The name must be 1 to 64 characters in length.

description String

The description of the backup vault. The description must be 0 to 255 characters in length.

vaultStorageClass String

The storage type of the backup vault. Valid values: STANDARD.

replicationSourceRegionId string

The ID of the region where the source vault resides.

replicationSourceVaultId string

The ID of the source vault.

vaultName string

The name of the backup vault. The name must be 1 to 64 characters in length.

description string

The description of the backup vault. The description must be 0 to 255 characters in length.

vaultStorageClass string

The storage type of the backup vault. Valid values: STANDARD.

replication_source_region_id str

The ID of the region where the source vault resides.

replication_source_vault_id str

The ID of the source vault.

vault_name str

The name of the backup vault. The name must be 1 to 64 characters in length.

description str

The description of the backup vault. The description must be 0 to 255 characters in length.

vault_storage_class str

The storage type of the backup vault. Valid values: STANDARD.

replicationSourceRegionId String

The ID of the region where the source vault resides.

replicationSourceVaultId String

The ID of the source vault.

vaultName String

The name of the backup vault. The name must be 1 to 64 characters in length.

description String

The description of the backup vault. The description must be 0 to 255 characters in length.

vaultStorageClass String

The storage type of the backup vault. Valid values: STANDARD.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the resource.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the resource.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the resource.

id string

The provider-assigned unique ID for this managed resource.

status string

The status of the resource.

id str

The provider-assigned unique ID for this managed resource.

status str

The status of the resource.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the resource.

Look up an Existing ReplicationVault Resource

Get an existing ReplicationVault 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?: ReplicationVaultState, opts?: CustomResourceOptions): ReplicationVault
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        replication_source_region_id: Optional[str] = None,
        replication_source_vault_id: Optional[str] = None,
        status: Optional[str] = None,
        vault_name: Optional[str] = None,
        vault_storage_class: Optional[str] = None) -> ReplicationVault
func GetReplicationVault(ctx *Context, name string, id IDInput, state *ReplicationVaultState, opts ...ResourceOption) (*ReplicationVault, error)
public static ReplicationVault Get(string name, Input<string> id, ReplicationVaultState? state, CustomResourceOptions? opts = null)
public static ReplicationVault get(String name, Output<String> id, ReplicationVaultState 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:
Description string

The description of the backup vault. The description must be 0 to 255 characters in length.

ReplicationSourceRegionId string

The ID of the region where the source vault resides.

ReplicationSourceVaultId string

The ID of the source vault.

Status string

The status of the resource.

VaultName string

The name of the backup vault. The name must be 1 to 64 characters in length.

VaultStorageClass string

The storage type of the backup vault. Valid values: STANDARD.

Description string

The description of the backup vault. The description must be 0 to 255 characters in length.

ReplicationSourceRegionId string

The ID of the region where the source vault resides.

ReplicationSourceVaultId string

The ID of the source vault.

Status string

The status of the resource.

VaultName string

The name of the backup vault. The name must be 1 to 64 characters in length.

VaultStorageClass string

The storage type of the backup vault. Valid values: STANDARD.

description String

The description of the backup vault. The description must be 0 to 255 characters in length.

replicationSourceRegionId String

The ID of the region where the source vault resides.

replicationSourceVaultId String

The ID of the source vault.

status String

The status of the resource.

vaultName String

The name of the backup vault. The name must be 1 to 64 characters in length.

vaultStorageClass String

The storage type of the backup vault. Valid values: STANDARD.

description string

The description of the backup vault. The description must be 0 to 255 characters in length.

replicationSourceRegionId string

The ID of the region where the source vault resides.

replicationSourceVaultId string

The ID of the source vault.

status string

The status of the resource.

vaultName string

The name of the backup vault. The name must be 1 to 64 characters in length.

vaultStorageClass string

The storage type of the backup vault. Valid values: STANDARD.

description str

The description of the backup vault. The description must be 0 to 255 characters in length.

replication_source_region_id str

The ID of the region where the source vault resides.

replication_source_vault_id str

The ID of the source vault.

status str

The status of the resource.

vault_name str

The name of the backup vault. The name must be 1 to 64 characters in length.

vault_storage_class str

The storage type of the backup vault. Valid values: STANDARD.

description String

The description of the backup vault. The description must be 0 to 255 characters in length.

replicationSourceRegionId String

The ID of the region where the source vault resides.

replicationSourceVaultId String

The ID of the source vault.

status String

The status of the resource.

vaultName String

The name of the backup vault. The name must be 1 to 64 characters in length.

vaultStorageClass String

The storage type of the backup vault. Valid values: STANDARD.

Import

Hybrid Backup Recovery (HBR) Replication Vault can be imported using the id, e.g.

 $ pulumi import alicloud:hbr/replicationVault:ReplicationVault 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.