Not really a Go guy, so I don’t know if it is Go o...
# golang
m
Not really a Go guy, so I don’t know if it is Go or Pulumi giving me issues, but I find the Output stuff really confusing. Ideally how are we supposed to use these values? Wrap the entire stack inside an
ApplyT()
function for every time we need a value?
b
Do you have a specific example of a problem? You don't need to wrap everything in ApplyT unless you neee to cast values
m
Sorry, weekend and kids.
So, basically I have an Azure
resources.ResourceGroup
created, and a bit later I do a http request to Azure (to get the content of a Secret). At this point, I need the created resource groups name, as a
string
, but I only have it as an
StringOutput
. I understand there is some async stuff going on here, and no guarantees about when it is available, but I really need that name.
b
@most-mouse-38002 if you need anything that’s a String Output as a string, you’ll need to resolve the value from the API inside an Apply, yes. That’s part of the Pulumi programming model. However, I’m sorta curious about this:
bit later I do a http request to Azure (to get the content of a Secret)
Why are you needed to do this? Are you creating the secret with Pulumi, or does it already exist?
m
I see, that’s fair.
My service-principal does not have access to AAD so we need to create app secrets locally (running a separate stack) and store these in KeyVault. Then the service-principal needs to get the actual secret value to push this to a k8s cluster as a secret. Getting the value is only possible using a http request as far as I can tell.
b
you should be able to retrieve the secret value with this https://www.pulumi.com/registry/packages/azure/api-docs/keyvault/getsecret/
m
Weird, I was not able to get Value working and read somewhere that it did not send the actual value? But I’ll try this tomorrow!