Add a sensitive attribute

This commit is contained in:
Pam Selle 2020-07-23 15:56:19 -04:00
parent a18e1cb24f
commit 862ddf73e2
1 changed files with 9 additions and 0 deletions

View File

@ -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{
{