You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error Encountered When Building AMI with capacity_reservation_id
I'm currently attempting to utilize the capacity_reservation_id attribute in Packer to launch the template. However, I keep encountering the following error: Build 'amazon-ebs.autogenerated_1' errored after 1 second 875 milliseconds: Error launching source instance: InvalidParameterCombination: The request can include either a CapacityReservationId or a CapacityReservationPreference but not both.
Describes an instance's Capacity Reservation targeting option. You can specify only one parameter at a time. If you specify CapacityReservationPreference and CapacityReservationTarget, the request fails
Any help would be much appreciated.
Thank you!
The text was updated successfully, but these errors were encountered:
I've opened a PR that should address your case, I've added a bunch of unit tests for Prepare, but I'm a firm believer in real-life testing :)
Would you be able to build the plugin and test building your configuration with it? If the change I made works, I believe this should fix your issue, but please let me know if this is really the case.
Error Encountered When Building AMI with capacity_reservation_id
I'm currently attempting to utilize the capacity_reservation_id attribute in Packer to launch the template. However, I keep encountering the following error:
Build 'amazon-ebs.autogenerated_1' errored after 1 second 875 milliseconds: Error launching source instance: InvalidParameterCombination: The request can include either a CapacityReservationId or a CapacityReservationPreference but not both.
Reproduction Steps
Steps to reproduce this issue
Packer version
1.10.2
Simplified Packer Template
The problem lies in the code block between lines 890 and 892 of the following file: https://github.com/hashicorp/packer-plugin-amazon/blob/01cd50e05c90d905af09cc298b24011ec3227cd9/builder/common/run_config.go. Ideally, we shouldn't set it to "none" because doing so disables the use of the capacity_reservation_id. According to AWS, we can only pass one parameter in this scenario. Ref: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CapacityReservationSpecification.html
Any help would be much appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: