Is there a way to prevent pulumi from updating an ...
# dotnet
f
Is there a way to prevent pulumi from updating an Output if it has already been set?
public MyStack()
{
// only do this if MyOutput has not been set by a previous deployment
MyOutput= MyValue;
}
[Output]
public Output<string> MyOutput { get; set; }
t
This is somewhat against the idea of desired-state. Why do you want this?
f
I am working on an azure B2C tenant stack. I can create the actual B2CTenant resource with Pulumi, but then I have to create resources within the b2c directory through powershell using the az ad and graph apis. After creating those resources, I would like to reinject some of their properties to the B2CTenant stack so I can just use a StackReference to dowstream parts of my infrastructure. My hack is to run pulumi up a first time, run my powershell script, inject the apps properties through pulumi set config, and run pulumi up again.
t
I still don’t quite get the idea behind that output
f
public MyStack()
{
var config = new Pulumi.Config();
// only do this if MyOutput has not been set by a previous deployment
MyOutput1 = config.Get("MyInputConfig1");
MyOutput2 = config.Get("MyInputConfig2");
} pulumi config set 'MyInputConfig1' 'MyValue' pulumi up // do something manually pulumi config set 'MyInputConfig2' 'MyValue' pulumi up // My problem: MyOutput1 has been cleared up at this point.
t
why?
😖 1
f
Right, my bad, my manual script was off. Config is naturally persisted.