Hi, Pulumi appends a random name to each resource....
# general
s
Hi, Pulumi appends a random name to each resource. Is it possible to specify the name without adding a random string? I can see there is transformations function but it doens't work with YAMLs. Is there a way to simply specify the name in yaml ?
d
It depends on the resource, but you can usually specify
name="your-static-name-here"
For kubernetes, you'd specify via the metadata object
metadata: {name: "static-name"}
s
thanks 🙂
This seems like a bug: https://www.pulumi.com/docs/concepts/options/provider/
Copy code
gke-cluster:
    type: gcp:container:Cluster
    .
    .
    .


ray-system:
    type: kubernetes:core/v1:Namespace
    properties:
      metadata:
        name: ray-system
    options:
      provider: ${gke-cluster}
      dependsOn:
      - ${gke-cluster}
Copy code
error: resource passed as Provider was not a provider resource '&{{{{{%!s(int32=0) %!s(uint32=0)} %!s(uint32=0) %!s(uint32=0) %!s(int32=0) %!s(int32=0)} {%!s(*pulumi.OutputState=&{0x140005a46c0 0x140004083f0 0 <nil> <nil> false false 0x101cc4480 [0x140006c02a0]})} {%!s(*pulumi.OutputState=&{0x140005a4680 0x140004083f0 0 <nil> <nil> false false 0x101bd6980 [0x140006c02a0]})} map[] map[] <nil>   [] gke-cluster [] %!s(bool=false)} {%!s(*pulumi.OutputState=&{0x140005a4640 0x140004083f0 0 <nil> <nil> false false 0x101cc42c0 [0x140006c02a0]})}} gke-cluster {%!s(*pulumi.OutputState=&{0x140005a4600 0x140004083f0 0 <nil> <nil> false false 0x101bf6dc0 [0x140006c02a0]})}}'
If I try:
provider: ${gke-cluster.name}
or
provider: ${gke-cluster.id}
return:
error: resource cannot be an output
d
You need to setup a provider based on the gke-cluster resource. Worth asking in the #yaml channel for how to go about this; I'm not familiar with yaml setups
s
👍