If our block doesn't contain any sensitive attrs, skip recursing into it

This commit is contained in:
Pam Selle 2020-10-14 17:44:50 -04:00
parent f60ae7ac08
commit e44e03b283
1 changed files with 4 additions and 0 deletions

View File

@ -955,6 +955,10 @@ func markProviderSensitiveAttributes(schema *configschema.Block, val cty.Value)
func getValMarks(schema *configschema.Block, val cty.Value, path cty.Path) []cty.PathValueMarks {
var pvm []cty.PathValueMarks
for name, blockS := range schema.BlockTypes {
// If our block doesn't contain any sensitive attributes, skip inspecting it
if !blockS.Block.ContainsSensitive() {
continue
}
blockV := val.GetAttr(name)
blockPath := append(path, cty.GetAttrStep{Name: name})
switch blockS.Nesting {