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 aws_dedicated_host for terraform-provider-aws #10817

Merged
merged 38 commits into from
Sep 27, 2021

Conversation

rpomykala
Copy link
Contributor

@rpomykala rpomykala commented Nov 9, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #10752.

Release note for CHANGELOG:


FEATURES:
New Resource: aws_dedicated_host (#10752)

Output from acceptance testing:

➜ make testacc TEST=./aws TESTARGS='-run=TestAccAWSDedicatedHostDataSource_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSDedicatedHostDataSource_basic -timeout 120m
=== RUN   TestAccAWSDedicatedHostDataSource_basic
=== PAUSE TestAccAWSDedicatedHostDataSource_basic
=== CONT  TestAccAWSDedicatedHostDataSource_basic
--- PASS: TestAccAWSDedicatedHostDataSource_basic (37.40s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	39.065s
...

@rpomykala rpomykala requested a review from a team November 9, 2019 08:43
@ghost ghost added needs-triage Waiting for first response or review from a maintainer. size/L Managed by automation to categorize the size of a PR. provider Pertains to the provider itself, rather than any interaction with AWS. size/XL Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Nov 9, 2019
Copy link

@khyew khyew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly style/idiomatic Go stuff; feel free to address at your leisure. One question about a potential nil pointer situation that I'm not sure about-- if it's a non-issue then feel free to resolve.

Caveat: I'm not super familiar with this codebase do I didn't do a very thorough review of the logic (I'll leave that to the project maintainers and contributors) but nothing stands out to me. Good luck with the PR!

aws/data_source_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/data_source_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/data_source_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/data_source_aws_dedicated_host.go Outdated Show resolved Hide resolved
@ghost ghost added the documentation Introduces or discusses updates to documentation. label Nov 12, 2019
@bflad bflad added 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. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 24, 2020
@bryantbiggs
Copy link
Contributor

@rpomykala / @khyew - any update on this PR? we have a need for dedicated hosts and would love to have this make its way into the provider. let me know if there is anything left to resolve and we can pitch in to get it across the line

@ghost ghost added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Apr 10, 2020
@rpomykala rpomykala changed the title [WIP] Add aws_dedicated_host for terraform-provider-aws Add aws_dedicated_host for terraform-provider-aws Apr 10, 2020
@rpomykala
Copy link
Contributor Author

Sorry for long time of inactivity, I have updated the module with MVP required to make it all work for anyone who needs it urgently.

@hotdawg789
Copy link

Excited to see this feature, can get rid of my boto/python pre tf build scripts :-)

aws/resource_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/resource_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/resource_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/resource_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/resource_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/resources_aws_dedicated_host_test.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@DrFaust92 DrFaust92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more comments:

  • the resources_aws_dedicated_host_test needs to be rename to data_source_aws_dedicate_host_test
  • add docs for data source
  • add tests for the resource

aws/data_source_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/data_source_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/resource_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/resource_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/resource_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/data_source_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/data_source_aws_dedicated_host.go Outdated Show resolved Hide resolved
aws/resources_aws_dedicated_host_test.go Outdated Show resolved Hide resolved
website/docs/r/dedicated_host.html.markdown Outdated Show resolved Hide resolved
aws/resources_aws_dedicated_host_test.go Outdated Show resolved Hide resolved
@bryantbiggs
Copy link
Contributor

@khyew / @DrFaust92 - anything we can do to help @rpomykala get this merged? they have updated several times but still no signs of when it will be ready to merge

@teamterraform
Copy link

Notification of Recent and Upcoming Changes to Contributions

Thank you for this contribution! There have been a few recent development changes that affect this pull request. We apologize for the inconvenience, especially if there have been long review delays up until now. Please note that this is automated message from an unmonitored account. See the FAQ for additional information on the maintainer team and review prioritization.

If you are unable to complete these updates, please leave a comment for the community and maintainers so someone can potentially continue the work. The maintainers will encourage other contributors to use the existing contribution as the base for additional changes as appropriate. Otherwise, contributions that do not receive updated code or comments from the original contributor may be closed in the future so the maintainers can focus on active items.

For the most up to date information about Terraform AWS Provider development, see the Contributing Guide. Additional technical debt changes can be tracked with the technical-debt label on issues.

As part of updating a pull request with these changes, the most current unit testing and linting will run. These may report issues that were not previously reported.

Action Required: Terraform 0.12 Syntax

Reference: #8950
Reference: #14417

Version 3 and later of the Terraform AWS Provider, which all existing contributions would potentially be added, only supports Terraform 0.12 and later. Certain syntax elements of Terraform 0.11 and earlier show deprecation warnings during runs with Terraform 0.12. Documentation and test configurations, such as those including deprecated string interpolations (some_attribute = "${aws_service_thing.example.id}") should be updated to the newer syntax (some_attribute = aws_service_thing.example.id). Contribution testing will automatically fail on older syntax in the near future. Please see the referenced issues for additional information.

Action Required: Terraform Plugin SDK Version 2

Reference: #14551

The Terraform AWS Provider has been upgraded to the latest version of the Terraform Plugin SDK. Generally, most changes to contributions should only involve updating Go import paths in source code files. Please see the referenced issue for additional information.

Action Required: Removal of website/aws.erb File

Reference: #14712

Any changes to the website/aws.erb file are no longer necessary and should be removed from this contribution to prevent merge issues in the near future when the file is removed from the repository. Please see the referenced issue for additional information.

Upcoming Change of Git Branch Naming

Reference: #14292

Development environments will need their upstream Git branch updated from master to main in the near future. Please see the referenced issue for additional information and scheduling.

Upcoming Change of GitHub Organization

Reference: #14715

This repository will be migrating from https://github.com/terraform-providers/terraform-provider-aws to https://github.com/hashicorp/terraform-provider-aws. No practitioner or developer action is anticipated and most GitHub functionality will automatically redirect to the new location. Go import paths including terraform-providers can remain for now. Please see the referenced issue for additional information and scheduling.

@vasylenko
Copy link
Contributor

This feature will be handy in the context of the recent release of macOS support for EC2!

Base automatically changed from master to main January 23, 2021 00:56
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:56
@keith
Copy link

keith commented Aug 19, 2021

We'd love to see this for ec2 macOS support as well!

@ewbankkit ewbankkit force-pushed the dedicated-host-branch branch from c9557f1 to f190485 Compare September 24, 2021 21:18
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

Commercial
% make testacc TESTARGS='-run=TestAccAWSEc2Host_\|TestAccAWSEc2HostDataSource_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSEc2Host_\|TestAccAWSEc2HostDataSource_ -timeout 180m
=== RUN   TestAccAWSEc2HostDataSource_basic
=== PAUSE TestAccAWSEc2HostDataSource_basic
=== RUN   TestAccAWSEc2HostDataSource_Filter
=== PAUSE TestAccAWSEc2HostDataSource_Filter
=== RUN   TestAccAWSEc2Host_basic
=== PAUSE TestAccAWSEc2Host_basic
=== RUN   TestAccAWSEc2Host_disappears
=== PAUSE TestAccAWSEc2Host_disappears
=== RUN   TestAccAWSEc2Host_InstanceFamily
=== PAUSE TestAccAWSEc2Host_InstanceFamily
=== RUN   TestAccAWSEc2Host_Tags
=== PAUSE TestAccAWSEc2Host_Tags
=== CONT  TestAccAWSEc2HostDataSource_basic
=== CONT  TestAccAWSEc2Host_InstanceFamily
=== CONT  TestAccAWSEc2Host_basic
=== CONT  TestAccAWSEc2HostDataSource_Filter
=== CONT  TestAccAWSEc2Host_disappears
=== CONT  TestAccAWSEc2Host_Tags
--- PASS: TestAccAWSEc2Host_disappears (19.99s)
--- PASS: TestAccAWSEc2HostDataSource_basic (24.32s)
--- PASS: TestAccAWSEc2HostDataSource_Filter (24.35s)
--- PASS: TestAccAWSEc2Host_basic (26.18s)
--- PASS: TestAccAWSEc2Host_InstanceFamily (37.39s)
--- PASS: TestAccAWSEc2Host_Tags (49.11s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	52.966s
GovCloud
% make testacc TESTARGS='-run=TestAccAWSEc2Host_\|TestAccAWSEc2HostDataSource_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSEc2Host_\|TestAccAWSEc2HostDataSource_ -timeout 180m
=== RUN   TestAccAWSEc2HostDataSource_basic
=== PAUSE TestAccAWSEc2HostDataSource_basic
=== RUN   TestAccAWSEc2HostDataSource_Filter
=== PAUSE TestAccAWSEc2HostDataSource_Filter
=== RUN   TestAccAWSEc2Host_basic
=== PAUSE TestAccAWSEc2Host_basic
=== RUN   TestAccAWSEc2Host_disappears
=== PAUSE TestAccAWSEc2Host_disappears
=== RUN   TestAccAWSEc2Host_InstanceFamily
=== PAUSE TestAccAWSEc2Host_InstanceFamily
=== RUN   TestAccAWSEc2Host_Tags
=== PAUSE TestAccAWSEc2Host_Tags
=== CONT  TestAccAWSEc2HostDataSource_basic
=== CONT  TestAccAWSEc2Host_InstanceFamily
=== CONT  TestAccAWSEc2Host_Tags
=== CONT  TestAccAWSEc2Host_basic
=== CONT  TestAccAWSEc2Host_disappears
=== CONT  TestAccAWSEc2HostDataSource_Filter
=== CONT  TestAccAWSEc2HostDataSource_basic
    provider_test.go:1166: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error allocating EC2 Host: UnsupportedHostConfiguration: The requested configuration is currently not supported. Please check the documentation for supported configurations.
        	status code: 400, request id: e615d2d2-ee12-45fc-8329-744e3d386083
        
          with aws_ec2_host.test,
          on terraform_plugin_test.tf line 11, in resource "aws_ec2_host" "test":
          11: resource "aws_ec2_host" "test" {
        
=== CONT  TestAccAWSEc2Host_disappears
    provider_test.go:1166: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error allocating EC2 Host: UnsupportedHostConfiguration: The requested configuration is currently not supported. Please check the documentation for supported configurations.
        	status code: 400, request id: b74fbd7e-fae7-45bb-bf83-4d90c7d896b6
        
          with aws_ec2_host.test,
          on terraform_plugin_test.tf line 11, in resource "aws_ec2_host" "test":
          11: resource "aws_ec2_host" "test" {
        
=== CONT  TestAccAWSEc2Host_Tags
    provider_test.go:1166: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error allocating EC2 Host: UnsupportedHostConfiguration: The requested configuration is currently not supported. Please check the documentation for supported configurations.
        	status code: 400, request id: 04b7e281-e827-40e5-beeb-470525696ea9
        
          with aws_ec2_host.test,
          on terraform_plugin_test.tf line 11, in resource "aws_ec2_host" "test":
          11: resource "aws_ec2_host" "test" {
        
=== CONT  TestAccAWSEc2HostDataSource_Filter
    provider_test.go:1166: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error allocating EC2 Host: UnsupportedHostConfiguration: The requested configuration is currently not supported. Please check the documentation for supported configurations.
        	status code: 400, request id: 66f9b95e-efa0-4673-b8d2-212065e7ec3a
        
          with aws_ec2_host.test,
          on terraform_plugin_test.tf line 11, in resource "aws_ec2_host" "test":
          11: resource "aws_ec2_host" "test" {
        
=== CONT  TestAccAWSEc2Host_basic
    provider_test.go:1166: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error allocating EC2 Host: UnsupportedHostConfiguration: The requested configuration is currently not supported. Please check the documentation for supported configurations.
        	status code: 400, request id: 200aaaf1-7dfd-4ed5-8642-0918037a89cf
        
          with aws_ec2_host.test,
          on terraform_plugin_test.tf line 11, in resource "aws_ec2_host" "test":
          11: resource "aws_ec2_host" "test" {
        
--- SKIP: TestAccAWSEc2Host_Tags (12.93s)
--- SKIP: TestAccAWSEc2Host_disappears (12.99s)
--- SKIP: TestAccAWSEc2HostDataSource_basic (13.08s)
--- SKIP: TestAccAWSEc2Host_basic (13.14s)
--- SKIP: TestAccAWSEc2HostDataSource_Filter (13.20s)
--- PASS: TestAccAWSEc2Host_InstanceFamily (42.58s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	47.515s

@ewbankkit
Copy link
Contributor

@rpomykala Thanks for the contribution 🎉 👏.

I went ahead and renamed the resource to aws_ec2_host to match our preferred naming standards.

@ewbankkit ewbankkit merged commit 47bf15a into hashicorp:main Sep 27, 2021
@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

I'm going to lock this pull request 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 related to this change, 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 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-data-source Introduces a new data source. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to allocate dedicated hosts for VMs
10 participants