getDedicatedHosts

This data source provides the Cddc Dedicated Hosts of the current Alibaba Cloud user.

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.cddc.CddcFunctions;
import com.pulumi.alicloud.cddc.inputs.GetDedicatedHostsArgs;
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 ids = CddcFunctions.getDedicatedHosts(GetDedicatedHostsArgs.builder()
.dedicatedHostGroupId("example_value")
.ids(
"example_value-1",
"example_value-2")
.build());
ctx.export("cddcDedicatedHostId1", ids.applyValue(getDedicatedHostsResult -> getDedicatedHostsResult.hosts()[0].id()));
final var status = CddcFunctions.getDedicatedHosts(GetDedicatedHostsArgs.builder()
.dedicatedHostGroupId("example_value")
.ids(
"example_value-1",
"example_value-2")
.status("1")
.build());
ctx.export("cddcDedicatedHostId2", status.applyValue(getDedicatedHostsResult -> getDedicatedHostsResult.hosts()[0].id()));
final var zoneId = CddcFunctions.getDedicatedHosts(GetDedicatedHostsArgs.builder()
.dedicatedHostGroupId("example_value")
.ids(
"example_value-1",
"example_value-2")
.zoneId("example_value")
.build());
ctx.export("cddcDedicatedHostId3", zoneId.applyValue(getDedicatedHostsResult -> getDedicatedHostsResult.hosts()[0].id()));
final var allocationStatus = CddcFunctions.getDedicatedHosts(GetDedicatedHostsArgs.builder()
.dedicatedHostGroupId("example_value")
.ids(
"example_value-1",
"example_value-2")
.allocationStatus("Allocatable")
.build());
ctx.export("cddcDedicatedHostId4", allocationStatus.applyValue(getDedicatedHostsResult -> getDedicatedHostsResult.hosts()[0].id()));
final var hostType = CddcFunctions.getDedicatedHosts(GetDedicatedHostsArgs.builder()
.dedicatedHostGroupId("example_value")
.ids(
"example_value-1",
"example_value-2")
.hostType("dhg_cloud_ssd")
.build());
ctx.export("cddcDedicatedHostId5", hostType.applyValue(getDedicatedHostsResult -> getDedicatedHostsResult.hosts()[0].id()));
}
}

Return

A collection of values returned by getDedicatedHosts.

Parameters

argument

A collection of arguments for invoking getDedicatedHosts.


suspend fun getDedicatedHosts(allocationStatus: String? = null, dedicatedHostGroupId: String, enableDetails: Boolean? = null, hostType: String? = null, ids: List<String>? = null, orderId: String? = null, outputFile: String? = null, status: String? = null, tags: Map<String, Any>? = null, zoneId: String? = null): GetDedicatedHostsResult

Return

A collection of values returned by getDedicatedHosts.

See also

Parameters

allocationStatus

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

dedicatedHostGroupId

The ID of the dedicated cluster in which the host is created.

enableDetails

Default to false. Set it to true can output more details about resource attributes.

hostType

The storage type of the host.

ids

A list of Dedicated Host IDs.

orderId

The ID of the order.

outputFile

File name where to save data source results (after running pulumi preview).

status

The state of the host.

tags

The tag of the resource.

zoneId

The zone ID of the host.


Return

A collection of values returned by getDedicatedHosts.

See also

Parameters

argument

Builder for com.pulumi.alicloud.cddc.kotlin.inputs.GetDedicatedHostsPlainArgs.