https://pulumi.com logo
#general
Title
# general
s

square-ability-48831

08/01/2019, 6:39 PM
having trouble accessing an output of apikeys from
const apikeys = awsx.apigateway.createAssociatedAPIKeys(...)
..., I'm confused how to convert Output<T> to strings to get concise exports ...continued in thread...
have tried this among other apply techniques:
Copy code
exports.apiKey1 = pulumi.all([apikeys.keys[0].apikey.name, apikeys.keys[0].apikey.value]).apply(([name, value]) => `${name}: ${value}`)
just want to get a concise output of the name of the key and the value Key: NAME Value: VALUE
w

white-balloon-205

08/01/2019, 6:41 PM
What you have looks to first approximation like it should work. What do you see when you use that? It can be a little simpler with:
Copy code
exports.apiKey1 = pulumi.interpolate`${apikeys.keys[0].apikey.name}: ${apikeys.keys[0].apikey.value}`
s

square-ability-48831

08/01/2019, 6:41 PM
stuff is "working" but the result is an error warning:
"Calling [toString] on an [Output<T>] is not supported.\n\nTo get the value of an Output<T> as an Output<string> consider either:...
w

white-balloon-205

08/01/2019, 6:43 PM
Do you see that with the code above? Actually not sure how that could be.
s

square-ability-48831

08/01/2019, 6:43 PM
will check...
yeah, that worked! thanks