DedicatedHost

Provides an EC2 host resource. This allows hosts to be created, updated, and deleted.

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 }));

Create a DedicatedHost Resource

new DedicatedHost(name: string, args: DedicatedHostArgs, opts?: CustomResourceOptions);
@overload
def DedicatedHost(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  auto_placement: Optional[str] = None,
                  availability_zone: Optional[str] = None,
                  host_recovery: Optional[str] = None,
                  instance_family: Optional[str] = None,
                  instance_type: Optional[str] = None,
                  tags: Optional[Mapping[str, 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)
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.

DedicatedHost Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The DedicatedHost resource accepts the following input properties:

AvailabilityZone string
The AZ to start the host in.
AutoPlacement string
Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID.
HostRecovery string
Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default.
InstanceFamily string
Specifies the instance family for which to configure your Dedicated Host. Mutually exclusive with instance_type.
InstanceType string
Specifies the instance type for which to configure your Dedicated Host. When you specify the instance type, that is the only instance type that you can launch onto that host. Mutually exclusive with instance_family.
Tags Dictionary<string, string>
AvailabilityZone string
The AZ to start the host in.
AutoPlacement string
Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID.
HostRecovery string
Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default.
InstanceFamily string
Specifies the instance family for which to configure your Dedicated Host. Mutually exclusive with instance_type.
InstanceType string
Specifies the instance type for which to configure your Dedicated Host. When you specify the instance type, that is the only instance type that you can launch onto that host. Mutually exclusive with instance_family.
Tags map[string]string
availabilityZone string
The AZ to start the host in.
autoPlacement string
Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID.
hostRecovery string
Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default.
instanceFamily string
Specifies the instance family for which to configure your Dedicated Host. Mutually exclusive with instance_type.
instanceType string
Specifies the instance type for which to configure your Dedicated Host. When you specify the instance type, that is the only instance type that you can launch onto that host. Mutually exclusive with instance_family.
tags {[key: string]: string}
availability_zone str
The AZ to start the host in.
auto_placement str
Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID.
host_recovery str
Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default.
instance_family str
Specifies the instance family for which to configure your Dedicated Host. Mutually exclusive with instance_type.
instance_type str
Specifies the instance type for which to configure your Dedicated Host. When you specify the instance type, that is the only instance type that you can launch onto that host. Mutually exclusive with instance_family.
tags Mapping[str, str]

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an 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,
        auto_placement: Optional[str] = None,
        availability_zone: Optional[str] = None,
        host_recovery: Optional[str] = None,
        instance_family: Optional[str] = None,
        instance_type: Optional[str] = None,
        tags: Optional[Mapping[str, 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)
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.

The following state arguments are supported:

AutoPlacement string
Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID.
AvailabilityZone string
The AZ to start the host in.
HostRecovery string
Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default.
InstanceFamily string
Specifies the instance family for which to configure your Dedicated Host. Mutually exclusive with instance_type.
InstanceType string
Specifies the instance type for which to configure your Dedicated Host. When you specify the instance type, that is the only instance type that you can launch onto that host. Mutually exclusive with instance_family.
Tags Dictionary<string, string>
AutoPlacement string
Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID.
AvailabilityZone string
The AZ to start the host in.
HostRecovery string
Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default.
InstanceFamily string
Specifies the instance family for which to configure your Dedicated Host. Mutually exclusive with instance_type.
InstanceType string
Specifies the instance type for which to configure your Dedicated Host. When you specify the instance type, that is the only instance type that you can launch onto that host. Mutually exclusive with instance_family.
Tags map[string]string
autoPlacement string
Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID.
availabilityZone string
The AZ to start the host in.
hostRecovery string
Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default.
instanceFamily string
Specifies the instance family for which to configure your Dedicated Host. Mutually exclusive with instance_type.
instanceType string
Specifies the instance type for which to configure your Dedicated Host. When you specify the instance type, that is the only instance type that you can launch onto that host. Mutually exclusive with instance_family.
tags {[key: string]: string}
auto_placement str
Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID.
availability_zone str
The AZ to start the host in.
host_recovery str
Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default.
instance_family str
Specifies the instance family for which to configure your Dedicated Host. Mutually exclusive with instance_type.
instance_type str
Specifies the instance type for which to configure your Dedicated Host. When you specify the instance type, that is the only instance type that you can launch onto that host. Mutually exclusive with instance_family.
tags Mapping[str, str]

Import

hosts can be imported using the host_id, e.g.

 $ pulumi import aws:ec2/dedicatedHost:DedicatedHost host_id h-0385a99d0e4b20cbb

Package Details

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