In my pulumi Golang code, I create an AWS IAM user...
# kubernetes
r
In my pulumi Golang code, I create an AWS IAM user & IAM accessKey. I then try to create a k8s secrete from the accessKey. How do I do that? I guess I will need to base64 encode accessKey.ID(), accessKey.serete, accessKey.ID() type of IDOutput. Can it be casted to StringOutput? Has anybody got an example how to do this (any language is fine, but preferably in Golang).
b
@ripe-shampoo-80285 does using
pulumi.Sprintf
or just doing this with
pulumi.All(…).ApplyT(…)
not work on getting what you need?
g
FYI, you can use the StringData Secret argument to automatically b64 encode the data: https://www.pulumi.com/docs/reference/pkg/kubernetes/core/v1/secret/#stringdata_go
Looking at https://www.pulumi.com/docs/reference/pkg/aws/iam/accesskey/#outputs it seems like you should be able to pass one of those directly to StringData since they are all string outputs. I’m not familiar with that particular resource, so I’m not sure which output fits your use case.
r
@gorgeous-egg-16927 that seems solved the problem, thanks!
🎉 1