https://pulumi.com logo
#dotnet
Title
a

able-camera-57198

11/02/2021, 5:47 PM
Another question on how to work with
Get*
methods:
Copy code
var defaultNetwork = GetNetwork.InvokeAsync(new()
        {
            Network = "default",
        });
ā€¢ Am I supposed to await this? If so, how do I do so when Pulumi stacks all appear to be in constructors? ā€¢ Is there any way to wrap my use of
GetNetwork
with some equivalent to
DependsOn
? Here's the equivalent that I'm currently doing in Terraform:
Copy code
data "google_compute_network" "default" {

  depends_on = [
    google_project_service.compute,
  ]

  name = "default"
}
t

tall-librarian-49374

11/02/2021, 6:18 PM
I usually do
Copy code
var defaultNetwork = Output.Create(GetNetwork.InvokeAsync(new()
        {
            Network = "default",
        }));
We are working on a new option
GetNetwork.Invoke
that does so automatically.
šŸ‘ 1
šŸ™šŸ» 1
a

able-camera-57198

11/02/2021, 6:28 PM
And when I go to use that output, it'll participate in the dependency graph properly?
Also, does it only ever get resolved once?
t

tall-librarian-49374

11/02/2021, 7:44 PM
yes to both
a

able-camera-57198

11/02/2021, 10:31 PM
Very cool, thank you so much.