getDedicatedHost

Use this data source to get information about the host when allocating an EC2 Dedicated Host.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Aws.Ec2.DedicatedHost("test", new Aws.Ec2.DedicatedHostArgs
        {
            AutoPlacement = "on",
            AvailabilityZone = "us-west-1a",
            HostRecovery = "on",
            InstanceType = "c5.18xlarge",
        });
        var testData = test.Id.Apply(id => Aws.Ec2.GetDedicatedHost.InvokeAsync(new Aws.Ec2.GetDedicatedHostArgs
        {
            HostId = id,
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test, err := ec2.NewDedicatedHost(ctx, "test", &ec2.DedicatedHostArgs{
			AutoPlacement:    pulumi.String("on"),
			AvailabilityZone: pulumi.String("us-west-1a"),
			HostRecovery:     pulumi.String("on"),
			InstanceType:     pulumi.String("c5.18xlarge"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

test = aws.ec2.DedicatedHost("test",
    auto_placement="on",
    availability_zone="us-west-1a",
    host_recovery="on",
    instance_type="c5.18xlarge")
test_data = test.id.apply(lambda id: aws.ec2.get_dedicated_host(host_id=id))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.ec2.DedicatedHost("test", {
    autoPlacement: "on",
    availabilityZone: "us-west-1a",
    hostRecovery: "on",
    instanceType: "c5.18xlarge",
});
const testData = test.id.apply(id => aws.ec2.getDedicatedHost({
    hostId: id,
}, { async: true }));

Using getDedicatedHost

function getDedicatedHost(args: GetDedicatedHostArgs, opts?: InvokeOptions): Promise<GetDedicatedHostResult>
def get_dedicated_host(host_id: Optional[str] = None,
                       tags: Optional[Mapping[str, str]] = None,
                       opts: Optional[InvokeOptions] = None) -> GetDedicatedHostResult
func LookupDedicatedHost(ctx *Context, args *LookupDedicatedHostArgs, opts ...InvokeOption) (*LookupDedicatedHostResult, error)

Note: This function is named LookupDedicatedHost in the Go SDK.

public static class GetDedicatedHost {
    public static Task<GetDedicatedHostResult> InvokeAsync(GetDedicatedHostArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

HostId string
The host ID.
Tags Dictionary<string, string>
HostId string
The host ID.
Tags map[string]string
hostId string
The host ID.
tags {[key: string]: string}
host_id str
The host ID.
tags Mapping[str, str]

getDedicatedHost Result

The following output properties are available:

AutoPlacement string
AvailabilityZone string
Cores int
The number of cores on the Dedicated Host.
HostId string
The host ID.
HostRecovery string
Id string
The provider-assigned unique ID for this managed resource.
InstanceFamily string

The instance family supported by the Dedicated Host. For example, m5.

  • instance_type -The instance type supported by the Dedicated Host. For example, m5.large. If the host supports multiple instance types, no instanceType is returned.
InstanceState string
InstanceType string
Sockets int
The instance family supported by the Dedicated Host. For example, m5.
Tags Dictionary<string, string>
TotalVcpus int
The total number of vCPUs on the Dedicated Host.
AutoPlacement string
AvailabilityZone string
Cores int
The number of cores on the Dedicated Host.
HostId string
The host ID.
HostRecovery string
Id string
The provider-assigned unique ID for this managed resource.
InstanceFamily string

The instance family supported by the Dedicated Host. For example, m5.

  • instance_type -The instance type supported by the Dedicated Host. For example, m5.large. If the host supports multiple instance types, no instanceType is returned.
InstanceState string
InstanceType string
Sockets int
The instance family supported by the Dedicated Host. For example, m5.
Tags map[string]string
TotalVcpus int
The total number of vCPUs on the Dedicated Host.
autoPlacement string
availabilityZone string
cores number
The number of cores on the Dedicated Host.
hostId string
The host ID.
hostRecovery string
id string
The provider-assigned unique ID for this managed resource.
instanceFamily string

The instance family supported by the Dedicated Host. For example, m5.

  • instance_type -The instance type supported by the Dedicated Host. For example, m5.large. If the host supports multiple instance types, no instanceType is returned.
instanceState string
instanceType string
sockets number
The instance family supported by the Dedicated Host. For example, m5.
tags {[key: string]: string}
totalVcpus number
The total number of vCPUs on the Dedicated Host.
auto_placement str
availability_zone str
cores int
The number of cores on the Dedicated Host.
host_id str
The host ID.
host_recovery str
id str
The provider-assigned unique ID for this managed resource.
instance_family str

The instance family supported by the Dedicated Host. For example, m5.

  • instance_type -The instance type supported by the Dedicated Host. For example, m5.large. If the host supports multiple instance types, no instanceType is returned.
instance_state str
instance_type str
sockets int
The instance family supported by the Dedicated Host. For example, m5.
tags Mapping[str, str]
total_vcpus int
The total number of vCPUs on the Dedicated Host.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.