-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/aws_ec2_capacity_reservation: Fix to set ARN from its response and add owner_id attribute #17129
resource/aws_ec2_capacity_reservation: Fix to set ARN from its response and add owner_id attribute #17129
Conversation
@@ -88,6 +88,7 @@ func TestAccAWSEc2CapacityReservation_basic(t *testing.T) { | |||
resource.TestCheckResourceAttr(resourceName, "instance_match_criteria", "open"), | |||
resource.TestCheckResourceAttr(resourceName, "instance_platform", "Linux/UNIX"), | |||
resource.TestCheckResourceAttr(resourceName, "instance_type", "t2.micro"), | |||
resource.TestCheckResourceAttrSet(resourceName, "owner_id"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can verify that the owner_id
is set to the current AWS account ID.
resource.TestCheckResourceAttrSet(resourceName, "owner_id"), | |
testAccCheckResourceAttrAccountID(resourceName, "owner_id"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know that kind of test helper exists. Thank you!
|
@ewbankkit Fixed it so would you review the PR again? 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
$ 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_disappears
=== PAUSE TestAccAWSEc2CapacityReservation_disappears
=== RUN TestAccAWSEc2CapacityReservation_tenancy
provider_test.go:56: EC2 Capacity Reservations do not currently support dedicated tenancy.
--- SKIP: TestAccAWSEc2CapacityReservation_tenancy (0.00s)
=== CONT TestAccAWSEc2CapacityReservation_basic
=== CONT TestAccAWSEc2CapacityReservation_disappears
=== 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_disappears (32.18s)
--- PASS: TestAccAWSEc2CapacityReservation_ephemeralStorage (37.22s)
--- PASS: TestAccAWSEc2CapacityReservation_ebsOptimized (37.94s)
--- PASS: TestAccAWSEc2CapacityReservation_basic (38.23s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceMatchCriteria (38.24s)
--- PASS: TestAccAWSEc2CapacityReservation_endDate (51.76s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceType (51.93s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceCount (52.87s)
--- PASS: TestAccAWSEc2CapacityReservation_endDateType (64.23s)
--- PASS: TestAccAWSEc2CapacityReservation_tags (64.51s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 64.607s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super happy to see these in the API. Thank you, @shuheiktgw 🚀
Output from acceptance testing in AWS Commercial:
--- PASS: TestAccAWSEc2CapacityReservation_disappears (21.93s)
--- PASS: TestAccAWSEc2CapacityReservation_ebsOptimized (25.87s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceMatchCriteria (25.99s)
--- PASS: TestAccAWSEc2CapacityReservation_ephemeralStorage (26.00s)
--- PASS: TestAccAWSEc2CapacityReservation_basic (26.39s)
--- PASS: TestAccAWSEc2CapacityReservation_endDate (37.97s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceCount (38.20s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceType (38.55s)
--- PASS: TestAccAWSEc2CapacityReservation_endDateType (48.65s)
--- PASS: TestAccAWSEc2CapacityReservation_tags (49.90s)
Output from acceptance testing in AWS GovCloud (US):
--- PASS: TestAccAWSEc2CapacityReservation_disappears (25.87s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceMatchCriteria (28.03s)
--- PASS: TestAccAWSEc2CapacityReservation_ephemeralStorage (28.90s)
--- PASS: TestAccAWSEc2CapacityReservation_ebsOptimized (29.25s)
--- PASS: TestAccAWSEc2CapacityReservation_basic (29.76s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceType (42.88s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceCount (44.02s)
--- PASS: TestAccAWSEc2CapacityReservation_endDate (44.05s)
--- PASS: TestAccAWSEc2CapacityReservation_endDateType (57.51s)
--- PASS: TestAccAWSEc2CapacityReservation_tags (58.11s)
arn := arn.ARN{ | ||
Partition: meta.(*AWSClient).partition, | ||
Service: "ec2", | ||
Region: meta.(*AWSClient).region, | ||
AccountID: meta.(*AWSClient).accountid, | ||
Resource: fmt.Sprintf("capacity-reservation/%s", d.Id()), | ||
}.String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When removing this type of manual ARN building, we should double check that it is not in the website/docs/index.html
file skip_requesting_account_id
list of resources that are documented as potentially not working. 👍
…_id documentation and CHANGELOG for #17129
This has been released in version 3.28.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! |
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! |
Community Note
Relates #16978
Release note for CHANGELOG:
Output from acceptance testing:
Thank you for your review! 👍