When I invoke pulumi up
, I want it to print as part its output - the public IP of the Pulumi.Aws.Ec2.Instance
(e.g. Public IP: 1.2.3.4
).
I have this code:
var server = new Instance("auto_mc_server", new InstanceArgs {
InstanceType = "t2.micro",
// ... more stuff ...
});
I see many questions asking about Output
s, so I tried for instance:
Output.Format($"Public IP: {server.PublicIp}");
Output.Create("public_ip").Apply(s => $"Public IP: {server.PublicIp}");
... and other variations ...
But nothing gets printed upon pulumi up
...
You need to return a value in the C# SDK
return new Dictionary<string, object?>
{
["publicIp"] = server.PublicIp
};