Hi, I would like to use the output from a resource...
# general
e
Hi, I would like to use the output from a resources to create a script to be run on a VM via extension. How do I convert the output to string? I have tried
Output.concat("date >/tmp/data; echo ", vm.name, " >/tmp/out")
, but I get
<pulumi.output.Output object at 0x7f947407e1c0>
any ideas? Thanks
b
https://www.pulumi.com/docs/intro/concepts/inputs-outputs/ Output doesn't have a
concat
method
My apologies, it would seem that is has one in python, but it won't do what you want it to do.
you'll probably need to use
.apply
r
Output
does have a
concat
method, in python. However,
concat
also returns an
Output
, and I’m guessing you’re trying to
print
the result of the
concat
- is that right?
@echoing-postman-88590 you might find the following thread helpful, it’s addressing typescript (and
interpolate
is the typescript version of
concat
) - but the underlying concepts are the same: https://pulumi-community.slack.com/archives/C84L4E3N1/p1617752754269000
e
I have tried to use the
.apply method but no success
Yes I am looking for a string
r
If you are trying to print the string you will have to do that within the apply
Might be easier to help if you give us a code sample
e
It is not a
print
as in function but an expansion to string
Thanks for the reply. I will try the suggestion on the issues
👍🏽 1