-
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: New resource #6291
Conversation
18311a9
to
297c3a0
Compare
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.
Thanks for submitting this @gazoakley! Its off to a great start -- left some comments below and we should be able to get this in afterwards. Please let us know if you have any questions or do not have time to implement these items. Thanks!
|
||
* `availability_zone` - (Required) The Availability Zone in which to create the Capacity Reservation. | ||
* `ebs_optimized` - (Optional) Indicates whether the Capacity Reservation supports EBS-optimized instances. | ||
* `end_date` - (Optional) The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. |
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.
We should probably include a note about it being in RFC3339 format as well.
* `end_date` - (Optional) The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. | |
* `end_date` - (Optional) The date and time at which the Capacity Reservation expires. When a Capacity Reservation expires, the reserved capacity is released and you can no longer launch instances into it. Valid values: [RFC3339 time string](https://tools.ietf.org/html/rfc3339#section-5.8) (`YYYY-MM-DDTHH:MM:SSZ`) |
Thanks @bflad - I'll take a look later 👍 |
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.
Thanks so much for all your work here, @gazoakley! This was really really close. 😄
I found these after running the acceptance testing:
--- FAIL: TestAccAWSEc2CapacityReservation_tags (10.12s)
testing.go:538: Step 0 error: Check failed: Check 2/3 error: aws_ec2_capacity_reservation.default: Attribute 'tags.%' expected "1", got "0"
--- FAIL: TestAccAWSEc2CapacityReservation_endDate (14.53s)
testing.go:538: Step 1 error: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
(map[string]string) {
}
(map[string]string) (len=1) {
(string) (len=8) "end_date": (string) (len=20) "2019-10-31T07:39:57Z"
}
--- PASS: TestAccAWSEc2CapacityReservation_basic (14.56s)
They just required some minor adjustments in the resource. I also augmented the acceptance testing to cover all the attributes along with updates so we could release this today. I hope you don't mind. 😅
--- SKIP: TestAccAWSEc2CapacityReservation_tenancy (0.00s)
resource_aws_ec2_capacity_reservation_test.go:357: EC2 Capacity Reservations do not currently support dedicated tenancy.
--- PASS: TestAccAWSEc2CapacityReservation_ephemeralStorage (15.02s)
--- PASS: TestAccAWSEc2CapacityReservation_ebsOptimized (15.04s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceMatchCriteria (15.28s)
--- PASS: TestAccAWSEc2CapacityReservation_basic (15.30s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceCount (24.59s)
--- PASS: TestAccAWSEc2CapacityReservation_endDate (24.78s)
--- PASS: TestAccAWSEc2CapacityReservation_instanceType (25.39s)
--- PASS: TestAccAWSEc2CapacityReservation_endDateType (33.18s)
--- PASS: TestAccAWSEc2CapacityReservation_tags (35.14s)
This has been released in version 1.42.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
Hey, how can a capacity reservation be targeted when creating aws_intance resource? Was this added as part of this enhancement, because I am unable to find it? Thanks. |
Just came upon this, Im creating a capacity reservation and ec2 in terraform and need to target the capacity reservation for the instance, is this possibe? terraform 0.11.14 |
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! |
Fixes #6289
Changes proposed in this pull request:
aws_ec2_capacity_reservation
resourceOutput from acceptance testing: