alicloud logo
Alibaba Cloud v3.29.0, Jan 20 23

alicloud.ebs.DiskReplicaGroup

Provides a EBS Disk Replica Group resource.

For information about EBS Disk Replica Group and how to use it, see What is Disk Replica Group.

NOTE: Available in v1.187.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var defaultRegions = AliCloud.Ebs.GetRegions.Invoke(new()
    {
        RegionId = "cn-hangzhou",
    });

    var defaultDiskReplicaGroup = new AliCloud.Ebs.DiskReplicaGroup("defaultDiskReplicaGroup", new()
    {
        SourceRegionId = @var.Region,
        SourceZoneId = defaultRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Zones[0]?.ZoneId),
        DestinationRegionId = @var.Region,
        DestinationZoneId = defaultRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Zones[1]?.ZoneId),
        GroupName = "group_name",
        Description = "group_description",
        Rpo = 900,
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ebs"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultRegions, err := ebs.GetRegions(ctx, &ebs.GetRegionsArgs{
			RegionId: pulumi.StringRef("cn-hangzhou"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = ebs.NewDiskReplicaGroup(ctx, "defaultDiskReplicaGroup", &ebs.DiskReplicaGroupArgs{
			SourceRegionId:      pulumi.Any(_var.Region),
			SourceZoneId:        *pulumi.String(defaultRegions.Regions[0].Zones[0].ZoneId),
			DestinationRegionId: pulumi.Any(_var.Region),
			DestinationZoneId:   *pulumi.String(defaultRegions.Regions[0].Zones[1].ZoneId),
			GroupName:           pulumi.String("group_name"),
			Description:         pulumi.String("group_description"),
			Rpo:                 pulumi.Int(900),
		})
		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.ebs.EbsFunctions;
import com.pulumi.alicloud.ebs.inputs.GetRegionsArgs;
import com.pulumi.alicloud.ebs.DiskReplicaGroup;
import com.pulumi.alicloud.ebs.DiskReplicaGroupArgs;
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 defaultRegions = EbsFunctions.getRegions(GetRegionsArgs.builder()
            .regionId("cn-hangzhou")
            .build());

        var defaultDiskReplicaGroup = new DiskReplicaGroup("defaultDiskReplicaGroup", DiskReplicaGroupArgs.builder()        
            .sourceRegionId(var_.region())
            .sourceZoneId(defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].zones()[0].zoneId()))
            .destinationRegionId(var_.region())
            .destinationZoneId(defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].zones()[1].zoneId()))
            .groupName("group_name")
            .description("group_description")
            .rpo(900)
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_regions = alicloud.ebs.get_regions(region_id="cn-hangzhou")
default_disk_replica_group = alicloud.ebs.DiskReplicaGroup("defaultDiskReplicaGroup",
    source_region_id=var["region"],
    source_zone_id=default_regions.regions[0].zones[0].zone_id,
    destination_region_id=var["region"],
    destination_zone_id=default_regions.regions[0].zones[1].zone_id,
    group_name="group_name",
    description="group_description",
    rpo=900)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultRegions = alicloud.ebs.getRegions({
    regionId: "cn-hangzhou",
});
const defaultDiskReplicaGroup = new alicloud.ebs.DiskReplicaGroup("defaultDiskReplicaGroup", {
    sourceRegionId: _var.region,
    sourceZoneId: defaultRegions.then(defaultRegions => defaultRegions.regions?.[0]?.zones?.[0]?.zoneId),
    destinationRegionId: _var.region,
    destinationZoneId: defaultRegions.then(defaultRegions => defaultRegions.regions?.[0]?.zones?.[1]?.zoneId),
    groupName: "group_name",
    description: "group_description",
    rpo: 900,
});
resources:
  defaultDiskReplicaGroup:
    type: alicloud:ebs:DiskReplicaGroup
    properties:
      sourceRegionId: ${var.region}
      sourceZoneId: ${defaultRegions.regions[0].zones[0].zoneId}
      destinationRegionId: ${var.region}
      destinationZoneId: ${defaultRegions.regions[0].zones[1].zoneId}
      groupName: group_name
      description: group_description
      rpo: 900
