incalculable-energy-23607
07/22/2025, 9:08 PMpython
alb_controller_helm = cluster.name.apply(lambda name: Release(..., values={"clusterName": name, ...}))
But I keep getting this error:
Chart cannot be installed without a valid clusterName!
Hardcoding the name seems to work, but
.apply() doesn’t seem to resolve it in time. Is this a known issue with Helm + Output values? What's the right way to pass cluster.name to a Helm chart in Pulumi?
Appreciate any help! 🙏little-cartoon-10569
07/22/2025, 9:40 PMalb_controller_helm? That's where the apply should be, if you need it. The code you've got is putting a promise of a future string in that variable, it's not a string and can't be used as such.incalculable-energy-23607
07/22/2025, 10:12 PMalb_controller_helm anywhere else. I’m assigning the result of Release(...) inside the .apply() like this:
alb_controller_helm = cluster.name.apply(lambda name: Release(
"aws-load-balancer-controller",
ReleaseArgs(
name="aws-load-balancer-controller",
chart="aws-load-balancer-controller",
namespace="kube-system",
repository_opts=RepositoryOptsArgs(repo="
<https://aws.github.io/eks-charts>"),
values={
"clusterName": name,
"serviceAccount": {
"create": False,
"name": "aws-load-balancer-controller"
},
"region": region,
"vpcId": vpc.id,
},
),
opts=ResourceOptions(provider=k8s_provider, depends_on=[alb_controller_service_account])
))little-cartoon-10569
07/22/2025, 11:15 PMcluster an instance of aws.eks.Cluster? What type is Release, what package is it in?incalculable-energy-23607
07/22/2025, 11:34 PMcluster is an instance of pulumi_eks.Cluster, and Release is from pulumi_kubernetes.helm.v3.
I initially tried passing cluster.name directly in values={"clusterName": cluster.name, ...}, but that gave me the Chart cannot be installed without a valid clusterName! error, likely because cluster.name is still an Output[str], not a resolved string at that point.
That’s why I tried the .apply() approach, to unwrap it but I now realize it turns the whole alb_controller_helm into an Output, which probably isn't valid for resource declarations.
Any idea how to correctly pass cluster.name (an Output[str]) into the Helm chart values while still declaring the Release resource properly?
Appreciate your time.little-cartoon-10569
07/22/2025, 11:56 PMRepositoryOpts that includes clusterName, serviceAccount, region etc. Am I looking in the right place?
https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/
Generatlly, I'd say that you should be able to ignore the fact that it's an Output[str], but there are exceptions where the expected input might be an entire JSON or YAML doc, in which case you'd need to use an`apply()` to build it. Right now, I don't know enough to figure out which case applies here.incalculable-energy-23607
07/23/2025, 8:45 AMmodern-zebra-45309
07/23/2025, 9:59 AMRelease at hand, but you can use the outputs in the values as tenwit said:
cluster = aws.eks.Cluster(...)
alb_controller_helm = k8s.helm.v3.Release(
"aws-load-balancer-controller",
ReleaseArgs(
name="aws-load-balancer-controller",
chart="aws-load-balancer-controller",
namespace="kube-system",
repository_opts=RepositoryOptsArgs(repo="
<https://aws.github.io/eks-charts>"),
values={
"clusterName": cluster.name,
"serviceAccount": {
"create": False,
"name": alb_controller_service_account.metadata.name
},
"region": region,
"vpcId": vpc.id,
},
),
opts=ResourceOptions(provider=k8s_provider)
)
pulumi.export("clusterName", cluster.name)
Pulumi will resolve them while creating the resources. In case this doesn't work, you can remove the Release resource and just export the cluster name and the values. This will show you exactly what cluster.name is resolved to.