alicloud.hbr.ReplicationVault
Explore with Pulumi AI
Provides a Hybrid Backup Recovery (HBR) Replication Vault resource.
The replication vault used by the cross-region backup function of Cloud Backup.
For information about Hybrid Backup Recovery (HBR) Replication Vault and how to use it, see What is Replication Vault.
NOTE: Available since v1.252.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(GetReplicationVaultRegionsArgs.builder()
.build());
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,
encrypt_type: Optional[str] = None,
kms_key_id: 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",
EncryptType = "string",
KmsKeyId = "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"),
EncryptType: pulumi.String("string"),
KmsKeyId: pulumi.String("string"),
VaultStorageClass: pulumi.String("string"),
})
var replicationVaultResource = new ReplicationVault("replicationVaultResource", ReplicationVaultArgs.builder()
.replicationSourceRegionId("string")
.replicationSourceVaultId("string")
.vaultName("string")
.description("string")
.encryptType("string")
.kmsKeyId("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",
encrypt_type="string",
kms_key_id="string",
vault_storage_class="string")
const replicationVaultResource = new alicloud.hbr.ReplicationVault("replicationVaultResource", {
replicationSourceRegionId: "string",
replicationSourceVaultId: "string",
vaultName: "string",
description: "string",
encryptType: "string",
kmsKeyId: "string",
vaultStorageClass: "string",
});
type: alicloud:hbr:ReplicationVault
properties:
description: string
encryptType: string
kmsKeyId: 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:
- Replication
Source stringRegion Id - The region ID of the source backup vault.
- Replication
Source stringVault Id - The vault ID of the source backup vault.
- Vault
Name string - The name of the backup vault.
- Description string
- The description of the backup vault.
- Encrypt
Type string - The encryption type of the backup vault.
- Kms
Key stringId - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- Vault
Storage stringClass - Backup Vault Storage Class
- Replication
Source stringRegion Id - The region ID of the source backup vault.
- Replication
Source stringVault Id - The vault ID of the source backup vault.
- Vault
Name string - The name of the backup vault.
- Description string
- The description of the backup vault.
- Encrypt
Type string - The encryption type of the backup vault.
- Kms
Key stringId - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- Vault
Storage stringClass - Backup Vault Storage Class
- replication
Source StringRegion Id - The region ID of the source backup vault.
- replication
Source StringVault Id - The vault ID of the source backup vault.
- vault
Name String - The name of the backup vault.
- description String
- The description of the backup vault.
- encrypt
Type String - The encryption type of the backup vault.
- kms
Key StringId - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- vault
Storage StringClass - Backup Vault Storage Class
- replication
Source stringRegion Id - The region ID of the source backup vault.
- replication
Source stringVault Id - The vault ID of the source backup vault.
- vault
Name string - The name of the backup vault.
- description string
- The description of the backup vault.
- encrypt
Type string - The encryption type of the backup vault.
- kms
Key stringId - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- vault
Storage stringClass - Backup Vault Storage Class
- replication_
source_ strregion_ id - The region ID of the source backup vault.
- replication_
source_ strvault_ id - The vault ID of the source backup vault.
- vault_
name str - The name of the backup vault.
- description str
- The description of the backup vault.
- encrypt_
type str - The encryption type of the backup vault.
- kms_
key_ strid - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- vault_
storage_ strclass - Backup Vault Storage Class
- replication
Source StringRegion Id - The region ID of the source backup vault.
- replication
Source StringVault Id - The vault ID of the source backup vault.
- vault
Name String - The name of the backup vault.
- description String
- The description of the backup vault.
- encrypt
Type String - The encryption type of the backup vault.
- kms
Key StringId - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- vault
Storage StringClass - Backup Vault Storage Class
Outputs
All input properties are implicitly available as output properties. Additionally, the ReplicationVault resource produces the following output properties:
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,
encrypt_type: Optional[str] = None,
kms_key_id: Optional[str] = None,
region_id: 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)
resources: _: type: alicloud:hbr:ReplicationVault get: id: ${id}
- 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.
- Description string
- The description of the backup vault.
- Encrypt
Type string - The encryption type of the backup vault.
- Kms
Key stringId - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- Region
Id string - RegionId
- Replication
Source stringRegion Id - The region ID of the source backup vault.
- Replication
Source stringVault Id - The vault ID of the source backup vault.
- Status string
- The status of the mirror backup vault.
- Vault
Name string - The name of the backup vault.
- Vault
Storage stringClass - Backup Vault Storage Class
- Description string
- The description of the backup vault.
- Encrypt
Type string - The encryption type of the backup vault.
- Kms
Key stringId - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- Region
Id string - RegionId
- Replication
Source stringRegion Id - The region ID of the source backup vault.
- Replication
Source stringVault Id - The vault ID of the source backup vault.
- Status string
- The status of the mirror backup vault.
- Vault
Name string - The name of the backup vault.
- Vault
Storage stringClass - Backup Vault Storage Class
- description String
- The description of the backup vault.
- encrypt
Type String - The encryption type of the backup vault.
- kms
Key StringId - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- region
Id String - RegionId
- replication
Source StringRegion Id - The region ID of the source backup vault.
- replication
Source StringVault Id - The vault ID of the source backup vault.
- status String
- The status of the mirror backup vault.
- vault
Name String - The name of the backup vault.
- vault
Storage StringClass - Backup Vault Storage Class
- description string
- The description of the backup vault.
- encrypt
Type string - The encryption type of the backup vault.
- kms
Key stringId - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- region
Id string - RegionId
- replication
Source stringRegion Id - The region ID of the source backup vault.
- replication
Source stringVault Id - The vault ID of the source backup vault.
- status string
- The status of the mirror backup vault.
- vault
Name string - The name of the backup vault.
- vault
Storage stringClass - Backup Vault Storage Class
- description str
- The description of the backup vault.
- encrypt_
type str - The encryption type of the backup vault.
- kms_
key_ strid - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- region_
id str - RegionId
- replication_
source_ strregion_ id - The region ID of the source backup vault.
- replication_
source_ strvault_ id - The vault ID of the source backup vault.
- status str
- The status of the mirror backup vault.
- vault_
name str - The name of the backup vault.
- vault_
storage_ strclass - Backup Vault Storage Class
- description String
- The description of the backup vault.
- encrypt
Type String - The encryption type of the backup vault.
- kms
Key StringId - Alibaba Cloud KMS custom Key or Alias. This parameter is required only when EncryptType = KMS.
- region
Id String - RegionId
- replication
Source StringRegion Id - The region ID of the source backup vault.
- replication
Source StringVault Id - The vault ID of the source backup vault.
- status String
- The status of the mirror backup vault.
- vault
Name String - The name of the backup vault.
- vault
Storage StringClass - Backup Vault Storage Class
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.