variables:
  defaultRegions:
    fn::invoke:
      Function: alicloud:ebs:getRegions
      Arguments:
        regionId: cn-hangzhou

Create DiskReplicaGroup Resource

new DiskReplicaGroup(name: string, args: DiskReplicaGroupArgs, opts?: CustomResourceOptions);
@overload
def DiskReplicaGroup(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     description: Optional[str] = None,
                     destination_region_id: Optional[str] = None,
                     destination_zone_id: Optional[str] = None,
                     group_name: Optional[str] = None,
                     rpo: Optional[int] = None,
                     source_region_id: Optional[str] = None,
                     source_zone_id: Optional[str] = None)
@overload
def DiskReplicaGroup(resource_name: str,
                     args: DiskReplicaGroupArgs,
                     opts: Optional[ResourceOptions] = None)
func NewDiskReplicaGroup(ctx *Context, name string, args DiskReplicaGroupArgs, opts ...ResourceOption) (*DiskReplicaGroup, error)
public DiskReplicaGroup(string name, DiskReplicaGroupArgs args, CustomResourceOptions? opts = null)
public DiskReplicaGroup(String name, DiskReplicaGroupArgs args)
public DiskReplicaGroup(String name, DiskReplicaGroupArgs args, CustomResourceOptions options)
type: alicloud:ebs:DiskReplicaGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

DestinationRegionId string

The ID of the region to which the disaster recovery site belongs.

DestinationZoneId string

The ID of the zone to which the disaster recovery site belongs.

SourceRegionId string

The ID of the region to which the production site belongs.

SourceZoneId string

The ID of the zone to which the production site belongs.

Description string

The description of the consistent replication group.

GroupName string

Consistent replication group name.

Rpo int

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

DestinationRegionId string

The ID of the region to which the disaster recovery site belongs.

DestinationZoneId string

The ID of the zone to which the disaster recovery site belongs.

SourceRegionId string

The ID of the region to which the production site belongs.

SourceZoneId string

The ID of the zone to which the production site belongs.

Description string

The description of the consistent replication group.

GroupName string

Consistent replication group name.

Rpo int

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

destinationRegionId String

The ID of the region to which the disaster recovery site belongs.

destinationZoneId String

The ID of the zone to which the disaster recovery site belongs.

sourceRegionId String

The ID of the region to which the production site belongs.

sourceZoneId String

The ID of the zone to which the production site belongs.

description String

The description of the consistent replication group.

groupName String

Consistent replication group name.

rpo Integer

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

destinationRegionId string

The ID of the region to which the disaster recovery site belongs.

destinationZoneId string

The ID of the zone to which the disaster recovery site belongs.

sourceRegionId string

The ID of the region to which the production site belongs.

sourceZoneId string

The ID of the zone to which the production site belongs.

description string

The description of the consistent replication group.

groupName string

Consistent replication group name.

rpo number

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

destination_region_id str

The ID of the region to which the disaster recovery site belongs.

destination_zone_id str

The ID of the zone to which the disaster recovery site belongs.

source_region_id str

The ID of the region to which the production site belongs.

source_zone_id str

The ID of the zone to which the production site belongs.

description str

The description of the consistent replication group.

group_name str

Consistent replication group name.

rpo int

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

destinationRegionId String

The ID of the region to which the disaster recovery site belongs.

destinationZoneId String

The ID of the zone to which the disaster recovery site belongs.

sourceRegionId String

The ID of the region to which the production site belongs.

sourceZoneId String

The ID of the zone to which the production site belongs.

description String

The description of the consistent replication group.

groupName String

Consistent replication group name.

rpo Number

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the consistent replication group.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The status of the consistent replication group.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the consistent replication group.

