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

stocky-spoon-28903

08/09/2018, 6:08 PM
Is there a good example of using the function capture and serialization with a plain
aws.lambda.Function
resource?
m

microscopic-florist-22719

08/09/2018, 6:09 PM
cc @lemon-spoon-91807
w

white-balloon-205

08/09/2018, 6:14 PM
@stocky-spoon-28903 What exactly do you mean by "a plain
aws.lambda.Function
resource"? Is this what you had in mind? https://github.com/pulumi/examples/blob/master/aws-ts-stepfunctions/index.ts#L69-L83
l

lemon-spoon-91807

08/09/2018, 6:14 PM
Hey Jen!
s

stocky-spoon-28903

08/09/2018, 6:14 PM
@white-balloon-205 I really mean is there a way to do the typescript function capture while using
aws.lambda.Function
instead of
aws.serverless.Function
in order to get the full range of options
l

lemon-spoon-91807

08/09/2018, 6:15 PM
With a Raw 'aws.lambda.Function', the answer would be 'no'. Primarily, because that's the resource type we have that is a 1:1 mapping to a normal AWS Lambda. However, we also have "aws.serverless.Function" which is a very thin wrapper around that, and which supports passing a simple Javascript callback.
the code here is actually pretty simple, and you can see how it works here: https://github.com/pulumi/pulumi-aws/blob/master/sdk/nodejs/serverless/function.ts
@white-balloon-205 I really mean is there a way to do the typescript function capture while using
aws.lambda.Function
instead of
aws.serverless.Function
in order to get the full range of options
1. which options are you missing? (we can just fix up aws.serverless.Function to allow all appropriate aws.lambda options)
2. you could just replicate what aws.serverless.Function does. but, it would be preferable to not have to do that 🙂
right now, it's a bit silly that there is a FunctionArgs type, and a FunctionOptions type. and that we only pass things along that we know about. I can def fix that up so you can continue using aws.serverless.Function, while hopefully not having any impedance mismatch. Let me which up a PR for htat.
s

stocky-spoon-28903

08/09/2018, 6:20 PM
@lemon-spoon-91807 Thanks: I’ll ping back either later today or tomorrow - have to go catch a plane 🙂 Understood re: the options though.
(Also, thanks @white-balloon-205 & @microscopic-florist-22719)
l

lemon-spoon-91807

08/09/2018, 8:05 PM
3 Views