alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.cddc.DedicatedHost

Provides a ApsaraDB for MyBase Dedicated Host resource.

For information about ApsaraDB for MyBase Dedicated Host and how to use it, see What is Dedicated Host.

NOTE: Available in v1.147.0+.

Example Usage

Basic Usage

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

return await Deployment.RunAsync(() => 
{
    var defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
    {
        NameRegex = "default-NODELETING",
    });

    var defaultZones = AliCloud.Cddc.GetZones.Invoke();

    var defaultHostEcsLevelInfos = AliCloud.Cddc.GetHostEcsLevelInfos.Invoke(new()
    {
        DbType = "mysql",
        ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Ids[0]),
        StorageType = "cloud_essd",
    });

    var defaultSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
    {
        VpcId = defaultNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
        ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Ids[0]),
    });

    var defaultDedicatedHostGroup = new AliCloud.Cddc.DedicatedHostGroup("defaultDedicatedHostGroup", new()
    {
        Engine = "MySQL",
        VpcId = defaultNetworks.Apply(getNetworksResult => getNetworksResult.Ids[0]),
        CpuAllocationRatio = 101,
        MemAllocationRatio = 50,
        DiskAllocationRatio = 200,
        AllocationPolicy = "Evenly",
        HostReplacePolicy = "Manual",
        DedicatedHostGroupDesc = "example_value",
    });

    var defaultDedicatedHost = new AliCloud.Cddc.DedicatedHost("defaultDedicatedHost", new()
    {
        HostName = "example_value",
        DedicatedHostGroupId = defaultDedicatedHostGroup.Id,
        HostClass = defaultHostEcsLevelInfos.Apply(getHostEcsLevelInfosResult => getHostEcsLevelInfosResult.Infos[0]?.ResClassCode),
        ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Ids[0]),
        VswitchId = defaultSwitches.Apply(getSwitchesResult => getSwitchesResult.Ids[0]),
        PaymentType = "Subscription",
        Tags = 
        {
            { "Created", "TF" },
            { "For", "CDDC_DEDICATED" },
        },
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultNetworks, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
			NameRegex: pulumi.StringRef("default-NODELETING"),
		}, nil)
		if err != nil {
			return err
		}
		defaultZones, err := cddc.GetZones(ctx, nil, nil)
		if err != nil {
			return err
		}
		defaultHostEcsLevelInfos, err := cddc.GetHostEcsLevelInfos(ctx, &cddc.GetHostEcsLevelInfosArgs{
			DbType:      "mysql",
			ZoneId:      defaultZones.Ids[0],
			StorageType: "cloud_essd",
		}, nil)
		if err != nil {
			return err
		}
		defaultSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
			VpcId:  pulumi.StringRef(defaultNetworks.Ids[0]),
			ZoneId: pulumi.StringRef(defaultZones.Ids[0]),
		}, nil)
		if err != nil {
			return err
		}
		defaultDedicatedHostGroup, err := cddc.NewDedicatedHostGroup(ctx, "defaultDedicatedHostGroup", &cddc.DedicatedHostGroupArgs{
			Engine:                 pulumi.String("MySQL"),
			VpcId:                  *pulumi.String(defaultNetworks.Ids[0]),
			CpuAllocationRatio:     pulumi.Int(101),
			MemAllocationRatio:     pulumi.Int(50),
			DiskAllocationRatio:    pulumi.Int(200),
			AllocationPolicy:       pulumi.String("Evenly"),
			HostReplacePolicy:      pulumi.String("Manual"),
			DedicatedHostGroupDesc: pulumi.String("example_value"),
		})
		if err != nil {
			return err
		}
		_, err = cddc.NewDedicatedHost(ctx, "defaultDedicatedHost", &cddc.DedicatedHostArgs{
			HostName:             pulumi.String("example_value"),
			DedicatedHostGroupId: defaultDedicatedHostGroup.ID(),
			HostClass:            *pulumi.String(defaultHostEcsLevelInfos.Infos[0].ResClassCode),
			ZoneId:               *pulumi.String(defaultZones.Ids[0]),
			VswitchId:            *pulumi.String(defaultSwitches.Ids[0]),
			PaymentType:          pulumi.String("Subscription"),
			Tags: pulumi.AnyMap{
				"Created": pulumi.Any("TF"),
				"For":     pulumi.Any("CDDC_DEDICATED"),
			},
		})
		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.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
