From 862ddf73e2474e08bbf30b1332f3381ab82463a0 Mon Sep 17 00:00:00 2001 From: Pam Selle <204372+pselle@users.noreply.github.com> Date: Thu, 23 Jul 2020 15:56:19 -0400 Subject: [PATCH] Add a sensitive attribute --- configs/named_values.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configs/named_values.go b/configs/named_values.go index e0b708a1e..6f867d6c9 100644 --- a/configs/named_values.go +++ b/configs/named_values.go @@ -25,6 +25,7 @@ type Variable struct { Type cty.Type ParsingMode VariableParsingMode Validations []*VariableValidation + Sensitive bool DescriptionSet bool @@ -94,6 +95,11 @@ func decodeVariableBlock(block *hcl.Block, override bool) (*Variable, hcl.Diagno v.ParsingMode = parseMode } + if attr, exists := content.Attributes["sensitive"]; exists { + valDiags := gohcl.DecodeExpression(attr.Expr, nil, &v.Sensitive) + diags = append(diags, valDiags...) + } + if attr, exists := content.Attributes["default"]; exists { val, valDiags := attr.Expr.Value(nil) diags = append(diags, valDiags...) @@ -534,6 +540,9 @@ var variableBlockSchema = &hcl.BodySchema{ { Name: "type", }, + { + Name: "sensitive", + }, }, Blocks: []hcl.BlockHeaderSchema{ {