alicloud.ebs.DiskReplicaGroup
Explore with Pulumi AI
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 since v1.187.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tf-example";
const default = alicloud.getRegions({
current: true,
});
const defaultGetRegions = _default.then(_default => alicloud.ebs.getRegions({
regionId: _default.regions?.[0]?.id,
}));
const defaultDiskReplicaGroup = new alicloud.ebs.DiskReplicaGroup("default", {
sourceRegionId: _default.then(_default => _default.regions?.[0]?.id),
sourceZoneId: defaultGetRegions.then(defaultGetRegions => defaultGetRegions.regions?.[0]?.zones?.[0]?.zoneId),
destinationRegionId: _default.then(_default => _default.regions?.[0]?.id),
destinationZoneId: defaultGetRegions.then(defaultGetRegions => defaultGetRegions.regions?.[0]?.zones?.[1]?.zoneId),
groupName: name,
description: name,
rpo: 900,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tf-example"
default = alicloud.get_regions(current=True)
default_get_regions = alicloud.ebs.get_regions(region_id=default.regions[0].id)
default_disk_replica_group = alicloud.ebs.DiskReplicaGroup("default",
source_region_id=default.regions[0].id,
source_zone_id=default_get_regions.regions[0].zones[0].zone_id,
destination_region_id=default.regions[0].id,
destination_zone_id=default_get_regions.regions[0].zones[1].zone_id,
group_name=name,
description=name,
rpo=900)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ebs"
"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-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
Current: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
defaultGetRegions, err := ebs.GetRegions(ctx, &ebs.GetRegionsArgs{
RegionId: pulumi.StringRef(_default.Regions[0].Id),
}, nil)
if err != nil {
return err
}
_, err = ebs.NewDiskReplicaGroup(ctx, "default", &ebs.DiskReplicaGroupArgs{
SourceRegionId: pulumi.String(_default.Regions[0].Id),
SourceZoneId: pulumi.String(defaultGetRegions.Regions[0].Zones[0].ZoneId),
DestinationRegionId: pulumi.String(_default.Regions[0].Id),
DestinationZoneId: pulumi.String(defaultGetRegions.Regions[0].Zones[1].ZoneId),
GroupName: pulumi.String(name),
Description: pulumi.String(name),
Rpo: pulumi.Int(900),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tf-example";
var @default = AliCloud.GetRegions.Invoke(new()
{
Current = true,
});
var defaultGetRegions = AliCloud.Ebs.GetRegions.Invoke(new()
{
RegionId = @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id),
});
var defaultDiskReplicaGroup = new AliCloud.Ebs.DiskReplicaGroup("default", new()
{
SourceRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
SourceZoneId = defaultGetRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Zones[0]?.ZoneId),
DestinationRegionId = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
DestinationZoneId = defaultGetRegions.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Zones[1]?.ZoneId),
GroupName = name,
Description = name,
Rpo = 900,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetRegionsArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("tf-example");
final var default = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
.current(true)
.build());
final var defaultGetRegions = EbsFunctions.getRegions(GetRegionsArgs.builder()
.regionId(default_.regions()[0].id())
.build());
var defaultDiskReplicaGroup = new DiskReplicaGroup("defaultDiskReplicaGroup", DiskReplicaGroupArgs.builder()
.sourceRegionId(default_.regions()[0].id())
.sourceZoneId(defaultGetRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].zones()[0].zoneId()))
.destinationRegionId(default_.regions()[0].id())
.destinationZoneId(defaultGetRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].zones()[1].zoneId()))
.groupName(name)
.description(name)
.rpo(900)
.build());
}
}
configuration:
name:
type: string
default: tf-example
resources:
defaultDiskReplicaGroup:
type: alicloud:ebs:DiskReplicaGroup
name: default
properties:
sourceRegionId: ${default.regions[0].id}
sourceZoneId: ${defaultGetRegions.regions[0].zones[0].zoneId}
destinationRegionId: ${default.regions[0].id}
destinationZoneId: ${defaultGetRegions.regions[0].zones[1].zoneId}
groupName: ${name}
description: ${name}
rpo: 900
variables:
default:
fn::invoke:
Function: alicloud:getRegions
Arguments:
current: true
defaultGetRegions:
fn::invoke:
Function: alicloud:ebs:getRegions
Arguments:
regionId: ${default.regions[0].id}
Create DiskReplicaGroup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DiskReplicaGroup(name: string, args: DiskReplicaGroupArgs, opts?: CustomResourceOptions);
@overload
def DiskReplicaGroup(resource_name: str,
args: DiskReplicaGroupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DiskReplicaGroup(resource_name: str,
opts: Optional[ResourceOptions] = None,
destination_region_id: Optional[str] = None,
destination_zone_id: Optional[str] = None,
source_region_id: Optional[str] = None,
source_zone_id: Optional[str] = None,
description: Optional[str] = None,
group_name: Optional[str] = None,
rpo: Optional[int] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var diskReplicaGroupResource = new AliCloud.Ebs.DiskReplicaGroup("diskReplicaGroupResource", new()
{
DestinationRegionId = "string",
DestinationZoneId = "string",
SourceRegionId = "string",
SourceZoneId = "string",
Description = "string",
GroupName = "string",
Rpo = 0,
});
example, err := ebs.NewDiskReplicaGroup(ctx, "diskReplicaGroupResource", &ebs.DiskReplicaGroupArgs{
DestinationRegionId: pulumi.String("string"),
DestinationZoneId: pulumi.String("string"),
SourceRegionId: pulumi.String("string"),
SourceZoneId: pulumi.String("string"),
Description: pulumi.String("string"),
GroupName: pulumi.String("string"),
Rpo: pulumi.Int(0),
})
var diskReplicaGroupResource = new DiskReplicaGroup("diskReplicaGroupResource", DiskReplicaGroupArgs.builder()
.destinationRegionId("string")
.destinationZoneId("string")
.sourceRegionId("string")
.sourceZoneId("string")
.description("string")
.groupName("string")
.rpo(0)
.build());
disk_replica_group_resource = alicloud.ebs.DiskReplicaGroup("diskReplicaGroupResource",
destination_region_id="string",
destination_zone_id="string",
source_region_id="string",
source_zone_id="string",
description="string",
group_name="string",
rpo=0)
const diskReplicaGroupResource = new alicloud.ebs.DiskReplicaGroup("diskReplicaGroupResource", {
destinationRegionId: "string",
destinationZoneId: "string",
sourceRegionId: "string",
sourceZoneId: "string",
description: "string",
groupName: "string",
rpo: 0,
});
type: alicloud:ebs:DiskReplicaGroup
properties:
description: string
destinationRegionId: string
destinationZoneId: string
groupName: string
rpo: 0
sourceRegionId: string
sourceZoneId: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The DiskReplicaGroup resource accepts the following input properties:
- Destination
Region stringId - The ID of the region to which the disaster recovery site belongs.
- Destination
Zone stringId - The ID of the zone to which the disaster recovery site belongs.
- Source
Region stringId - The ID of the region to which the production site belongs.
- Source
Zone stringId - The ID of the zone to which the production site belongs.
- Description string
- The description of the consistent replication group.
- Group
Name string - Consistent replication group name.
- Rpo int
- The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.
- Destination
Region stringId - The ID of the region to which the disaster recovery site belongs.
- Destination
Zone stringId - The ID of the zone to which the disaster recovery site belongs.
- Source
Region stringId - The ID of the region to which the production site belongs.
- Source
Zone stringId - The ID of the zone to which the production site belongs.
- Description string
- The description of the consistent replication group.
- Group
Name string - Consistent replication group name.
- Rpo int
- The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.
- destination
Region StringId - The ID of the region to which the disaster recovery site belongs.
- destination
Zone StringId - The ID of the zone to which the disaster recovery site belongs.
- source
Region StringId - The ID of the region to which the production site belongs.
- source
Zone StringId - The ID of the zone to which the production site belongs.
- description String
- The description of the consistent replication group.
- group
Name String - Consistent replication group name.
- rpo Integer
- The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.
- destination
Region stringId - The ID of the region to which the disaster recovery site belongs.
- destination
Zone stringId - The ID of the zone to which the disaster recovery site belongs.
- source
Region stringId - The ID of the region to which the production site belongs.
- source
Zone stringId - The ID of the zone to which the production site belongs.
- description string
- The description of the consistent replication group.
- group
Name string - Consistent replication group name.
- rpo number
- The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.
- destination_
region_ strid - The ID of the region to which the disaster recovery site belongs.
- destination_
zone_ strid - The ID of the zone to which the disaster recovery site belongs.
- source_
region_ strid - The ID of the region to which the production site belongs.
- source_
zone_ strid - 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.
- destination
Region StringId - The ID of the region to which the disaster recovery site belongs.
- destination
Zone StringId - The ID of the zone to which the disaster recovery site belongs.
- source
Region StringId - The ID of the region to which the production site belongs.
- source
Zone StringId - The ID of the zone to which the production site belongs.
- description String
- The description of the consistent replication group.
- group
Name 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:
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.
- Description string
- The description of the consistent replication group.
- Destination
Region stringId - The ID of the region to which the disaster recovery site belongs.
- Destination
Zone stringId - The ID of the zone to which the disaster recovery site belongs.
- Group
Name string - Consistent replication group name.
- Rpo int
- The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.
- Source
Region stringId - The ID of the region to which the production site belongs.
- Source
Zone stringId - 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.
- Destination
Region stringId - The ID of the region to which the disaster recovery site belongs.
- Destination
Zone stringId - The ID of the zone to which the disaster recovery site belongs.
- Group
Name string - Consistent replication group name.
- Rpo int
- The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.
- Source
Region stringId - The ID of the region to which the production site belongs.
- Source
Zone stringId - 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.
- destination
Region StringId - The ID of the region to which the disaster recovery site belongs.
- destination
Zone StringId - The ID of the zone to which the disaster recovery site belongs.
- group
Name String - Consistent replication group name.
- rpo Integer
- The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.
- source
Region StringId - The ID of the region to which the production site belongs.
- source
Zone StringId - 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.
- destination
Region stringId - The ID of the region to which the disaster recovery site belongs.
- destination
Zone stringId - The ID of the zone to which the disaster recovery site belongs.
- group
Name string - Consistent replication group name.
- rpo number
- The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.
- source
Region stringId - The ID of the region to which the production site belongs.
- source
Zone stringId - 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_ strid - The ID of the region to which the disaster recovery site belongs.
- destination_
zone_ strid - 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_ strid - The ID of the region to which the production site belongs.
- source_
zone_ strid - 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.
- destination
Region StringId - The ID of the region to which the disaster recovery site belongs.
- destination
Zone StringId - The ID of the zone to which the disaster recovery site belongs.
- group
Name String - Consistent replication group name.
- rpo Number
- The recovery point objective (RPO) of the replication pair-consistent group. Unit: seconds.
- source
Region StringId - The ID of the region to which the production site belongs.
- source
Zone StringId - 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>
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.