This message was deleted.
# general
s
This message was deleted.
b
To answer my own question, I had to use StackReference.getOutputSync(name) instead of getOutput(name)
f
Probably better is to use apply with the k8s job inside the apply (since as you saw, apply’s return an Output)
the synchronous functions will be going away in pulumi 2.0
b
Hi Lee, thanks for your hints but I don't get it 🙂 could you give an example? I want to create a k8s job (or deployment) and use the output from another stack concatenated with other strings as a container argument (i.e. add prefix and suffix).
f
Something like:
Copy code
const stackRef = pulumi.StackReference(`acmecorp/infra/${env}`)
const containerArg = pulumi.interpolate`${prefix}${stackRef.getOutput("foo")}${suffix}`

...

const service = new k8s.core.v1.Service(name, {
    ...
    metadata: {
        annotations: {
            "foo": containerArg
        }
    }
}
containerArg will be a
pulumi.Output<string>
which you can pass as a
pulumi.Input<string>
as an argument to your resources
b
Thanks Lee, I'll try it 🙂