How might one access the value of an Output inside...
# general
s
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
That question doesn’t parse to me, TBH. Do you have a rough example of what you’re trying to do?
s
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
In that case, best to pass the outputs in via
environment
.
b
Pass it in as an environment variable.
s
Awesome, thanks
b
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
That worked!
b
👍