https://pulumi.com logo
#kubernetes
Title
# kubernetes
n

numerous-thailand-80976

07/20/2021, 8:45 PM
Is there a way to get an object not created by Pulumi in code?, I'm trying to get the token for an SA created via Pulumi (the secret is automatically created by kubernetes), but the method (Go code) requires a Pulumi ID, I can provde some code samples if required
g

gorgeous-egg-16927

07/21/2021, 3:37 PM
The pulumi ID is
[namespace/]name
of the resource. So if your SA is called “foo” in the “bar” namespace, it would be
bar/foo
n

numerous-thailand-80976

07/21/2021, 4:55 PM
Ahh..that makes sense, can I search for a Secret via glob?, the secret I'm looking for is named
argocd-manager-token-{5-random-characters}
, I can get the name from the SA but it's saved as a
pulumi.OutputString
so I can't use it as a
string
in the
GetSecret
call (I'm using Go for this)
g

gorgeous-egg-16927

07/22/2021, 4:40 PM
No, currently get only works with a known id. You should be able to call
GetSecret
within an Apply, which will resolve the SA so you can get the name. I’m tracking improvements to the get UX here if you have any feedback to add: https://github.com/pulumi/pulumi-kubernetes/issues/1656
4 Views