1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. hbr
  5. ReplicationVault
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.hbr.ReplicationVault

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    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

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const config = new pulumi.Config();
    const sourceRegion = config.get("sourceRegion") || "cn-hangzhou";
    const default = alicloud.hbr.getReplicationVaultRegions({});
    const defaultInteger = new random.index.Integer("default", {
        min: 10000,
        max: 99999,
    });
    const defaultVault = new alicloud.hbr.Vault("default", {vaultName: `terraform-example-${defaultInteger.result}`});
    const defaultReplicationVault = new alicloud.hbr.ReplicationVault("default", {
        replicationSourceRegionId: sourceRegion,
        replicationSourceVaultId: defaultVault.id,
        vaultName: "terraform-example",
        vaultStorageClass: "STANDARD",
        description: "terraform-example",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    source_region = config.get("sourceRegion")
    if source_region is None:
        source_region = "cn-hangzhou"
    default = alicloud.hbr.get_replication_vault_regions()
    default_integer = random.index.Integer("default",
        min=10000,
        max=99999)
    default_vault = alicloud.hbr.Vault("default", vault_name=f"terraform-example-{default_integer['result']}")
    default_replication_vault = alicloud.hbr.ReplicationVault("default",
        replication_source_region_id=source_region,
        replication_source_vault_id=default_vault.id,
        vault_name="terraform-example",
        vault_storage_class="STANDARD",
        description="terraform-example")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/hbr"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"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, "")
    		sourceRegion := "cn-hangzhou"
    		if param := cfg.Get("sourceRegion"); param != "" {
    			sourceRegion = param
    		}
    		_, err := hbr.GetReplicationVaultRegions(ctx, &hbr.GetReplicationVaultRegionsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Min: 10000,
    			Max: 99999,
    		})
    		if err != nil {
    			return err
    		}
    		defaultVault, err := hbr.NewVault(ctx, "default", &hbr.VaultArgs{
    			VaultName: pulumi.Sprintf("terraform-example-%v", defaultInteger.Result),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = hbr.NewReplicationVault(ctx, "default", &hbr.ReplicationVaultArgs{
    			ReplicationSourceRegionId: pulumi.String(sourceRegion),
    			ReplicationSourceVaultId:  defaultVault.ID(),
    			VaultName:                 pulumi.String("terraform-example"),
    			VaultStorageClass:         pulumi.String("STANDARD"),
    			Description:               pulumi.String("terraform-example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var sourceRegion = config.Get("sourceRegion") ?? "cn-hangzhou";
        var @default = AliCloud.Hbr.GetReplicationVaultRegions.Invoke();
    
        var defaultInteger = new Random.Index.Integer("default", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var defaultVault = new AliCloud.Hbr.Vault("default", new()
        {
            VaultName = $"terraform-example-{defaultInteger.Result}",
        });
    
        var defaultReplicationVault = new AliCloud.Hbr.ReplicationVault("default", new()
        {
            ReplicationSourceRegionId = sourceRegion,
            ReplicationSourceVaultId = defaultVault.Id,
            VaultName = "terraform-example",
            VaultStorageClass = "STANDARD",
            Description = "terraform-example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.hbr.HbrFunctions;
    import com.pulumi.alicloud.hbr.inputs.GetReplicationVaultRegionsArgs;
    import com.pulumi.random.integer;
    import com.pulumi.random.IntegerArgs;
    import com.pulumi.alicloud.hbr.Vault;
    import com.pulumi.alicloud.hbr.VaultArgs;
    import com.pulumi.alicloud.hbr.ReplicationVault;
    import com.pulumi.alicloud.hbr.ReplicationVaultArgs;
    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 sourceRegion = config.get("sourceRegion").orElse("cn-hangzhou");
            final var default = HbrFunctions.getReplicationVaultRegions();
    
            var defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
                .min(10000)
                .max(99999)
                .build());
    
            var defaultVault = new Vault("defaultVault", VaultArgs.builder()
                .vaultName(String.format("terraform-example-%s", defaultInteger.result()))
                .build());
    
            var defaultReplicationVault = new ReplicationVault("defaultReplicationVault", ReplicationVaultArgs.builder()
                .replicationSourceRegionId(sourceRegion)
                .replicationSourceVaultId(defaultVault.id())
                .vaultName("terraform-example")
                .vaultStorageClass("STANDARD")
                .description("terraform-example")
                .build());
    
        }
    }
    
    configuration:
      sourceRegion:
        type: string
        default: cn-hangzhou
    resources:
      defaultInteger:
        type: random:integer
        name: default
        properties:
          min: 10000
          max: 99999
      defaultVault:
        type: alicloud:hbr:Vault
        name: default
        properties:
          vaultName: terraform-example-${defaultInteger.result}
      defaultReplicationVault:
        type: alicloud:hbr:ReplicationVault
        name: default
        properties:
          replicationSourceRegionId: ${sourceRegion}
          replicationSourceVaultId: ${defaultVault.id}
          vaultName: terraform-example
          vaultStorageClass: STANDARD
          description: terraform-example
    variables:
      default:
        fn::invoke:
          Function: alicloud:hbr:getReplicationVaultRegions
          Arguments: {}
    

    Create ReplicationVault Resource

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

    Constructor syntax

    new ReplicationVault(name: string, args: ReplicationVaultArgs, opts?: CustomResourceOptions);
    @overload
    def ReplicationVault(resource_name: str,
                         args: ReplicationVaultArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def ReplicationVault(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         replication_source_region_id: Optional[str] = None,
                         replication_source_vault_id: Optional[str] = None,
                         vault_name: Optional[str] = None,
                         description: Optional[str] = None,
                         vault_storage_class: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var replicationVaultResource = new AliCloud.Hbr.ReplicationVault("replicationVaultResource", new()
    {
        ReplicationSourceRegionId = "string",
        ReplicationSourceVaultId = "string",
        VaultName = "string",
        Description = "string",
        VaultStorageClass = "string",
    });
    
    example, err := hbr.NewReplicationVault(ctx, "replicationVaultResource", &hbr.ReplicationVaultArgs{
    	ReplicationSourceRegionId: pulumi.String("string"),
    	ReplicationSourceVaultId:  pulumi.String("string"),
    	VaultName:                 pulumi.String("string"),
    	Description:               pulumi.String("string"),
    	VaultStorageClass:         pulumi.String("string"),
    })
    
    var replicationVaultResource = new ReplicationVault("replicationVaultResource", ReplicationVaultArgs.builder()
        .replicationSourceRegionId("string")
        .replicationSourceVaultId("string")
        .vaultName("string")
        .description("string")
        .vaultStorageClass("string")
        .build());
    
    replication_vault_resource = alicloud.hbr.ReplicationVault("replicationVaultResource",
        replication_source_region_id="string",
        replication_source_vault_id="string",
        vault_name="string",
        description="string",
        vault_storage_class="string")
    
    const replicationVaultResource = new alicloud.hbr.ReplicationVault("replicationVaultResource", {
        replicationSourceRegionId: "string",
        replicationSourceVaultId: "string",
        vaultName: "string",
        description: "string",
        vaultStorageClass: "string",
    });
    
    type: alicloud:hbr:ReplicationVault
    properties:
        description: string
        replicationSourceRegionId: string
        replicationSourceVaultId: string
        vaultName: string
        vaultStorageClass: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    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 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>
    

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi