alicloud.drds.PolardbxInstance
Explore with Pulumi AI
Provides a DRDS Polardb X Instance resource.
For information about DRDS Polardb X Instance and how to use it, see What is Polardb X Instance.
NOTE: Available since v1.211.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") || "terraform-example";
const default = alicloud.getZones({
availableResourceCreation: "VSwitch",
});
const example = new alicloud.vpc.Network("example", {vpcName: name});
const exampleSwitch = new alicloud.vpc.Switch("example", {
vpcId: example.id,
zoneId: _default.then(_default => _default.zones?.[0]?.id),
cidrBlock: "172.16.0.0/24",
vswitchName: name,
});
const defaultPolardbxInstance = new alicloud.drds.PolardbxInstance("default", {
topologyType: "3azones",
vswitchId: exampleSwitch.id,
primaryZone: "ap-southeast-1a",
cnNodeCount: 2,
dnClass: "mysql.n4.medium.25",
cnClass: "polarx.x4.medium.2e",
dnNodeCount: 2,
secondaryZone: "ap-southeast-1b",
tertiaryZone: "ap-southeast-1c",
vpcId: example.id,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.get_zones(available_resource_creation="VSwitch")
example = alicloud.vpc.Network("example", vpc_name=name)
example_switch = alicloud.vpc.Switch("example",
vpc_id=example.id,
zone_id=default.zones[0].id,
cidr_block="172.16.0.0/24",
vswitch_name=name)
default_polardbx_instance = alicloud.drds.PolardbxInstance("default",
topology_type="3azones",
vswitch_id=example_switch.id,
primary_zone="ap-southeast-1a",
cn_node_count=2,
dn_class="mysql.n4.medium.25",
cn_class="polarx.x4.medium.2e",
dn_node_count=2,
secondary_zone="ap-southeast-1b",
tertiary_zone="ap-southeast-1c",
vpc_id=example.id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/drds"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"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 := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
AvailableResourceCreation: pulumi.StringRef("VSwitch"),
}, nil)
if err != nil {
return err
}
example, err := vpc.NewNetwork(ctx, "example", &vpc.NetworkArgs{
VpcName: pulumi.String(name),
})
if err != nil {
return err
}
exampleSwitch, err := vpc.NewSwitch(ctx, "example", &vpc.SwitchArgs{
VpcId: example.ID(),
ZoneId: pulumi.String(_default.Zones[0].Id),
CidrBlock: pulumi.String("172.16.0.0/24"),
VswitchName: pulumi.String(name),
})
if err != nil {
return err
}
_, err = drds.NewPolardbxInstance(ctx, "default", &drds.PolardbxInstanceArgs{
TopologyType: pulumi.String("3azones"),
VswitchId: exampleSwitch.ID(),
PrimaryZone: pulumi.String("ap-southeast-1a"),
CnNodeCount: pulumi.Int(2),
DnClass: pulumi.String("mysql.n4.medium.25"),
CnClass: pulumi.String("polarx.x4.medium.2e"),
DnNodeCount: pulumi.Int(2),
SecondaryZone: pulumi.String("ap-southeast-1b"),
TertiaryZone: pulumi.String("ap-southeast-1c"),
VpcId: example.ID(),
})
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") ?? "terraform-example";
var @default = AliCloud.GetZones.Invoke(new()
{
AvailableResourceCreation = "VSwitch",
});
var example = new AliCloud.Vpc.Network("example", new()
{
VpcName = name,
});
var exampleSwitch = new AliCloud.Vpc.Switch("example", new()
{
VpcId = example.Id,
ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
CidrBlock = "172.16.0.0/24",
VswitchName = name,
});
var defaultPolardbxInstance = new AliCloud.Drds.PolardbxInstance("default", new()
{
TopologyType = "3azones",
VswitchId = exampleSwitch.Id,
PrimaryZone = "ap-southeast-1a",
CnNodeCount = 2,
DnClass = "mysql.n4.medium.25",
CnClass = "polarx.x4.medium.2e",
DnNodeCount = 2,
SecondaryZone = "ap-southeast-1b",
TertiaryZone = "ap-southeast-1c",
VpcId = example.Id,
});
});
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.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.drds.PolardbxInstance;
import com.pulumi.alicloud.drds.PolardbxInstanceArgs;
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("terraform-example");
final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var example = new Network("example", NetworkArgs.builder()
.vpcName(name)
.build());
var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
.vpcId(example.id())
.zoneId(default_.zones()[0].id())
.cidrBlock("172.16.0.0/24")
.vswitchName(name)
.build());
var defaultPolardbxInstance = new PolardbxInstance("defaultPolardbxInstance", PolardbxInstanceArgs.builder()
.topologyType("3azones")
.vswitchId(exampleSwitch.id())
.primaryZone("ap-southeast-1a")
.cnNodeCount("2")
.dnClass("mysql.n4.medium.25")
.cnClass("polarx.x4.medium.2e")
.dnNodeCount("2")
.secondaryZone("ap-southeast-1b")
.tertiaryZone("ap-southeast-1c")
.vpcId(example.id())
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
example:
type: alicloud:vpc:Network
properties:
vpcName: ${name}
exampleSwitch:
type: alicloud:vpc:Switch
name: example
properties:
vpcId: ${example.id}
zoneId: ${default.zones[0].id}
cidrBlock: 172.16.0.0/24
vswitchName: ${name}
defaultPolardbxInstance:
type: alicloud:drds:PolardbxInstance
name: default
properties:
topologyType: 3azones
vswitchId: ${exampleSwitch.id}
primaryZone: ap-southeast-1a
cnNodeCount: '2'
dnClass: mysql.n4.medium.25
cnClass: polarx.x4.medium.2e
dnNodeCount: '2'
secondaryZone: ap-southeast-1b
tertiaryZone: ap-southeast-1c
vpcId: ${example.id}
variables:
default:
fn::invoke:
Function: alicloud:getZones
Arguments:
availableResourceCreation: VSwitch
Create PolardbxInstance Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PolardbxInstance(name: string, args: PolardbxInstanceArgs, opts?: CustomResourceOptions);
@overload
def PolardbxInstance(resource_name: str,
args: PolardbxInstanceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PolardbxInstance(resource_name: str,
opts: Optional[ResourceOptions] = None,
cn_class: Optional[str] = None,
cn_node_count: Optional[int] = None,
dn_class: Optional[str] = None,
dn_node_count: Optional[int] = None,
primary_zone: Optional[str] = None,
topology_type: Optional[str] = None,
vpc_id: Optional[str] = None,
vswitch_id: Optional[str] = None,
resource_group_id: Optional[str] = None,
secondary_zone: Optional[str] = None,
tertiary_zone: Optional[str] = None)
func NewPolardbxInstance(ctx *Context, name string, args PolardbxInstanceArgs, opts ...ResourceOption) (*PolardbxInstance, error)
public PolardbxInstance(string name, PolardbxInstanceArgs args, CustomResourceOptions? opts = null)
public PolardbxInstance(String name, PolardbxInstanceArgs args)
public PolardbxInstance(String name, PolardbxInstanceArgs args, CustomResourceOptions options)
type: alicloud:drds:PolardbxInstance
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 PolardbxInstanceArgs
- 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 PolardbxInstanceArgs
- 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 PolardbxInstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolardbxInstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PolardbxInstanceArgs
- 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 polardbxInstanceResource = new AliCloud.Drds.PolardbxInstance("polardbxInstanceResource", new()
{
CnClass = "string",
CnNodeCount = 0,
DnClass = "string",
DnNodeCount = 0,
PrimaryZone = "string",
TopologyType = "string",
VpcId = "string",
VswitchId = "string",
ResourceGroupId = "string",
SecondaryZone = "string",
TertiaryZone = "string",
});
example, err := drds.NewPolardbxInstance(ctx, "polardbxInstanceResource", &drds.PolardbxInstanceArgs{
CnClass: pulumi.String("string"),
CnNodeCount: pulumi.Int(0),
DnClass: pulumi.String("string"),
DnNodeCount: pulumi.Int(0),
PrimaryZone: pulumi.String("string"),
TopologyType: pulumi.String("string"),
VpcId: pulumi.String("string"),
VswitchId: pulumi.String("string"),
ResourceGroupId: pulumi.String("string"),
SecondaryZone: pulumi.String("string"),
TertiaryZone: pulumi.String("string"),
})
var polardbxInstanceResource = new PolardbxInstance("polardbxInstanceResource", PolardbxInstanceArgs.builder()
.cnClass("string")
.cnNodeCount(0)
.dnClass("string")
.dnNodeCount(0)
.primaryZone("string")
.topologyType("string")
.vpcId("string")
.vswitchId("string")
.resourceGroupId("string")
.secondaryZone("string")
.tertiaryZone("string")
.build());
polardbx_instance_resource = alicloud.drds.PolardbxInstance("polardbxInstanceResource",
cn_class="string",
cn_node_count=0,
dn_class="string",
dn_node_count=0,
primary_zone="string",
topology_type="string",
vpc_id="string",
vswitch_id="string",
resource_group_id="string",
secondary_zone="string",
tertiary_zone="string")
const polardbxInstanceResource = new alicloud.drds.PolardbxInstance("polardbxInstanceResource", {
cnClass: "string",
cnNodeCount: 0,
dnClass: "string",
dnNodeCount: 0,
primaryZone: "string",
topologyType: "string",
vpcId: "string",
vswitchId: "string",
resourceGroupId: "string",
secondaryZone: "string",
tertiaryZone: "string",
});
type: alicloud:drds:PolardbxInstance
properties:
cnClass: string
cnNodeCount: 0
dnClass: string
dnNodeCount: 0
primaryZone: string
resourceGroupId: string
secondaryZone: string
tertiaryZone: string
topologyType: string
vpcId: string
vswitchId: string
PolardbxInstance 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 PolardbxInstance resource accepts the following input properties:
- Cn
Class string - Compute node specifications.
- Cn
Node intCount - Number of computing nodes.
- Dn
Class string - Storage node specifications.
- Dn
Node intCount - The number of storage nodes.
- Primary
Zone string - Primary Availability Zone.
- Topology
Type string - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- Vpc
Id string - The VPC ID.
- Vswitch
Id string - The ID of the virtual switch.
- Resource
Group stringId - The resource group ID can be empty. This parameter is not supported for the time being.
- Secondary
Zone string - Secondary availability zone.
- Tertiary
Zone string - Third Availability Zone.
- Cn
Class string - Compute node specifications.
- Cn
Node intCount - Number of computing nodes.
- Dn
Class string - Storage node specifications.
- Dn
Node intCount - The number of storage nodes.
- Primary
Zone string - Primary Availability Zone.
- Topology
Type string - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- Vpc
Id string - The VPC ID.
- Vswitch
Id string - The ID of the virtual switch.
- Resource
Group stringId - The resource group ID can be empty. This parameter is not supported for the time being.
- Secondary
Zone string - Secondary availability zone.
- Tertiary
Zone string - Third Availability Zone.
- cn
Class String - Compute node specifications.
- cn
Node IntegerCount - Number of computing nodes.
- dn
Class String - Storage node specifications.
- dn
Node IntegerCount - The number of storage nodes.
- primary
Zone String - Primary Availability Zone.
- topology
Type String - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- vpc
Id String - The VPC ID.
- vswitch
Id String - The ID of the virtual switch.
- resource
Group StringId - The resource group ID can be empty. This parameter is not supported for the time being.
- secondary
Zone String - Secondary availability zone.
- tertiary
Zone String - Third Availability Zone.
- cn
Class string - Compute node specifications.
- cn
Node numberCount - Number of computing nodes.
- dn
Class string - Storage node specifications.
- dn
Node numberCount - The number of storage nodes.
- primary
Zone string - Primary Availability Zone.
- topology
Type string - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- vpc
Id string - The VPC ID.
- vswitch
Id string - The ID of the virtual switch.
- resource
Group stringId - The resource group ID can be empty. This parameter is not supported for the time being.
- secondary
Zone string - Secondary availability zone.
- tertiary
Zone string - Third Availability Zone.
- cn_
class str - Compute node specifications.
- cn_
node_ intcount - Number of computing nodes.
- dn_
class str - Storage node specifications.
- dn_
node_ intcount - The number of storage nodes.
- primary_
zone str - Primary Availability Zone.
- topology_
type str - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- vpc_
id str - The VPC ID.
- vswitch_
id str - The ID of the virtual switch.
- resource_
group_ strid - The resource group ID can be empty. This parameter is not supported for the time being.
- secondary_
zone str - Secondary availability zone.
- tertiary_
zone str - Third Availability Zone.
- cn
Class String - Compute node specifications.
- cn
Node NumberCount - Number of computing nodes.
- dn
Class String - Storage node specifications.
- dn
Node NumberCount - The number of storage nodes.
- primary
Zone String - Primary Availability Zone.
- topology
Type String - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- vpc
Id String - The VPC ID.
- vswitch
Id String - The ID of the virtual switch.
- resource
Group StringId - The resource group ID can be empty. This parameter is not supported for the time being.
- secondary
Zone String - Secondary availability zone.
- tertiary
Zone String - Third Availability Zone.
Outputs
All input properties are implicitly available as output properties. Additionally, the PolardbxInstance resource produces the following output properties:
- Create
Time string - The creation time of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of the resource.
- Create
Time string - The creation time of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of the resource.
- create
Time String - The creation time of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The status of the resource.
- create
Time string - The creation time of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- The status of the resource.
- create_
time str - The creation time of the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- The status of the resource.
- create
Time String - The creation time of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The status of the resource.
Look up Existing PolardbxInstance Resource
Get an existing PolardbxInstance 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?: PolardbxInstanceState, opts?: CustomResourceOptions): PolardbxInstance
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cn_class: Optional[str] = None,
cn_node_count: Optional[int] = None,
create_time: Optional[str] = None,
dn_class: Optional[str] = None,
dn_node_count: Optional[int] = None,
primary_zone: Optional[str] = None,
resource_group_id: Optional[str] = None,
secondary_zone: Optional[str] = None,
status: Optional[str] = None,
tertiary_zone: Optional[str] = None,
topology_type: Optional[str] = None,
vpc_id: Optional[str] = None,
vswitch_id: Optional[str] = None) -> PolardbxInstance
func GetPolardbxInstance(ctx *Context, name string, id IDInput, state *PolardbxInstanceState, opts ...ResourceOption) (*PolardbxInstance, error)
public static PolardbxInstance Get(string name, Input<string> id, PolardbxInstanceState? state, CustomResourceOptions? opts = null)
public static PolardbxInstance get(String name, Output<String> id, PolardbxInstanceState 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.
- Cn
Class string - Compute node specifications.
- Cn
Node intCount - Number of computing nodes.
- Create
Time string - The creation time of the resource.
- Dn
Class string - Storage node specifications.
- Dn
Node intCount - The number of storage nodes.
- Primary
Zone string - Primary Availability Zone.
- Resource
Group stringId - The resource group ID can be empty. This parameter is not supported for the time being.
- Secondary
Zone string - Secondary availability zone.
- Status string
- The status of the resource.
- Tertiary
Zone string - Third Availability Zone.
- Topology
Type string - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- Vpc
Id string - The VPC ID.
- Vswitch
Id string - The ID of the virtual switch.
- Cn
Class string - Compute node specifications.
- Cn
Node intCount - Number of computing nodes.
- Create
Time string - The creation time of the resource.
- Dn
Class string - Storage node specifications.
- Dn
Node intCount - The number of storage nodes.
- Primary
Zone string - Primary Availability Zone.
- Resource
Group stringId - The resource group ID can be empty. This parameter is not supported for the time being.
- Secondary
Zone string - Secondary availability zone.
- Status string
- The status of the resource.
- Tertiary
Zone string - Third Availability Zone.
- Topology
Type string - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- Vpc
Id string - The VPC ID.
- Vswitch
Id string - The ID of the virtual switch.
- cn
Class String - Compute node specifications.
- cn
Node IntegerCount - Number of computing nodes.
- create
Time String - The creation time of the resource.
- dn
Class String - Storage node specifications.
- dn
Node IntegerCount - The number of storage nodes.
- primary
Zone String - Primary Availability Zone.
- resource
Group StringId - The resource group ID can be empty. This parameter is not supported for the time being.
- secondary
Zone String - Secondary availability zone.
- status String
- The status of the resource.
- tertiary
Zone String - Third Availability Zone.
- topology
Type String - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- vpc
Id String - The VPC ID.
- vswitch
Id String - The ID of the virtual switch.
- cn
Class string - Compute node specifications.
- cn
Node numberCount - Number of computing nodes.
- create
Time string - The creation time of the resource.
- dn
Class string - Storage node specifications.
- dn
Node numberCount - The number of storage nodes.
- primary
Zone string - Primary Availability Zone.
- resource
Group stringId - The resource group ID can be empty. This parameter is not supported for the time being.
- secondary
Zone string - Secondary availability zone.
- status string
- The status of the resource.
- tertiary
Zone string - Third Availability Zone.
- topology
Type string - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- vpc
Id string - The VPC ID.
- vswitch
Id string - The ID of the virtual switch.
- cn_
class str - Compute node specifications.
- cn_
node_ intcount - Number of computing nodes.
- create_
time str - The creation time of the resource.
- dn_
class str - Storage node specifications.
- dn_
node_ intcount - The number of storage nodes.
- primary_
zone str - Primary Availability Zone.
- resource_
group_ strid - The resource group ID can be empty. This parameter is not supported for the time being.
- secondary_
zone str - Secondary availability zone.
- status str
- The status of the resource.
- tertiary_
zone str - Third Availability Zone.
- topology_
type str - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- vpc_
id str - The VPC ID.
- vswitch_
id str - The ID of the virtual switch.
- cn
Class String - Compute node specifications.
- cn
Node NumberCount - Number of computing nodes.
- create
Time String - The creation time of the resource.
- dn
Class String - Storage node specifications.
- dn
Node NumberCount - The number of storage nodes.
- primary
Zone String - Primary Availability Zone.
- resource
Group StringId - The resource group ID can be empty. This parameter is not supported for the time being.
- secondary
Zone String - Secondary availability zone.
- status String
- The status of the resource.
- tertiary
Zone String - Third Availability Zone.
- topology
Type String - Topology type:
- 3azones: three available areas;
- 1azone: Single zone.
- vpc
Id String - The VPC ID.
- vswitch
Id String - The ID of the virtual switch.
Import
DRDS Polardb X Instance can be imported using the id, e.g.
$ pulumi import alicloud:drds/polardbxInstance:PolardbxInstance 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.