A quick questions about multiple Output<string&...
# getting-started
A quick questions about multiple Output<string> in an array Input<string>[]
Copy code
Envs = new Input<string>[]
                    // Analytics DB...
                    // Accounts DB...
Where both the
are defined like:
Copy code
var accountsPostgresHostname = accountsPostgresContainer.Hostname.Apply(networkName => $"ACCOUNTS_DB_HOSTNAME={networkName}");
            var analyticsPostgresHostname = analyticsPostgresContainer.Hostname.Apply(networkName => $"ANALYTICS_DB_HOSTNAME={networkName}");
However, only one of those hostnames actually get filled, the other is an empty string. Is it expected that both those Output<string> be resolved in that Input<string>[]? I appreciate your time!
Yes it is expected that both of those would resolve.
@echoing-dinner-19531 thanks for the response. Only one of the values propagates, while both containers spin up prior to the one that is assigned these environment variables. What are the best next steps in debugging this?
I'd check the state of both resources via
pulumi stack export
to see if the output value is filled in for the resource.
@echoing-dinner-19531 from the
pulumi stack export
we can see that Apply call is being made, yet networkName is null. See this output from that variable:
Copy code
That would only be set if the Apply call was invoked, yet the value should come from the parameter being fed in via the Apply:
Copy code
var accountsPostgresHostname = accountsPostgresContainer.Hostname.Apply(networkName => $"ACCOUNTS_DB_HOSTNAME={networkName}");
@echoing-dinner-19531 Just an update for anyone else running into this. I had to
pulumi rm
the entire stack and recreate locally for this to work as expected. Not sure what state the local containers go into (considering they were being recreated) however after doing so, both hostnames populate as expected.
Hmm sounds like a provider bug. If you hit this again can you raise a bug on the docker provider repo.