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

Placement GroupName being specified causing conflict with HostResourceGroupArn #16995

Closed
mkey0bc opened this issue Jan 6, 2021 · 3 comments · Fixed by #26532
Closed

Placement GroupName being specified causing conflict with HostResourceGroupArn #16995

mkey0bc opened this issue Jan 6, 2021 · 3 comments · Fixed by #26532
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. service/licensemanager Issues and PRs that pertain to the licensemanager service.
Milestone

Comments

@mkey0bc
Copy link

mkey0bc commented Jan 6, 2021

AWS_INSTANCE resource instance fails to deploy to a dedicated host resource group using an AMI registered with license manager.

It appears that the placement property GroupName is being set even though the HostResourceGroupArn property is being specified by the registered AMI from license manager.

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 other comments that do not add relevant new information or questions, 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

Terraform CLI and Terraform AWS Provider Version

Terraform v0.14.3

Affected Resource(s)

  • aws v3.22.0

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

provider "aws" {
  profile = "my-profile"
  region  = "us-west-2"
}

resource "aws_instance" "hosttest" {
  ami           = "ami-###########"
  instance_type = "r5.large"
  subnet_id = "subnet-############"

  tags = {
    Name = "host-test"
  }
}

Debug Output

Panic Output

Expected Behavior

EC2 instance deployed on dedicated host resource group.

Actual Behavior

Error: Error launching source instance: InvalidParameterValue: Invalid value 'When HostResourceGroupArn is specified, Placement GroupName cannot be set.' for groupName.
        status code: 400, request id: 92732a93-966a-4123-96aa-08dcac07e380

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Jan 6, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 6, 2021
@breathingdust breathingdust added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 16, 2021
@YakDriver
Copy link
Member

YakDriver commented Aug 29, 2022

@mkey0bc Thank you for raising this issue. We believe that #26532 will resolve the issue. However, since we cannot test the functionality, please let us know if it works for you (likely v4.29.0).

The crux of the problem results fromplacement_group (ec2.RunInstanceInput.Placement.GroupName) always being set in API calls, even if to an empty string, if instance interruption behavior was not set or set to terminate. ec2.RunInstanceInput.Placement.GroupName cannot be set if launching in a License Manager (dedicated) host resource group. Even though the host_resource_group_arn argument was not previously available, the association can be done implicitly based on the AMI ID and the host resource group being set to "Allocate hosts automatically."

The solution is ensure that if placement_group is not set, ec2.RunInstanceInput.Placement.GroupName is also not set.

@YakDriver YakDriver added the service/licensemanager Issues and PRs that pertain to the licensemanager service. label Aug 29, 2022
@github-actions github-actions bot added this to the v4.29.0 milestone Aug 30, 2022
@github-actions
Copy link

github-actions bot commented Sep 2, 2022

This functionality has been released in v4.29.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 Oct 3, 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 Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service. service/licensemanager Issues and PRs that pertain to the licensemanager service.
Projects
None yet
3 participants