https://pulumi.com logo
Title
e

elegant-pager-5412

04/22/2021, 3:24 PM
How do I inject values (such as ARN) into a lambda? By default the value is an
Output
f

faint-table-42725

04/22/2021, 3:33 PM
There are a few ways to do this. You can inject those values via environment variables to the function or via some external service like SSM. And you would use pulumi to wire that up as you can pass an
Output
in to creating the environment vars or SSM. If you’re using the inline function serialization in TypeScript, you can also use
.get()
on the
Output
object inline w/in your function code.
e

elegant-pager-5412

04/22/2021, 3:35 PM
So basically I can either use
environment: {variables: {foo: 'bar'}}
or I can do inside the callback:
myQueue.id.get()
f

faint-table-42725

04/22/2021, 3:36 PM
yup — either of those should work
e

elegant-pager-5412

04/22/2021, 3:36 PM
Alright, I will try it. Thank you very much!
By the way, do you know of an easy way to send a message to an SQS queue within a Lambda?
f

faint-table-42725

04/22/2021, 3:38 PM
Not off the top of my head. I would assume there’s a method within the AWS SDK for this.
e

elegant-pager-5412

04/22/2021, 3:39 PM
I see. Thanks 🙂
Is it ok that my by serializing the function Output I get a HUGE
details
output when running
pulumi up
?
f

faint-table-42725

04/22/2021, 3:50 PM
I think you’ll get a huge details output when using function serialization in general because the code is part of the diff
e

elegant-pager-5412

04/22/2021, 6:23 PM
Thanks @faint-table-42725 !