Another question on how to work with `Get*` method...
# dotnet
a
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
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
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
yes to both
a
Very cool, thank you so much.