diff --git a/main.tf b/main.tf index 18b64ab6..c113bf62 100644 --- a/main.tf +++ b/main.tf @@ -83,7 +83,11 @@ resource "aws_instance" "this" { var.volume_tags, ) - credit_specification { - cpu_credits = local.is_t_instance_type ? var.cpu_credits : null + dynamic "credit_specification" { + for_each = local.is_t_instance_type ? [var.cpu_credits] : [] + + content { + cpu_credits = credit_specification.value + } } }