Is there any way to have Pulumi capture the output...
# aws
s
Is there any way to have Pulumi capture the output of UserData code which runs on instance boot?
b
can you elaborate on what you mean by this?
s
I am running UserData code. This code generates some shell output. I’m wondering if this output could be exposed/accessed by Pulumi? The object returned from ec2.Instance does have a user_data field but this seems to be encoded.
b
it’s base64 encoded, decode it
🙅 1
s
I did already try that but got gibberish
I suspect that might be the encoded input rather than the output
m
I suspect that might be the encoded input rather than the output
Correct — that field is just what you put in, not what comes out.
I believe if you want to capture the output of a script that runs on instance create, you’d want the Command provider: https://www.pulumi.com/registry/packages/command/
s
Awesome! This is exactly what i was looking for. thanks @miniature-musician-31262
m
You bet!
s
This looks great for a direct connection to a host. Does it support a jump-box / bastion? (perhaps that could be handled in an ssh-config file somewhere)
m
I don’t think there’s anything built-in that handles indirect connections like this for you — at least not yet.
s
You’re correct. I did some very funky stuff to jump to the next box. It’s not pretty tho. Wouldn’t be hard to extend this module/package to include the -J (or arbitrary) ssh options