terraform-aws-modules / terraform-aws-ec2-instance

Terraform module to create AWS EC2 instance(s) resources πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/ec2-instance/aws
Apache License 2.0
754 stars 1.87k forks source link

fix: The capacity_reservation_specification default value is updated from null to {} #285

Closed schniber closed 2 years ago

schniber commented 2 years ago

Description

The default value for the capacity_reservation_specification is now updated from null to {}

Motivation and Context

This behaviour better aligns with the general use of the module.

Breaking Changes

None

How Has This Been Tested?

schniber commented 2 years ago

As spotted by @yewton in #282 Thanks !

antonbabenko commented 2 years ago

This PR is included in version 4.1.3 :tada:

mtraynham commented 2 years ago

Hello, we started pulling the new module update this morning and am seeing the following. We're using the AWS Provider v4.25.0.

Downgrading back to terraform-aws-modules/ec2-instance/aws@4.1.2 still works.

β•·
β”‚ Error: Invalid combination of arguments
β”‚
β”‚   with module.ec2_instance["arm64"].aws_instance.this[0],
β”‚   on .terraform/modules/ec2_instance/main.tf line 7, in resource "aws_instance" "this":
β”‚    7: resource "aws_instance" "this" {
β”‚
β”‚ "capacity_reservation_specification.0.capacity_reservation_preference": one of
β”‚ `capacity_reservation_specification.0.capacity_reservation_preference,capacity_reservation_specification.0.capacity_reservation_target` must be specified
β•΅
jefteete commented 2 years ago

getting same error as mtraynham ( Error: Invalid combination of arguments). I had to add the following to vm module to fix the issue:

capacity_reservation_specification = { capacity_reservation_preference = "open" }

github-actions[bot] commented 1 year ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.