https://pulumi.com logo
#golang
Title
# golang
m

most-mouse-38002

08/19/2022, 1:53 PM
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

billowy-army-68599

08/19/2022, 2:28 PM
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

most-mouse-38002

08/22/2022, 8:23 AM
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

billowy-army-68599

08/22/2022, 4:06 PM
@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

most-mouse-38002

08/22/2022, 4:14 PM
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

billowy-army-68599

08/22/2022, 4:25 PM
you should be able to retrieve the secret value with this https://www.pulumi.com/registry/packages/azure/api-docs/keyvault/getsecret/
m

most-mouse-38002

08/22/2022, 4:27 PM
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!
4 Views