// Only include values that are actually required by the config.
continue
}
ifmarks.Has(value.Value,marks.Sensitive){
unmarkedValue,_:=value.Value.Unmark()
if!variableConfig.Sensitive{
// Then we are passing a sensitive value into a non-sensitive
// variable. Let's add a warning and tell the user they should
// mark the config as sensitive as well. If the config variable
// is sensitive, then we don't need to worry.
diags=diags.Append(&hcl.Diagnostic{
Severity:hcl.DiagWarning,
Summary:"Sensitive metadata on variable lost",
Detail:fmt.Sprintf("The input variable is marked as sensitive, while the receiving configuration is not. The underlying sensitive information may be exposed when var.%s is referenced. Mark the variable block in the configuration as sensitive to resolve this warning.",variableConfig.Name),
Subject:value.SourceRange.ToHCL().Ptr(),
})
}
// Set the unmarked value into the input value.
value=&terraform.InputValue{
Value:unmarkedValue,
SourceType:value.SourceType,
SourceRange:value.SourceRange,
}
}
filtered[name]=value
}
returnfiltered
returnfiltered,diags
}
// AddVariablesToConfig extends the provided config to ensure it has definitions