File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change
1
+ ```release-note:bug
2
+ resource/aws_instance: Fix `interface conversion: interface {} is nil, not map[string]interface {}` panics when `capacity_reservation_target` is empty
3
+ ```
Original file line number Diff line number Diff line change @@ -3616,7 +3616,7 @@ func expandCapacityReservationSpecification(tfMap map[string]any) *awstypes.Capa
3616
3616
apiObject .CapacityReservationPreference = awstypes .CapacityReservationPreference (v )
3617
3617
}
3618
3618
3619
- if v , ok := tfMap ["capacity_reservation_target" ].([]any ); ok && len (v ) > 0 {
3619
+ if v , ok := tfMap ["capacity_reservation_target" ].([]any ); ok && len (v ) > 0 && v [ 0 ] != nil {
3620
3620
apiObject .CapacityReservationTarget = expandCapacityReservationTarget (v [0 ].(map [string ]any ))
3621
3621
}
3622
3622
Original file line number Diff line number Diff line change @@ -10048,7 +10048,7 @@ resource "aws_instance" "test" {
10048
10048
resource "aws_ec2_capacity_reservation" "test" {
10049
10049
instance_type = data.aws_ec2_instance_type_offering.available.instance_type
10050
10050
instance_platform = %[2]q
10051
- availability_zone = data.aws_availability_zones.available.names[0 ]
10051
+ availability_zone = data.aws_availability_zones.available.names[1 ]
10052
10052
instance_count = 10
10053
10053
10054
10054
tags = {
You can’t perform that action at this time.
0 commit comments