late-library-81640
02/07/2025, 7:04 PMkube_config_decoded = base64decode(k8s_resource.k8s_resource_name.kubeconfig)
I apologize if this isn't the right channel. This one kinda sits on the fence between #CRFURDVQB and #CCWP5TJ5U .late-library-81640
02/07/2025, 7:08 PMpulumi.StringOutput
to string
, base64 decode
, then back to pulumi.StringOutput
for it to work with kubernetes.NewProvider()
?modern-zebra-45309
02/07/2025, 7:56 PMapply
on the output looks like the canonical Pulumi approach to me:
decodedKubeconfig := resourceA.Kubeconfig.ApplyT(func(kubeconfig string) (string, error) {
decoded, err := base64.StdEncoding.DecodeString(kubeconfig)
if err != nil {
return "", err
}
return string(decoded), nil
}).(pulumi.StringOutput)
modern-zebra-45309
02/07/2025, 8:00 PMlate-library-81640
02/07/2025, 8:01 PMmodern-zebra-45309
02/07/2025, 8:05 PMresource.output.apply(base64decode)
rather than base64decode(resource.output)
late-library-81640
02/07/2025, 8:16 PMstocky-restaurant-98004
02/10/2025, 4:45 PMapply()
to get to the raw value (whenever it's ready), and then return another Pulumi output to use somewhere else in your program.