【发布时间】:2021-10-31 02:34:05
【问题描述】:
在创建一些 Azure 资源时,例如 MetricAlert (https://www.pulumi.com/docs/reference/pkg/azure-native/insights/metricalert/),我遇到了 InputMap 类型。
从 MetricAlert 文档中可以看出,在某些情况下,您需要在 Tags 属性中传入对其他资源的引用。 Intellisense 向我展示了 Tags 是一个 InputMap,它接受 Output 作为值...但不幸的是,它的工作方式是引用需要作为键传入 - 值只是字符串“Resource”。
有什么方法可以将我的输出传递到这些标签中,它正在成为将这些警报放入我们的堆栈的障碍。
Tags =
{
{ "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/components/webtest-name-example", "Resource" },
{ "hidden-link:/subscriptions/12345678-1234-1234-1234-123456789101/resourcegroups/rg-example/providers/microsoft.insights/webtests/component-example", "Resource" },
},
【问题讨论】: