Resource: aws_ec2_host

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

Example Usage

# Create a new host with instance type of c5.18xlarge with Auto Placement
# and Host Recovery enabled.
resource "aws_ec2_host" "test" {
  instance_type     = "c5.18xlarge"
  availability_zone = "us-west-2a"
  host_recovery     = "on"
  auto_placement    = "on"
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import hosts using the host id. For example:

import {
  to = aws_ec2_host.example
  id = "h-0385a99d0e4b20cbb"
}

Using terraform import, import hosts using the host id. For example:

% terraform import aws_ec2_host.example h-0385a99d0e4b20cbb