"The -raw option only supports strings, numbers, and boolean values, but output value %q is %s.\n\nUse the -json option for machine-readable representations of output values that have complex types.",
name,v.Type().FriendlyName(),
),
))
c.showDiagnostics(diags)
return1
}
ifstrV.IsNull(){
diags=diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Unsupported value for raw output",
fmt.Sprintf(
"The value for output value %q is null, so -raw mode cannot print it.",
name,
),
))
c.showDiagnostics(diags)
return1
}
if!strV.IsKnown(){
// Since we're working with values from the state it would be very
// odd to end up in here, but we'll handle it anyway to avoid a
// panic in case our rules somehow change in future.
diags=diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Unsupported value for raw output",
fmt.Sprintf(
"The value for output value %q won't be known until after a successful terraform apply, so -raw mode cannot print it.",
name,
),
))
c.showDiagnostics(diags)
return1
}
// If we get out here then we should have a valid string to print.
// We're writing it directly to the output here so that a shell caller
// will get exactly the value and no extra whitespace.