aws logo
AWS Classic v5.33.0, Mar 24 23

aws.ec2.DedicatedHost

Provides an EC2 Host resource. This allows Dedicated Hosts to be allocated, modified, and released.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    // Create a new host with instance type of c5.18xlarge with Auto Placement
    // and Host Recovery enabled.
    var test = new Aws.Ec2.DedicatedHost("test", new()
    {
        AutoPlacement = "on",
        AvailabilityZone = "us-west-2a",
        HostRecovery = "on",
        InstanceType = "c5.18xlarge",
    });

});
package main

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

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

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.DedicatedHost;
import com.pulumi.aws.ec2.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) {
        var test = new DedicatedHost("test", DedicatedHostArgs.builder()        
            .autoPlacement("on")
            .availabilityZone("us-west-2a")
            .hostRecovery("on")
            .instanceType("c5.18xlarge")
            .build());

    }
}
import pulumi
import pulumi_aws as aws

# Create a new host with instance type of c5.18xlarge with Auto Placement
# and Host Recovery enabled.
test = aws.ec2.DedicatedHost("test",
    auto_placement="on",
    availability_zone="us-west-2a",
    host_recovery="on",
    instance_type="c5.18xlarge")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

// Create a new host with instance type of c5.18xlarge with Auto Placement
// and Host Recovery enabled.
const test = new aws.ec2.DedicatedHost("test", {
    autoPlacement: "on",
    availabilityZone: "us-west-2a",
    hostRecovery: "on",
    instanceType: "c5.18xlarge",
});
resources:
  # Create a new host with instance type of c5.18xlarge with Auto Placement
  # // and Host Recovery enabled.
  test:
    type: aws:ec2:DedicatedHost
    properties:
      autoPlacement: on
      availabilityZone: us-west-2a
      hostRecovery: on
      instanceType: c5.18xlarge

Create 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,
                  outpost_arn: 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)
public DedicatedHost(String name, DedicatedHostArgs args)
public DedicatedHost(String name, DedicatedHostArgs args, CustomResourceOptions options)
type: aws:ec2:DedicatedHost
properties: # The arguments to resource properties.
options: # 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.
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.
name String
The unique name of the resource.
args DedicatedHostArgs
The arguments to resource properties.
options 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 Architecture and Concepts docs.

Inputs

The DedicatedHost resource accepts the following input properties:

AvailabilityZone string

The Availability Zone in which to allocate the Dedicated Host.

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. Valid values: on, off. Default: on.

HostRecovery string

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

InstanceFamily string

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

InstanceType string

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

OutpostArn string

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

Tags Dictionary<string, string>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

AvailabilityZone string

The Availability Zone in which to allocate the Dedicated Host.

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. Valid values: on, off. Default: on.

HostRecovery string

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

InstanceFamily string

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

InstanceType string

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

OutpostArn string

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

Tags map[string]string

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

availabilityZone String

The Availability Zone in which to allocate the Dedicated Host.

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. Valid values: on, off. Default: on.

hostRecovery String

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

instanceFamily String

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

instanceType String

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

outpostArn String

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

tags Map<String,String>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

availabilityZone string

The Availability Zone in which to allocate the Dedicated Host.

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. Valid values: on, off. Default: on.

hostRecovery string

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

instanceFamily string

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

instanceType string

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

outpostArn string

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

tags {[key: string]: string}

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

availability_zone str

The Availability Zone in which to allocate the Dedicated Host.

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. Valid values: on, off. Default: on.

host_recovery str

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

instance_family str

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

instance_type str

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

outpost_arn str

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

tags Mapping[str, str]

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

availabilityZone String

The Availability Zone in which to allocate the Dedicated Host.

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. Valid values: on, off. Default: on.

hostRecovery String

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

instanceFamily String

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

instanceType String

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

outpostArn String

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

tags Map<String>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

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

Arn string

The ARN of the Dedicated Host.

Id string

The provider-assigned unique ID for this managed resource.

OwnerId string

The ID of the AWS account that owns the Dedicated Host.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The ARN of the Dedicated Host.

Id string

The provider-assigned unique ID for this managed resource.

OwnerId string

The ID of the AWS account that owns the Dedicated Host.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The ARN of the Dedicated Host.

id String

The provider-assigned unique ID for this managed resource.

ownerId String

The ID of the AWS account that owns the Dedicated Host.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The ARN of the Dedicated Host.

id string

The provider-assigned unique ID for this managed resource.

ownerId string

The ID of the AWS account that owns the Dedicated Host.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The ARN of the Dedicated Host.

id str

The provider-assigned unique ID for this managed resource.

owner_id str

The ID of the AWS account that owns the Dedicated Host.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The ARN of the Dedicated Host.

id String

The provider-assigned unique ID for this managed resource.

ownerId String

The ID of the AWS account that owns the Dedicated Host.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up 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,
        arn: Optional[str] = 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,
        outpost_arn: Optional[str] = None,
        owner_id: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: 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)
public static DedicatedHost get(String name, Output<String> id, DedicatedHostState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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:
Arn string

The ARN of the Dedicated Host.

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. Valid values: on, off. Default: on.

AvailabilityZone string

The Availability Zone in which to allocate the Dedicated Host.

HostRecovery string

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

InstanceFamily string

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

InstanceType string

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

OutpostArn string

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

OwnerId string

The ID of the AWS account that owns the Dedicated Host.

Tags Dictionary<string, string>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The ARN of the Dedicated Host.

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. Valid values: on, off. Default: on.

AvailabilityZone string

The Availability Zone in which to allocate the Dedicated Host.

HostRecovery string

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

InstanceFamily string

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

InstanceType string

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

OutpostArn string

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

OwnerId string

The ID of the AWS account that owns the Dedicated Host.

Tags map[string]string

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The ARN of the Dedicated Host.

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. Valid values: on, off. Default: on.

availabilityZone String

The Availability Zone in which to allocate the Dedicated Host.

hostRecovery String

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

instanceFamily String

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

instanceType String

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

outpostArn String

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

ownerId String

The ID of the AWS account that owns the Dedicated Host.

tags Map<String,String>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The ARN of the Dedicated Host.

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. Valid values: on, off. Default: on.

availabilityZone string

The Availability Zone in which to allocate the Dedicated Host.

hostRecovery string

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

instanceFamily string

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

instanceType string

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

outpostArn string

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

ownerId string

The ID of the AWS account that owns the Dedicated Host.

tags {[key: string]: string}

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The ARN of the Dedicated Host.

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. Valid values: on, off. Default: on.

availability_zone str

The Availability Zone in which to allocate the Dedicated Host.

host_recovery str

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

instance_family str

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

instance_type str

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

outpost_arn str

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

owner_id str

The ID of the AWS account that owns the Dedicated Host.

tags Mapping[str, str]

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The ARN of the Dedicated Host.

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. Valid values: on, off. Default: on.

availabilityZone String

The Availability Zone in which to allocate the Dedicated Host.

hostRecovery String

Indicates whether to enable or disable host recovery for the Dedicated Host. Valid values: on, off. Default: off.

instanceFamily String

Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family. Exactly one of instance_family or instance_type must be specified.

instanceType String

Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only. Exactly one of instance_family or instance_type must be specified.

outpostArn String

The Amazon Resource Name (ARN) of the AWS Outpost on which to allocate the Dedicated Host.

ownerId String

The ID of the AWS account that owns the Dedicated Host.

tags Map<String>

Map of tags to assign to this resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Import

Hosts can be imported using the host id, e.g.,

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

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.