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

swift-painter-31084

07/09/2019, 2:39 AM
How might one access the value of an Output inside an explicit Function? In that case does the Pulumi library need to be imported into that Function?
b

boundless-monkey-50243

07/09/2019, 2:42 AM
That question doesn’t parse to me, TBH. Do you have a rough example of what you’re trying to do?
s

swift-painter-31084

07/09/2019, 2:43 AM
const eventHandler = new aws.lambda.Function("event-handler", { handler: handlerName, runtime: aws.lambda.NodeJS8d10Runtime, role: handlerRole.arn, code: new pulumi.asset.AssetArchive({ ".": new pulumi.asset.FileArchive(handlerPath), }), });
I'm creating a Function resource, and inside the code of that function I need it to be able to write to an SQS queue.
So I'm after the name of that queue to pass into the function somehow, but my understanding of the build process means that may be difficult...
w

white-balloon-205

07/09/2019, 2:46 AM
In that case, best to pass the outputs in via
environment
.
b

boundless-monkey-50243

07/09/2019, 2:46 AM
Pass it in as an environment variable.
s

swift-painter-31084

07/09/2019, 2:47 AM
Awesome, thanks
b

boundless-monkey-50243

07/09/2019, 2:48 AM
That’s also just good practice in general - deploying the same thing in dev and prod is a lot more achievable with twelve-factor configuration
s

swift-painter-31084

07/09/2019, 2:49 AM
That worked!
b

boundless-monkey-50243

07/09/2019, 2:49 AM
👍