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

ripe-shampoo-80285

08/23/2021, 3:57 PM
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

bored-table-20691

08/23/2021, 4:26 PM
@ripe-shampoo-80285 does using
pulumi.Sprintf
or just doing this with
pulumi.All(…).ApplyT(…)
not work on getting what you need?
g

gorgeous-egg-16927

08/23/2021, 4:35 PM
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

ripe-shampoo-80285

08/23/2021, 6:04 PM
@gorgeous-egg-16927 that seems solved the problem, thanks!
🎉 1
4 Views