gpt4 book ai didi

c# - 普鲁米 C# : mark stack output as a secret

转载 作者:行者123 更新时间:2023-12-04 00:58:05 25 4
gpt4 key购买 nike

我正在创建一个将与多个堆栈共享的 ACR,我需要输出中的信息

如何保护密码输出?

using Pulumi;
using Pulumi.Azure.Core;
using Pulumi.Azure.ContainerService;

class MyStack : Stack
{
public MyStack()
{
string baseName = $"{Deployment.Instance.ProjectName}-{Deployment.Instance.StackName}";
string restrictedName = baseName.ToLower().Replace("-", "");

var resourceGroup = new ResourceGroup("resourceGroup", new ResourceGroupArgs
{
Name = baseName
});

var acr = new Registry("myorg-acr", new RegistryArgs
{
Name = $"{restrictedName}acr",
ResourceGroupName = resourceGroup.Name,
Sku = "Basic",
AdminEnabled = true
});

AcrLoginServer = acr.LoginServer;
AcrAdminUsername = acr.AdminUsername;
AcrAdminPassword = acr.AdminPassword;
}

[Output]
public Output<string> AcrLoginServer { get; private set; }
[Output]
public Output<string> AcrAdminUsername { get; private set; }
[Output]
public Output<string> AcrAdminPassword { get; private set; }
}

最佳答案

您应该能够像这样将输出标记为 secret :

AcrAdminPassword = registry.AdminPassword.Apply(Output.CreateSecret);

关于c# - 普鲁米 C# : mark stack output as a secret,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60744134/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com