This message was deleted.
# google-cloud
s
This message was deleted.
g
Oh, I'm an idiot. Of course one would have to fetch the load balancer not the ingress 🤦‍♂️
Didn't find an easy way to do this. I find it astonishing that Pulumi still doesn't support referencing another project state but it does support this for terraform remote states? Like, what. I ended up downloading the another project state file via custom code, parsing that and finding the correct resource and from its outputs get the IP address value. Nuts but works.
Did it like this. Yes, it is a hack, yes, I do feel dirty, yes, it can break. But until I can figure out a better way I'm going with this:
Copy code
const project = pulumi.output(gcp.projects.getProject({ filter: "name:project-with-state-name" }));

const stackStateContent = project.apply(project => new storage.Storage({
  projectId: project.id
})).apply(stor => stor
  .bucket("pulumi-state")
  .file("rootFolderName/.pulumi/stacks/stackname.json")
  .download())
  .apply(downloadResult => JSON.parse(downloadResult.toString()));

const ingressIp = liveDevStackStateContent.apply(stackState => {
  const resources : Array<any> = stackState.checkpoint.latest.resources;
  const ingressResource = resources.find((res : any) => res.id === "web/web-ingress");
  const ip : string = ingressResource.outputs.status.loadBalancer.ingress[0].ip;
  return ip;
});
Any better ideas are welcome!