From d0b49ef16fc67106cfd64ffa6e6c0db500636e4e Mon Sep 17 00:00:00 2001 From: Ben Drucker Date: Wed, 30 Mar 2022 10:37:46 -0700 Subject: [PATCH] skip un-used `variable` block attributes --- helper/runner.go | 2 +- helper/runner_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/helper/runner.go b/helper/runner.go index da93560..acb2916 100644 --- a/helper/runner.go +++ b/helper/runner.go @@ -238,7 +238,7 @@ func decodeVariableBlock(block *hcl.Block) (*Variable, hcl.Diagnostics) { DeclRange: block.DefRange, } - content, diags := block.Body.Content(&hcl.BodySchema{ + content, _, diags := block.Body.PartialContent(&hcl.BodySchema{ Attributes: []hcl.AttributeSchema{ { Name: "default", diff --git a/helper/runner_test.go b/helper/runner_test.go index 16e523a..a5f3828 100644 --- a/helper/runner_test.go +++ b/helper/runner_test.go @@ -265,6 +265,7 @@ resource "aws_instance" "foo" { Name: "string interpolation", Src: ` variable "instance_type" { + type = string default = "t2.micro" }