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_capacity_reservation: Refactor tagging logic to keyvaluetags package #10775

Merged

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:

NONE

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSEc2CapacityReservation_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSEc2CapacityReservation_ -timeout 120m
=== RUN   TestAccAWSEc2CapacityReservation_basic
=== PAUSE TestAccAWSEc2CapacityReservation_basic
=== RUN   TestAccAWSEc2CapacityReservation_ebsOptimized
=== PAUSE TestAccAWSEc2CapacityReservation_ebsOptimized
=== RUN   TestAccAWSEc2CapacityReservation_endDate
=== PAUSE TestAccAWSEc2CapacityReservation_endDate
=== RUN   TestAccAWSEc2CapacityReservation_endDateType
=== PAUSE TestAccAWSEc2CapacityReservation_endDateType
=== RUN   TestAccAWSEc2CapacityReservation_ephemeralStorage
=== PAUSE TestAccAWSEc2CapacityReservation_ephemeralStorage
=== RUN   TestAccAWSEc2CapacityReservation_instanceCount
=== PAUSE TestAccAWSEc2CapacityReservation_instanceCount
=== RUN   TestAccAWSEc2CapacityReservation_instanceMatchCriteria
=== PAUSE TestAccAWSEc2CapacityReservation_instanceMatchCriteria
=== RUN   TestAccAWSEc2CapacityReservation_instanceType
=== PAUSE TestAccAWSEc2CapacityReservation_instanceType
=== RUN   TestAccAWSEc2CapacityReservation_tags
=== PAUSE TestAccAWSEc2CapacityReservation_tags
=== RUN   TestAccAWSEc2CapacityReservation_tenancy
--- SKIP: TestAccAWSEc2CapacityReservation_tenancy (0.00s)
    resource_aws_ec2_capacity_reservation_test.go:363: EC2 Capacity Reservations do not currently support dedicated tenancy.
=== CONT  TestAccAWSEc2CapacityReservation_basic
=== CONT  TestAccAWSEc2CapacityReservation_tags
=== CONT  TestAccAWSEc2CapacityReservation_instanceType
=== CONT  TestAccAWSEc2CapacityReservation_instanceMatchCriteria
=== CONT  TestAccAWSEc2CapacityReservation_instanceCount
=== CONT  TestAccAWSEc2CapacityReservation_ephemeralStorage
=== CONT  TestAccAWSEc2CapacityReservation_endDateType
=== CONT  TestAccAWSEc2CapacityReservation_endDate
=== CONT  TestAccAWSEc2CapacityReservation_ebsOptimized
--- PASS: TestAccAWSEc2CapacityReservation_ebsOptimized (21.29s)
--- PASS: TestAccAWSEc2CapacityReservation_ephemeralStorage (21.32s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceMatchCriteria (21.43s)
--- PASS: TestAccAWSEc2CapacityReservation_basic (21.70s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceCount (35.18s)
--- PASS: TestAccAWSEc2CapacityReservation_endDate (35.47s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceType (36.33s)
--- PASS: TestAccAWSEc2CapacityReservation_endDateType (46.01s)
--- PASS: TestAccAWSEc2CapacityReservation_tags (47.22s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	47.276s

@ewbankkit ewbankkit requested a review from a team November 6, 2019 22:13
@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 6, 2019
@@ -182,10 +183,10 @@ func TestAccAWSEc2CapacityReservation_endDateType(t *testing.T) {
ImportStateVerify: true,
},
{
Config: testAccEc2CapacityReservationConfig_endDate("2019-10-31T07:39:57Z"),
Config: testAccEc2CapacityReservationConfig_endDate(endDate),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Else

--- FAIL: TestAccAWSEc2CapacityReservation_endDateType (28.84s)
    testing.go:615: Step 2 error: errors during apply:
        
        Error: Error modifying EC2 Capacity Reservation: InvalidParameterValue: The specified EndDate has already passed. Specify an EndDate in the future.
        	status code: 400, request id: 1dca56a0-3db9-40bf-9d6c-e8b2618ea8a0
        
          on /tmp/tf-test066699505/main.tf line 4:
          (source code not available)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for fixing this!

@bflad bflad added the technical-debt Addresses areas of the codebase that need refactoring or redesign. label Nov 7, 2019
@bflad bflad added this to the v2.35.0 milestone Nov 7, 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: TestAccAWSEc2CapacityReservation_tenancy (0.00s)
--- PASS: TestAccAWSEc2CapacityReservation_ephemeralStorage (11.85s)
--- PASS: TestAccAWSEc2CapacityReservation_ebsOptimized (12.03s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceMatchCriteria (13.00s)
--- PASS: TestAccAWSEc2CapacityReservation_basic (13.05s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceCount (18.59s)
--- PASS: TestAccAWSEc2CapacityReservation_endDate (19.48s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceType (19.68s)
--- PASS: TestAccAWSEc2CapacityReservation_tags (24.69s)
--- PASS: TestAccAWSEc2CapacityReservation_endDateType (24.72s)

@bflad bflad merged commit fb404a8 into hashicorp:master Nov 7, 2019
@ewbankkit ewbankkit deleted the ec2-capacity-reservation-keyvaluetags branch November 7, 2019 11:50
@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
service/ec2 Issues and PRs that pertain to the ec2 service. size/S Managed by automation to categorize the size of a PR. technical-debt Addresses areas of the codebase that need refactoring or redesign. 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