import com.pulumi.alicloud.cddc.CddcFunctions;
import com.pulumi.alicloud.cddc.inputs.GetZonesArgs;
import com.pulumi.alicloud.cddc.inputs.GetHostEcsLevelInfosArgs;
import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
import com.pulumi.alicloud.cddc.DedicatedHostGroup;
import com.pulumi.alicloud.cddc.DedicatedHostGroupArgs;
import com.pulumi.alicloud.cddc.DedicatedHost;
import com.pulumi.alicloud.cddc.DedicatedHostArgs;
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 defaultNetworks = VpcFunctions.getNetworks(GetNetworksArgs.builder()
            .nameRegex("default-NODELETING")
            .build());

        final var defaultZones = CddcFunctions.getZones();

        final var defaultHostEcsLevelInfos = CddcFunctions.getHostEcsLevelInfos(GetHostEcsLevelInfosArgs.builder()
            .dbType("mysql")
            .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
            .storageType("cloud_essd")
            .build());

        final var defaultSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
            .vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
            .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
            .build());

        var defaultDedicatedHostGroup = new DedicatedHostGroup("defaultDedicatedHostGroup", DedicatedHostGroupArgs.builder()        
            .engine("MySQL")
            .vpcId(defaultNetworks.applyValue(getNetworksResult -> getNetworksResult.ids()[0]))
            .cpuAllocationRatio(101)
            .memAllocationRatio(50)
            .diskAllocationRatio(200)
            .allocationPolicy("Evenly")
            .hostReplacePolicy("Manual")
            .dedicatedHostGroupDesc("example_value")
            .build());

        var defaultDedicatedHost = new DedicatedHost("defaultDedicatedHost", DedicatedHostArgs.builder()        
            .hostName("example_value")
            .dedicatedHostGroupId(defaultDedicatedHostGroup.id())
            .hostClass(defaultHostEcsLevelInfos.applyValue(getHostEcsLevelInfosResult -> getHostEcsLevelInfosResult.infos()[0].resClassCode()))
            .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
            .vswitchId(defaultSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
            .paymentType("Subscription")
            .tags(Map.ofEntries(
                Map.entry("Created", "TF"),
                Map.entry("For", "CDDC_DEDICATED")
            ))
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_networks = alicloud.vpc.get_networks(name_regex="default-NODELETING")
default_zones = alicloud.cddc.get_zones()
default_host_ecs_level_infos = alicloud.cddc.get_host_ecs_level_infos(db_type="mysql",
    zone_id=default_zones.ids[0],
    storage_type="cloud_essd")
default_switches = alicloud.vpc.get_switches(vpc_id=default_networks.ids[0],
    zone_id=default_zones.ids[0])
default_dedicated_host_group = alicloud.cddc.DedicatedHostGroup("defaultDedicatedHostGroup",
    engine="MySQL",
    vpc_id=default_networks.ids[0],
    cpu_allocation_ratio=101,
    mem_allocation_ratio=50,
    disk_allocation_ratio=200,
    allocation_policy="Evenly",
    host_replace_policy="Manual",
    dedicated_host_group_desc="example_value")
default_dedicated_host = alicloud.cddc.DedicatedHost("defaultDedicatedHost",
    host_name="example_value",
    dedicated_host_group_id=default_dedicated_host_group.id,
    host_class=default_host_ecs_level_infos.infos[0].res_class_code,
    zone_id=default_zones.ids[0],
    vswitch_id=default_switches.ids[0],
    payment_type="Subscription",
    tags={
        "Created": "TF",
        "For": "CDDC_DEDICATED",
    })
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultNetworks = alicloud.vpc.getNetworks({
    nameRegex: "default-NODELETING",
});
const defaultZones = alicloud.cddc.getZones({});
const defaultHostEcsLevelInfos = defaultZones.then(defaultZones => alicloud.cddc.getHostEcsLevelInfos({
    dbType: "mysql",
    zoneId: defaultZones.ids?.[0],
    storageType: "cloud_essd",
}));
const defaultSwitches = Promise.all([defaultNetworks, defaultZones]).then(([defaultNetworks, defaultZones]) => alicloud.vpc.getSwitches({
    vpcId: defaultNetworks.ids?.[0],
    zoneId: defaultZones.ids?.[0],
}));
const defaultDedicatedHostGroup = new alicloud.cddc.DedicatedHostGroup("defaultDedicatedHostGroup", {
    engine: "MySQL",
    vpcId: defaultNetworks.then(defaultNetworks => defaultNetworks.ids?.[0]),
    cpuAllocationRatio: 101,
    memAllocationRatio: 50,
    diskAllocationRatio: 200,
    allocationPolicy: "Evenly",
    hostReplacePolicy: "Manual",
    dedicatedHostGroupDesc: "example_value",
});
const defaultDedicatedHost = new alicloud.cddc.DedicatedHost("defaultDedicatedHost", {
    hostName: "example_value",
    dedicatedHostGroupId: defaultDedicatedHostGroup.id,
    hostClass: defaultHostEcsLevelInfos.then(defaultHostEcsLevelInfos => defaultHostEcsLevelInfos.infos?.[0]?.resClassCode),
    zoneId: defaultZones.then(defaultZones => defaultZones.ids?.[0]),
    vswitchId: defaultSwitches.then(defaultSwitches => defaultSwitches.ids?.[0]),
    paymentType: "Subscription",
    tags: {
        Created: "TF",
        For: "CDDC_DEDICATED",
    },
});
resources:
  defaultDedicatedHostGroup:
    type: alicloud:cddc:DedicatedHostGroup
    properties:
      engine: MySQL
      vpcId: ${defaultNetworks.ids[0]}
      cpuAllocationRatio: 101
      memAllocationRatio: 50
      diskAllocationRatio: 200
      allocationPolicy: Evenly
      hostReplacePolicy: Manual
      dedicatedHostGroupDesc: example_value
  defaultDedicatedHost:
    type: alicloud:cddc:DedicatedHost
    properties:
      hostName: example_value
      dedicatedHostGroupId: ${defaultDedicatedHostGroup.id}
      hostClass: ${defaultHostEcsLevelInfos.infos[0].resClassCode}
      zoneId: ${defaultZones.ids[0]}
      vswitchId: ${defaultSwitches.ids[0]}
      paymentType: Subscription
      tags:
        Created: TF
        For: CDDC_DEDICATED
variables:
  defaultNetworks:
    fn::invoke:
      Function: alicloud:vpc:getNetworks
      Arguments:
        nameRegex: default-NODELETING
  defaultZones:
    fn::invoke:
      Function: alicloud:cddc:getZones
      Arguments: {}
  defaultHostEcsLevelInfos:
    fn::invoke:
      Function: alicloud:cddc:getHostEcsLevelInfos
      Arguments:
        dbType: mysql
        zoneId: ${defaultZones.ids[0]}
        storageType: cloud_essd
  defaultSwitches:
    fn::invoke:
      Function: alicloud:vpc:getSwitches
      Arguments:
        vpcId: ${defaultNetworks.ids[0]}
        zoneId: ${defaultZones.ids[0]}

Create DedicatedHost Resource

new DedicatedHost(name: string, args: DedicatedHostArgs, opts?: CustomResourceOptions);
@overload
def DedicatedHost(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  allocation_status: Optional[str] = None,
                  auto_renew: Optional[bool] = None,
                  dedicated_host_group_id: Optional[str] = None,
                  host_class: Optional[str] = None,
                  host_name: Optional[str] = None,
                  image_category: Optional[str] = None,
                  os_password: Optional[str] = None,
                  payment_type: Optional[str] = None,
                  period: Optional[str] = None,
                  tags: Optional[Mapping[str, Any]] = None,
                  used_time: Optional[int] = None,
                  vswitch_id: Optional[str] = None,
                  zone_id: Optional[str] = None)
@overload
def DedicatedHost(resource_name: str,
                  args: DedicatedHostArgs,
                  opts: Optional[ResourceOptions] = None)
func NewDedicatedHost(ctx *Context, name string, args DedicatedHostArgs, opts ...ResourceOption) (*DedicatedHost, error)
public DedicatedHost(string name, DedicatedHostArgs args, CustomResourceOptions? opts = null)
public DedicatedHost(String name, DedicatedHostArgs args)
public DedicatedHost(String name, DedicatedHostArgs args, CustomResourceOptions options)
type: alicloud:cddc:DedicatedHost
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

DedicatedHostGroupId string

The ID of the dedicated cluster.

HostClass string

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

PaymentType string

The payment type of the resource. Valid values: Subscription.

VswitchId string

The ID of the vSwitch to which the host is connected.

ZoneId string

The ID of the zone.

AllocationStatus string

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

AutoRenew bool

Specifies whether to enable the auto-renewal feature.

HostName string

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

ImageCategory string

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

OsPassword string

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

Period string

The unit of the subscription duration. Valid values: Year, Month, Week.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

UsedTime int

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
DedicatedHostGroupId string

The ID of the dedicated cluster.

HostClass string

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

PaymentType string

The payment type of the resource. Valid values: Subscription.

VswitchId string

The ID of the vSwitch to which the host is connected.

ZoneId string

The ID of the zone.

AllocationStatus string

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

AutoRenew bool

Specifies whether to enable the auto-renewal feature.

HostName string

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

ImageCategory string

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

OsPassword string

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

Period string

The unit of the subscription duration. Valid values: Year, Month, Week.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

UsedTime int

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
dedicatedHostGroupId String

The ID of the dedicated cluster.

hostClass String

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

paymentType String

The payment type of the resource. Valid values: Subscription.

vswitchId String

The ID of the vSwitch to which the host is connected.

zoneId String

The ID of the zone.

allocationStatus String

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

autoRenew Boolean

Specifies whether to enable the auto-renewal feature.

hostName String

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

imageCategory String

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

osPassword String

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

period String

The unit of the subscription duration. Valid values: Year, Month, Week.

tags Map<String,Object>

A mapping of tags to assign to the resource.

usedTime Integer

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
dedicatedHostGroupId string

The ID of the dedicated cluster.

hostClass string

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

paymentType string

The payment type of the resource. Valid values: Subscription.

vswitchId string

The ID of the vSwitch to which the host is connected.

zoneId string

The ID of the zone.

allocationStatus string

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

autoRenew boolean

Specifies whether to enable the auto-renewal feature.

hostName string

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

imageCategory string

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

osPassword string

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

period string

The unit of the subscription duration. Valid values: Year, Month, Week.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

usedTime number

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
dedicated_host_group_id str

The ID of the dedicated cluster.

host_class str

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

payment_type str

The payment type of the resource. Valid values: Subscription.

vswitch_id str

The ID of the vSwitch to which the host is connected.

zone_id str

The ID of the zone.

allocation_status str

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

auto_renew bool

Specifies whether to enable the auto-renewal feature.

host_name str

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

image_category str

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

os_password str

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

period str

The unit of the subscription duration. Valid values: Year, Month, Week.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

used_time int

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
dedicatedHostGroupId String

The ID of the dedicated cluster.

hostClass String

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

paymentType String

The payment type of the resource. Valid values: Subscription.

vswitchId String

The ID of the vSwitch to which the host is connected.

zoneId String

The ID of the zone.

allocationStatus String

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

autoRenew Boolean

Specifies whether to enable the auto-renewal feature.

hostName String

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

imageCategory String

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

osPassword String

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

period String

The unit of the subscription duration. Valid values: Year, Month, Week.

tags Map<Any>

A mapping of tags to assign to the resource.

usedTime Number

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.

Outputs

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

DedicatedHostId string

The ID of the host.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

DedicatedHostId string

The ID of the host.

Id string

The provider-assigned unique ID for this managed resource.

Status string

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

dedicatedHostId String

The ID of the host.

id String

The provider-assigned unique ID for this managed resource.

status String

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

dedicatedHostId string

The ID of the host.

id string

The provider-assigned unique ID for this managed resource.

status string

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

dedicated_host_id str

The ID of the host.

id str

The provider-assigned unique ID for this managed resource.

status str

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

dedicatedHostId String

The ID of the host.

id String

The provider-assigned unique ID for this managed resource.

status String

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

Look up Existing DedicatedHost Resource

Get an existing DedicatedHost 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?: DedicatedHostState, opts?: CustomResourceOptions): DedicatedHost
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allocation_status: Optional[str] = None,
        auto_renew: Optional[bool] = None,
        dedicated_host_group_id: Optional[str] = None,
        dedicated_host_id: Optional[str] = None,
        host_class: Optional[str] = None,
        host_name: Optional[str] = None,
        image_category: Optional[str] = None,
        os_password: Optional[str] = None,
        payment_type: Optional[str] = None,
        period: Optional[str] = None,
        status: Optional[str] = None,
        tags: Optional[Mapping[str, Any]] = None,
        used_time: Optional[int] = None,
        vswitch_id: Optional[str] = None,
        zone_id: Optional[str] = None) -> DedicatedHost
