Hey all, I'm trying to get a secret into some user...
# general
e
Hey all, I'm trying to get a secret into some userData (registering a gitlab runner and need to provide the registration token). Because I can't use the result of
config.requireSecret('gitlabRunnerRegistrationToken')
as a string I'm having a devil of a time. Originally I was going to use Mustache to render a template, but that's out. Using pulumi.concat is gonna be really ugly if I need to concat part of the script and another part of the script around the value...anyone have an idea of how to do this? Basically I'm taking a 26 line bash script and I need to get a Pulumi secret value into the middle of it then pass it to userData on my DO droplet Pulumi object.
b
I would recommend using the
cloudinit
provider: https://www.pulumi.com/docs/reference/pkg/cloudinit/getconfig/ you'll have to use an
apply
to build the data though
e
ah, didn't know that existed, thank you!
l
The userData takes an Input<string> so you can use the output of requireSecret, whether you go with cloudinit or a vanillia userData string.
You just need to use apply or interpolate.