pulumi-eks icon indicating copy to clipboard operation
pulumi-eks copied to clipboard

Cluster.name not available as an output

Open benesch opened this issue 4 years ago • 3 comments
trafficstars

A Python Pulumi program that references eks.Cluster.name in the definition of a Helm chart causes pulumi preview to generate spurious diffs. I originally thought this was an issue with the Kubernetes provider, but after much hand wringing I believe the actual issue is that eks.Cluster is a remote component in Python, and so the value of eks.Cluster.name is not available at preview time.

Expected behavior

pulumi preview reports no diffs.

Current behavior

pulumi preview reports the deletion of all resources created by the Helm chart, but pulumi up will correctly leave those resources in place.

Steps to reproduce

I put together a repository with reproduction instructions:

https://github.com/benesch/pulumi-bug

There's also an easy workaround in this case, which is to not reference eks.Cluster.name in the Helm chart, and instead extract a simple string literal that can referenced in the inputs of the EKS cluster and the Helm chart: https://github.com/benesch/pulumi-bug/pull/1/files

Affected feature

Remote components, I think?

benesch avatar Apr 02 '21 19:04 benesch

@justinvp Could you take a look?

mikhailshilkov avatar Apr 06 '21 17:04 mikhailshilkov

To add to this issue, the actual value of cluster.Name() doesn't appear to be available in the Go SDK

jaxxstorm avatar Sep 23 '21 18:09 jaxxstorm

FWIW, the reason this doesn't work correctly is because name isn't actually an output of Cluster. We'd need to add it as an output in the schema and propagate the value when registering the component's outputs / returning its state.

justinvp avatar Sep 23 '21 18:09 justinvp