DedicatedHostArgs

data class DedicatedHostArgs(val allocationStatus: Output<String>? = null, val autoRenew: Output<Boolean>? = null, val dedicatedHostGroupId: Output<String>? = null, val hostClass: Output<String>? = null, val hostName: Output<String>? = null, val imageCategory: Output<String>? = null, val osPassword: Output<String>? = null, val paymentType: Output<String>? = null, val period: Output<String>? = null, val tags: Output<Map<String, Any>>? = null, val usedTime: Output<Int>? = null, val vswitchId: Output<String>? = null, val zoneId: Output<String>? = null) : ConvertibleToJava<DedicatedHostArgs>

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

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

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>

Constructors

Link copied to clipboard
fun DedicatedHostArgs(allocationStatus: Output<String>? = null, autoRenew: Output<Boolean>? = null, dedicatedHostGroupId: Output<String>? = null, hostClass: Output<String>? = null, hostName: Output<String>? = null, imageCategory: Output<String>? = null, osPassword: Output<String>? = null, paymentType: Output<String>? = null, period: Output<String>? = null, tags: Output<Map<String, Any>>? = null, usedTime: Output<Int>? = null, vswitchId: Output<String>? = null, zoneId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): DedicatedHostArgs

Properties

Link copied to clipboard
val allocationStatus: Output<String>? = null

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.

Link copied to clipboard
val autoRenew: Output<Boolean>? = null

Specifies whether to enable the auto-renewal feature.

Link copied to clipboard
val dedicatedHostGroupId: Output<String>? = null

The ID of the dedicated cluster.

Link copied to clipboard
val hostClass: Output<String>? = null

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

Link copied to clipboard
val hostName: Output<String>? = null

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.

Link copied to clipboard
val imageCategory: Output<String>? = null

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

Link copied to clipboard
val osPassword: Output<String>? = null

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

Link copied to clipboard
val paymentType: Output<String>? = null

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

Link copied to clipboard
val period: Output<String>? = null

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

Link copied to clipboard
val tags: Output<Map<String, Any>>? = null

A mapping of tags to assign to the resource.

Link copied to clipboard
val usedTime: Output<Int>? = null

The subscription duration of the host. Valid values:

Link copied to clipboard
val vswitchId: Output<String>? = null

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

Link copied to clipboard
val zoneId: Output<String>? = null

The ID of the zone.