<The pulumi article> on Lambda Function URL doesn’...
# aws
a
The pulumi article on Lambda Function URL doesn’t contain a working example. I can’t call the URL that is created because the Lambda is lacking a critical permission (
lambda:InvokeFunctionUrl
) and I don’t know how to add it because I don’t know how to add the necessary condition using the classic
aws.lambda.Permission
resource. Any help?
Copy code
new aws.lambda.Permission('hello', {
    action: 'lambda:InvokeFunctionUrl',
    principal: '*',
    function: <ze-function>,
  })
this is lacking a condition
v
Copy code
new lambda.Permission(`lambda-permission`, {
  action: 'lambda:InvokeFunction',
  function: lambdaFunction.arn,
  principal: '*',
  sourceArn: resource.arn,
});
we utilize lambda permissions, this is an example of one of ours
looks like you’re just missing the sourceArn of whatever you want to trigger the lambda?
a
I don’t have a sourceArn 🙂
lambda function URL provides an URL that you can call with HTTP
and I need a way to add that
Copy code
Conditions
{
 "StringEquals": {
  "lambda:FunctionUrlAuthType": "NONE"
 }
}
to the permission
v
I would probably add this manually in the UI, then use the
pulumi import
command to pull the resource in and generate the code for me to create it, sorry i haven’t personally done lambda url perms before
a
Yes I can’t import the permission, because I really think that pulumi is not equipped to handle that
FYI
* Error unmarshalling Lambda policy: json: cannot unmarshal string into Go struct field PolicyStatement.Statement.Principal of type map[string]string
v
hmm, im not sure then, each time i’ve been unsure on how to do something the import has worked a treat for me
im using the typescript implementation