id string

The provider-assigned unique ID for this managed resource.

status string

The status of the consistent replication group.

id str

The provider-assigned unique ID for this managed resource.

status str

The status of the consistent replication group.

id String

The provider-assigned unique ID for this managed resource.

status String

The status of the consistent replication group.

Look up Existing DiskReplicaGroup Resource

Get an existing DiskReplicaGroup 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?: DiskReplicaGroupState, opts?: CustomResourceOptions): DiskReplicaGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        destination_region_id: Optional[str] = None,
        destination_zone_id: Optional[str] = None,
        group_name: Optional[str] = None,
        rpo: Optional[int] = None,
        source_region_id: Optional[str] = None,
        source_zone_id: Optional[str] = None,
        status: Optional[str] = None) -> DiskReplicaGroup
func GetDiskReplicaGroup(ctx *Context, name string, id IDInput, state *DiskReplicaGroupState, opts ...ResourceOption) (*DiskReplicaGroup, error)
public static DiskReplicaGroup Get(string name, Input<string> id, DiskReplicaGroupState? state, CustomResourceOptions? opts = null)
public static DiskReplicaGroup get(String name, Output<String> id, DiskReplicaGroupState 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 consistent replication group.

DestinationRegionId string

The ID of the region to which the disaster recovery site belongs.

DestinationZoneId string

The ID of the zone to which the disaster recovery site belongs.

GroupName string

Consistent replication group name.

Rpo int

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

SourceRegionId string

The ID of the region to which the production site belongs.

SourceZoneId string

The ID of the zone to which the production site belongs.

Status string

The status of the consistent replication group.

Description string

The description of the consistent replication group.

DestinationRegionId string

The ID of the region to which the disaster recovery site belongs.

DestinationZoneId string

The ID of the zone to which the disaster recovery site belongs.

GroupName string

Consistent replication group name.

Rpo int

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

SourceRegionId string

The ID of the region to which the production site belongs.

SourceZoneId string

The ID of the zone to which the production site belongs.

Status string

The status of the consistent replication group.

description String

The description of the consistent replication group.

destinationRegionId String

The ID of the region to which the disaster recovery site belongs.

destinationZoneId String

The ID of the zone to which the disaster recovery site belongs.

groupName String

Consistent replication group name.

rpo Integer

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

sourceRegionId String

The ID of the region to which the production site belongs.

sourceZoneId String

The ID of the zone to which the production site belongs.

status String

The status of the consistent replication group.

description string

The description of the consistent replication group.

destinationRegionId string

The ID of the region to which the disaster recovery site belongs.

destinationZoneId string

The ID of the zone to which the disaster recovery site belongs.

groupName string

Consistent replication group name.

rpo number

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

sourceRegionId string

The ID of the region to which the production site belongs.

sourceZoneId string

The ID of the zone to which the production site belongs.

status string

The status of the consistent replication group.

description str

The description of the consistent replication group.

destination_region_id str

The ID of the region to which the disaster recovery site belongs.

destination_zone_id str

The ID of the zone to which the disaster recovery site belongs.

group_name str

Consistent replication group name.

rpo int

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

source_region_id str

The ID of the region to which the production site belongs.

source_zone_id str

The ID of the zone to which the production site belongs.

status str

The status of the consistent replication group.

description String

The description of the consistent replication group.

destinationRegionId String

The ID of the region to which the disaster recovery site belongs.

destinationZoneId String

The ID of the zone to which the disaster recovery site belongs.

groupName String

Consistent replication group name.

rpo Number

The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.

sourceRegionId String

The ID of the region to which the production site belongs.

sourceZoneId String

The ID of the zone to which the production site belongs.

status String

The status of the consistent replication group.

Import

EBS Disk Replica Group can be imported using the id, e.g.

 $ pulumi import alicloud:ebs/diskReplicaGroup:DiskReplicaGroup example <id>

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.