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

r/aws_ec2_fleet: Refactor tagging logic to keyvaluetags package #10761

Merged
merged 1 commit into from
Nov 6, 2019

Conversation

ewbankkit
Copy link
Contributor

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

Relates #10688.

Release note for CHANGELOG:

resource/aws_ec2_fleet: Updating `tags` no longer recreates the resource

Output from acceptance testing:

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

@ewbankkit ewbankkit requested a review from a team November 5, 2019 23:08
@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 5, 2019
@@ -192,12 +193,7 @@ func resourceAwsEc2Fleet() *schema.Resource {
},
},
},
"tags": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was no reason that updating tags needs to ForceNew.

@@ -475,6 +471,14 @@ func resourceAwsEc2FleetUpdate(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("error waiting for EC2 Fleet (%s) modification: %s", d.Id(), err)
}

if d.HasChange("tags") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tags can be updated without forcing new resource.

@bflad bflad added the enhancement Requests to existing resources that expand the functionality or scope. label Nov 6, 2019
@bflad bflad added this to the v2.35.0 milestone Nov 6, 2019
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.

LGTM, thanks @ewbankkit 🚀

Output from acceptance testing:

--- SKIP: TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_MaxPrice (0.00s)
--- PASS: TestAccAWSEc2Fleet_disappears (42.43s)
--- PASS: TestAccAWSEc2Fleet_basic (42.61s)
--- PASS: TestAccAWSEc2Fleet_TargetCapacitySpecification_DefaultTargetCapacityType (65.16s)
--- PASS: TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_Priority (68.59s)
--- PASS: TestAccAWSEc2Fleet_LaunchTemplateConfig_LaunchTemplateSpecification_Version (68.95s)
--- PASS: TestAccAWSEc2Fleet_SpotOptions_InstanceInterruptionBehavior (69.67s)
--- PASS: TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_WeightedCapacity (69.58s)
--- PASS: TestAccAWSEc2Fleet_SpotOptions_InstancePoolsToUseCount (69.90s)
--- PASS: TestAccAWSEc2Fleet_SpotOptions_AllocationStrategy (71.31s)
--- PASS: TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_AvailabilityZone (71.36s)
--- PASS: TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_Priority_Multiple (71.31s)
--- PASS: TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_InstanceType (71.44s)
--- PASS: TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_WeightedCapacity_Multiple (71.70s)
--- PASS: TestAccAWSEc2Fleet_ReplaceUnhealthyInstances (71.92s)
--- PASS: TestAccAWSEc2Fleet_OnDemandOptions_AllocationStrategy (72.08s)
--- PASS: TestAccAWSEc2Fleet_LaunchTemplateConfig_LaunchTemplateSpecification_LaunchTemplateId (72.12s)
--- PASS: TestAccAWSEc2Fleet_TargetCapacitySpecification_DefaultTargetCapacityType_OnDemand (30.06s)
--- PASS: TestAccAWSEc2Fleet_TargetCapacitySpecification_DefaultTargetCapacityType_Spot (30.11s)
--- PASS: TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_SubnetId (72.82s)
--- PASS: TestAccAWSEc2Fleet_LaunchTemplateConfig_LaunchTemplateSpecification_LaunchTemplateName (73.05s)
--- PASS: TestAccAWSEc2Fleet_ExcessCapacityTerminationPolicy (95.00s)
--- PASS: TestAccAWSEc2Fleet_Type (26.85s)
--- PASS: TestAccAWSEc2Fleet_Tags (97.60s)
--- PASS: TestAccAWSEc2Fleet_TerminateInstancesWithExpiration (48.92s)
--- PASS: TestAccAWSEc2Fleet_TargetCapacitySpecification_TotalTargetCapacity (457.29s)

@bflad bflad merged commit d2163d9 into hashicorp:master Nov 6, 2019
bflad added a commit that referenced this pull request Nov 6, 2019
@ewbankkit ewbankkit deleted the ec2-fleet-keyvaluetags branch November 6, 2019 21:12
@ghost
Copy link

ghost commented Nov 7, 2019

This has been released in version 2.35.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!

@ghost
Copy link

ghost commented Mar 29, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
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. service/ec2 Issues and PRs that pertain to the ec2 service. size/S 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.

2 participants