func GetDedicatedHost(ctx *Context, name string, id IDInput, state *DedicatedHostState, opts ...ResourceOption) (*DedicatedHost, error)
public static DedicatedHost Get(string name, Input<string> id, DedicatedHostState? state, CustomResourceOptions? opts = null)
public static DedicatedHost get(String name, Output<String> id, DedicatedHostState 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:
AllocationStatus string

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

AutoRenew bool

Specifies whether to enable the auto-renewal feature.

DedicatedHostGroupId string

The ID of the dedicated cluster.

DedicatedHostId string

The ID of the host.

HostClass string

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

HostName string

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

ImageCategory string

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

OsPassword string

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

PaymentType string

The payment type of the resource. Valid values: Subscription.

Period string

The unit of the subscription duration. Valid values: Year, Month, Week.

Status string

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

UsedTime int

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
VswitchId string

The ID of the vSwitch to which the host is connected.

ZoneId string

The ID of the zone.

AllocationStatus string

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

AutoRenew bool

Specifies whether to enable the auto-renewal feature.

DedicatedHostGroupId string

The ID of the dedicated cluster.

DedicatedHostId string

The ID of the host.

HostClass string

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

HostName string

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

ImageCategory string

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

OsPassword string

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

PaymentType string

The payment type of the resource. Valid values: Subscription.

Period string

The unit of the subscription duration. Valid values: Year, Month, Week.

Status string

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

UsedTime int

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
VswitchId string

The ID of the vSwitch to which the host is connected.

ZoneId string

The ID of the zone.

allocationStatus String

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

autoRenew Boolean

Specifies whether to enable the auto-renewal feature.

dedicatedHostGroupId String

The ID of the dedicated cluster.

dedicatedHostId String

The ID of the host.

hostClass String

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

hostName String

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

imageCategory String

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

osPassword String

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

paymentType String

The payment type of the resource. Valid values: Subscription.

period String

The unit of the subscription duration. Valid values: Year, Month, Week.

status String

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

tags Map<String,Object>

A mapping of tags to assign to the resource.

usedTime Integer

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
vswitchId String

The ID of the vSwitch to which the host is connected.

zoneId String

The ID of the zone.

allocationStatus string

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

autoRenew boolean

Specifies whether to enable the auto-renewal feature.

dedicatedHostGroupId string

The ID of the dedicated cluster.

dedicatedHostId string

The ID of the host.

hostClass string

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

hostName string

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

imageCategory string

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

osPassword string

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

paymentType string

The payment type of the resource. Valid values: Subscription.

period string

The unit of the subscription duration. Valid values: Year, Month, Week.

status string

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

usedTime number

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
vswitchId string

The ID of the vSwitch to which the host is connected.

zoneId string

The ID of the zone.

allocation_status str

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

auto_renew bool

Specifies whether to enable the auto-renewal feature.

dedicated_host_group_id str

The ID of the dedicated cluster.

dedicated_host_id str

The ID of the host.

host_class str

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

host_name str

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

image_category str

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

os_password str

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

payment_type str

The payment type of the resource. Valid values: Subscription.

period str

The unit of the subscription duration. Valid values: Year, Month, Week.

status str

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

used_time int

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
vswitch_id str

The ID of the vSwitch to which the host is connected.

zone_id str

The ID of the zone.

allocationStatus String

Specifies whether instances can be created on the host. Valid values: Allocatable or Suspended. Allocatable: Instances can be created on the host. Suspended: Instances cannot be created on the host.

autoRenew Boolean

Specifies whether to enable the auto-renewal feature.

dedicatedHostGroupId String

The ID of the dedicated cluster.

dedicatedHostId String

The ID of the host.

hostClass String

The instance type of the host. For more information about the supported instance types of hosts, see Host specification details.

hostName String

The name of the host. The name must be 1 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

imageCategory String

Host Image Category. Valid values: WindowsWithMssqlEntAlwaysonLicense, WindowsWithMssqlStdLicense, WindowsWithMssqlEntLicense, WindowsWithMssqlWebLicense, AliLinux.

osPassword String

Host password. NOTE: The creation of a host password is supported only when the database type is Tair-PMem.

paymentType String

The payment type of the resource. Valid values: Subscription.

period String

The unit of the subscription duration. Valid values: Year, Month, Week.

status String

The state of the host. Valid values: 0: The host is being created. 1: The host is running. 2: The host is faulty. 3: The host is ready for deactivation. 4: The host is being maintained. 5: The host is deactivated. 6: The host is restarting. 7: The host is locked.

tags Map<Any>

A mapping of tags to assign to the resource.

usedTime Number

The subscription duration of the host. Valid values:

  • If the Period parameter is set to Year, the value of the UsedTime parameter ranges from 1 to 5.
  • If the Period parameter is set to Month, the value of the UsedTime parameter ranges from 1 to 9.
  • If the Period parameter is set to Week, the value of the UsedTime parameter ranges from 1, 2 and 3.
vswitchId String

The ID of the vSwitch to which the host is connected.

zoneId String

The ID of the zone.

Import

ApsaraDB for MyBase Dedicated Host can be imported using the id, e.g.

 $ pulumi import alicloud:cddc/dedicatedHost:DedicatedHost example <dedicated_host_group_id>:<dedicated_host_id>

Package Details

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

This Pulumi package is based on the alicloud Terraform Provider.