Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to allocate dedicated hosts for VMs #10752

Closed
paultyng opened this issue Nov 5, 2019 · 7 comments · Fixed by #10817
Closed

Add ability to allocate dedicated hosts for VMs #10752

paultyng opened this issue Nov 5, 2019 · 7 comments · Fixed by #10817
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-data-source Introduces a new data source. new-resource Introduces a new resource. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@paultyng
Copy link
Contributor

paultyng commented Nov 5, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Add ability to allocate dedicated hosts for VMs.

API Methods: AllocateHosts, ReleaseHosts, ModifyHosts, DescribeHosts.

(Note that these methods seem to work in aggregate, not sure if they can easily be unwound to a singular resource).

New or Affected Resource(s)

  • aws_ec2_dedicated_host

Potential Terraform Configuration

resource "aws_ec2_dedicated_host" "example" {
  auto_placement = ""
  availability_zone = ""
  host_recovery = ""
  instance_type = ""
  tags = {}
}

data "aws_ec2_dedicated_host" "example" {
  filters {}

  tags = {}
}

References

@paultyng paultyng added enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. new-data-source Introduces a new data source. labels Nov 5, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 5, 2019
@hotdawg789
Copy link

hotdawg789 commented Nov 5, 2019

Perfect timing @paultyng . I just got done writing some boto3 to support this in my build pipeline... having it in terraform would be ideal, i forgot life without TFSTATE

@bflad bflad added service/ec2 Issues and PRs that pertain to the ec2 service. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 6, 2019
@rpomykala
Copy link
Contributor

My PR #10817 is ready for review, let me know if there's any way I can help further with getting this functionality added!

@marcincuber
Copy link

marcincuber commented Dec 1, 2020

Just want to add that this new resource would be mega useful to have as Mac instances are now available. Mac instances require dedicated host of type mac1.metal.

Otherwise we will have to stick to using CLI:

aws ec2 allocate-hosts --instance-type mac1.metal \
  --availability-zone eu-west-1a --auto-placement on \
  --quantity 1 --region eu-west-1

@jcollado
Copy link

@marcincuber As a workaround, note that you can call cloudformation from terraform:

resource "aws_cloudformation_stack" "dedicated_host" {
  name = "dedicated-host"
  template_body = jsonencode(
    {
      Description = "Dedicated host"
      Resources = {
        Host = {
          Type = "AWS::EC2::Host"
          Properties = {
            AvailabilityZone = <availability_zone>
            InstanceType     = <instance_type>
          }
        }
      }
      Outputs = {
        HostId = {
          Description = "Dedicated Host ID"
          Value = {
            Ref = "Host"
          }
        }
      }
    }
  )
  tags = <tags>
}

resource "aws_instance" "mac" {
  ...
  host_id                = aws_cloudformation_stack.dedicated_host.outputs.HostId
  ...
}

This is actually what this module from the registry does:
https://registry.terraform.io/modules/DanielRDias/dedicated-host/aws/latest

@scottmalkie
Copy link

Hello! Is there anything we can do to help accelerate this work? It looks like there is a PR waiting to be merged that adds this functionality.

@github-actions github-actions bot added this to the v3.61.0 milestone Sep 27, 2021
@github-actions
Copy link

github-actions bot commented Oct 7, 2021

This functionality has been released in v3.61.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

github-actions bot commented Jun 4, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-data-source Introduces a new data source. new-resource Introduces a new resource. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants