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

Adding minimum to support host_resource_group_arn #15785

Conversation

preflightsiren
Copy link
Contributor

@preflightsiren preflightsiren commented Oct 22, 2020

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #15784

Release note for CHANGELOG:

Adds support for host_resource_group_arn in launch_template placement.

Output from acceptance testing:

I haven't written any acceptance tests specifically for this change; I can't see any similar tests for other placement values. Some guidance would be useful here.

I have tested it locally against existing Launch Templates.

➜  terraform apply
data.terraform_remote_state.vpc: Refreshing state...
data.aws_launch_template.lt: Refreshing state...

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

output = {
  "arn" = "arn:aws:ec2:us-west-2:xxxxxxxxxx:launch-template/lt-xxxxxxxxxx"
... snip ...
"placement" = [
    {
      "affinity" = ""
      "availability_zone" = "us-west-2a"
      "group_name" = ""
      "host_id" = ""
      "host_resource_group_arn" = "arn:aws:resource-groups:us-west-2:xxxxxxxxxx:group/groupName"
      "partition_number" = 0
      "spread_domain" = ""
      "tenancy" = "host"
    },
  ]

...

creating a template:

Terraform will perform the following actions:

  # aws_launch_template. the_launch_template will be created
  + resource "aws_launch_template" "the_launch_template" {
      ...
      + placement {
          + availability_zone       = "us-west-2a"
          + host_resource_group_arn = "arn:aws:resource-groups:us-west-2:xxxxxxxxxx:group/groupName"
          + tenancy                 = "host"
        }
...
    }

Plan: 1 to add, 0 to change, 0 to destroy.

@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. documentation Introduces or discusses updates to documentation. labels Oct 22, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 22, 2020
@preflightsiren preflightsiren marked this pull request as ready for review October 23, 2020 02:22
@preflightsiren preflightsiren requested a review from a team October 23, 2020 02:22
@preflightsiren preflightsiren changed the title WIP: Adding minimum to support host_resource_group_arn Adding minimum to support host_resource_group_arn Oct 23, 2020
Base automatically changed from master to main January 23, 2021 00:59
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:59
@bflad bflad self-assigned this Apr 28, 2021
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Apr 28, 2021
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hi @preflightsiren 👋 Thank you for submitting this -- it was off to a good start. I will be finishing this up to include acceptance testing so we can get this in the next release. 👍

aws/data_source_aws_launch_template.go Outdated Show resolved Hide resolved
@bflad
Copy link
Contributor

bflad commented Apr 28, 2021

With additional acceptance test --

Output from acceptance testing:

--- PASS: TestAccAWSLaunchTemplate_associateCarrierIPAddress (113.88s)
--- PASS: TestAccAWSLaunchTemplate_associatePublicIPAddress (112.32s)
--- PASS: TestAccAWSLaunchTemplate_basic (26.20s)
--- PASS: TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS (62.22s)
--- PASS: TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS_DeleteOnTermination (80.25s)
--- PASS: TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS_Gp3 (67.53s)
--- PASS: TestAccAWSLaunchTemplate_capacityReservation_preference (30.12s)
--- PASS: TestAccAWSLaunchTemplate_capacityReservation_target (32.17s)
--- PASS: TestAccAWSLaunchTemplate_cpuOptions (20.02s)
--- PASS: TestAccAWSLaunchTemplate_creditSpecification_nonBurstable (23.74s)
--- PASS: TestAccAWSLaunchTemplate_creditSpecification_t2 (27.49s)
--- PASS: TestAccAWSLaunchTemplate_creditSpecification_t3 (26.61s)
--- PASS: TestAccAWSLaunchTemplate_data (31.18s)
--- PASS: TestAccAWSLaunchTemplate_defaultVersion (66.15s)
--- PASS: TestAccAWSLaunchTemplate_description (49.72s)
--- PASS: TestAccAWSLaunchTemplate_disappears (21.60s)
--- PASS: TestAccAWSLaunchTemplate_EbsOptimized (90.05s)
--- PASS: TestAccAWSLaunchTemplate_ElasticInferenceAccelerator (48.44s)
--- PASS: TestAccAWSLaunchTemplate_enclaveOptions (70.97s)
--- PASS: TestAccAWSLaunchTemplate_hibernation (70.97s)
--- PASS: TestAccAWSLaunchTemplate_IamInstanceProfile_EmptyConfigurationBlock (23.89s)
--- PASS: TestAccAWSLaunchTemplate_instanceMarketOptions (81.70s)
--- PASS: TestAccAWSLaunchTemplate_licenseSpecification (31.41s)
--- PASS: TestAccAWSLaunchTemplate_metadataOptions (30.40s)
--- PASS: TestAccAWSLaunchTemplate_networkInterface (71.60s)
--- PASS: TestAccAWSLaunchTemplate_networkInterface_ipv6AddressCount (32.24s)
--- PASS: TestAccAWSLaunchTemplate_networkInterface_ipv6Addresses (31.31s)
--- PASS: TestAccAWSLaunchTemplate_networkInterfaceAddresses (71.44s)
--- PASS: TestAccAWSLaunchTemplate_NetworkInterfaces_DeleteOnTermination (85.38s)
--- PASS: TestAccAWSLaunchTemplate_Placement_HostResourceGroupArn (33.94s)
--- PASS: TestAccAWSLaunchTemplate_placement_partitionNum (51.75s)
--- PASS: TestAccAWSLaunchTemplate_tags (49.81s)
--- PASS: TestAccAWSLaunchTemplate_update (80.24s)
--- PASS: TestAccAWSLaunchTemplate_updateDefaultVersion (89.33s)

--- PASS: TestAccAWSLaunchTemplateDataSource_associateCarrierIPAddress (52.34s)
--- PASS: TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress (75.31s)
--- PASS: TestAccAWSLaunchTemplateDataSource_basic (28.98s)
--- PASS: TestAccAWSLaunchTemplateDataSource_enclaveOptions (29.01s)
--- PASS: TestAccAWSLaunchTemplateDataSource_filter_basic (27.33s)
--- PASS: TestAccAWSLaunchTemplateDataSource_filter_tags (26.50s)
--- PASS: TestAccAWSLaunchTemplateDataSource_id_basic (30.08s)
--- PASS: TestAccAWSLaunchTemplateDataSource_metadataOptions (27.67s)
--- PASS: TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination (61.06s)
--- PASS: TestAccAWSLaunchTemplateDataSource_NonExistent (3.34s)

bflad added a commit that referenced this pull request Apr 28, 2021
…resource_group_arn and CHANGELOG for #15785

Output from acceptance testing:

```
--- PASS: TestAccAWSLaunchTemplate_associateCarrierIPAddress (113.88s)
--- PASS: TestAccAWSLaunchTemplate_associatePublicIPAddress (112.32s)
--- PASS: TestAccAWSLaunchTemplate_basic (26.20s)
--- PASS: TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS (62.22s)
--- PASS: TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS_DeleteOnTermination (80.25s)
--- PASS: TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS_Gp3 (67.53s)
--- PASS: TestAccAWSLaunchTemplate_capacityReservation_preference (30.12s)
--- PASS: TestAccAWSLaunchTemplate_capacityReservation_target (32.17s)
--- PASS: TestAccAWSLaunchTemplate_cpuOptions (20.02s)
--- PASS: TestAccAWSLaunchTemplate_creditSpecification_nonBurstable (23.74s)
--- PASS: TestAccAWSLaunchTemplate_creditSpecification_t2 (27.49s)
--- PASS: TestAccAWSLaunchTemplate_creditSpecification_t3 (26.61s)
--- PASS: TestAccAWSLaunchTemplate_data (31.18s)
--- PASS: TestAccAWSLaunchTemplate_defaultVersion (66.15s)
--- PASS: TestAccAWSLaunchTemplate_description (49.72s)
--- PASS: TestAccAWSLaunchTemplate_disappears (21.60s)
--- PASS: TestAccAWSLaunchTemplate_EbsOptimized (90.05s)
--- PASS: TestAccAWSLaunchTemplate_ElasticInferenceAccelerator (48.44s)
--- PASS: TestAccAWSLaunchTemplate_enclaveOptions (70.97s)
--- PASS: TestAccAWSLaunchTemplate_hibernation (70.97s)
--- PASS: TestAccAWSLaunchTemplate_IamInstanceProfile_EmptyConfigurationBlock (23.89s)
--- PASS: TestAccAWSLaunchTemplate_instanceMarketOptions (81.70s)
--- PASS: TestAccAWSLaunchTemplate_licenseSpecification (31.41s)
--- PASS: TestAccAWSLaunchTemplate_metadataOptions (30.40s)
--- PASS: TestAccAWSLaunchTemplate_networkInterface (71.60s)
--- PASS: TestAccAWSLaunchTemplate_networkInterface_ipv6AddressCount (32.24s)
--- PASS: TestAccAWSLaunchTemplate_networkInterface_ipv6Addresses (31.31s)
--- PASS: TestAccAWSLaunchTemplate_networkInterfaceAddresses (71.44s)
--- PASS: TestAccAWSLaunchTemplate_NetworkInterfaces_DeleteOnTermination (85.38s)
--- PASS: TestAccAWSLaunchTemplate_Placement_HostResourceGroupArn (33.94s)
--- PASS: TestAccAWSLaunchTemplate_placement_partitionNum (51.75s)
--- PASS: TestAccAWSLaunchTemplate_tags (49.81s)
--- PASS: TestAccAWSLaunchTemplate_update (80.24s)
--- PASS: TestAccAWSLaunchTemplate_updateDefaultVersion (89.33s)

--- PASS: TestAccAWSLaunchTemplateDataSource_associateCarrierIPAddress (52.34s)
--- PASS: TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress (75.31s)
--- PASS: TestAccAWSLaunchTemplateDataSource_basic (28.98s)
--- PASS: TestAccAWSLaunchTemplateDataSource_enclaveOptions (29.01s)
--- PASS: TestAccAWSLaunchTemplateDataSource_filter_basic (27.33s)
--- PASS: TestAccAWSLaunchTemplateDataSource_filter_tags (26.50s)
--- PASS: TestAccAWSLaunchTemplateDataSource_id_basic (30.08s)
--- PASS: TestAccAWSLaunchTemplateDataSource_metadataOptions (27.67s)
--- PASS: TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination (61.06s)
--- PASS: TestAccAWSLaunchTemplateDataSource_NonExistent (3.34s)
```
@bflad bflad merged commit 6c5471c into hashicorp:main Apr 28, 2021
@github-actions github-actions bot added this to the v3.38.0 milestone Apr 28, 2021
@ghost
Copy link

ghost commented Apr 30, 2021

This has been released in version 3.38.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 for triage. Thanks!

@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 May 31, 2021
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. enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for HostResourceGroupArn in aws_launch_template
2 participants