Skip to content

Commit f3bc323

Browse files
committed
r/aws_emr_instance_group: Properly send an instance_count value of 0 on create when configured.
1 parent a562bc2 commit f3bc323

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changelog/37740.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ resource/aws_emr_instance_fleet: Support `io2` as a valid value for `instance_ty
88

99
```release-note:enhancement
1010
resource/aws_emr_instance_group: Support `io2` as a valid value for `instance_type_configs.ebs_config.type`
11+
```
12+
13+
```release-note:bug
14+
resource/aws_emr_instance_group: Properly send an `instance_count` value of `0` on create when configured
1115
```

internal/service/emr/instance_group.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ func resourceInstanceGroupCreate(ctx context.Context, d *schema.ResourceData, me
185185
}
186186
}
187187

188-
if v, ok := d.GetOk(names.AttrInstanceCount); ok {
189-
groupConfig.InstanceCount = aws.Int32(int32(v.(int)))
188+
if v := d.GetRawConfig().GetAttr(names.AttrInstanceCount); v.IsKnown() && !v.IsNull() {
189+
v, _ := v.AsBigFloat().Int64()
190+
groupConfig.InstanceCount = aws.Int32(int32(v))
190191
} else {
191192
groupConfig.InstanceCount = aws.Int32(1)
192193
}

0 commit comments

Comments
 (0)