colossal-room-15708
05/23/2020, 7:25 AMrequire()
and when requireSecret()
?
From an end result point of view it seems identical. The secrets from the config are marked as [secret]
no matter which one I use.
However, I had issues working with requireSecret()
now where it would complain that I'm not allowed to run toString
on an output.
const logAnalyticsWorkspacePrimarySharedKey = config.requireSecret('logAnalyticsWorkspacePrimarySharedKey').apply(s => s);
This is later on used as
protectedSettings: `{"workspaceKey": "${logAnalyticsWorkspacePrimarySharedKey}"}`,
And that gives me the following:
protectedSettings : "\"{\\\"workspaceKey\\\": \\\"Calling [toString] on an [Output<T>] is not supported.\\n\\nTo get the value of an Output<T> as an Output<string> consider either:\\n1: o.apply(v => `prefix${v}suffix`)\\n2: pulumi.interpolate `prefix${v}suffix`\\n\\nSee <https://pulumi.io/help/outputs> for more details.\\nThis function may throw in a future version of @pulumi/pulumi.\\\"}\""
faint-table-42725
05/23/2020, 4:39 PMprotectedSettings: `{"workspaceKey": "${logAnalyticsWorkspacePrimarySharedKey}"}`,
with
protectedSettings: pulumi.interpolate`{"workspaceKey": "${logAnalyticsWorkspacePrimarySharedKey}"}`,
because logAnalyticsWorkspacePrimarySharedKey
is an Output
.apply(s => s)
as that’s a no-op