getDedicatedHosts

This data source provides a list of ECS Dedicated Hosts in an Alibaba Cloud account according to the specified filters.

NOTE: Available in v1.91.0+.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.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 dedicatedHostsDs = EcsFunctions.getDedicatedHosts(GetDedicatedHostsArgs.builder()
.dedicatedHostType("ddh.g5")
.nameRegex("tf-testAcc")
.status("Available")
.build());
ctx.export("firstDedicatedHostsId", dedicatedHostsDs.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(dedicatedHostId: String? = null, dedicatedHostName: String? = null, dedicatedHostType: String? = null, ids: List<String>? = null, nameRegex: String? = null, operationLocks: List<GetDedicatedHostsOperationLock>? = null, outputFile: String? = null, resourceGroupId: 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

dedicatedHostId

The ID of ECS Dedicated Host.

dedicatedHostName

The name of ECS Dedicated Host.

dedicatedHostType

The type of the dedicated host.

ids

A list of ECS Dedicated Host ids.

nameRegex

A regex string to filter results by the ECS Dedicated Host name.

operationLocks

The reason why the dedicated host resource is locked.

outputFile

Save the result to the file.

resourceGroupId

The ID of the resource group to which the ECS Dedicated Host belongs.

status

The status of the ECS Dedicated Host. validate value: Available, Creating, PermanentFailure, Released, UnderAssessment.

tags

A mapping of tags to assign to the resource.

zoneId

The zone ID of the ECS Dedicated Host.


Return

A collection of values returned by getDedicatedHosts.

See also

Parameters

argument

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