title: Accessing LambdaURL with AWS_IAM auth from EC2 using IAM role
body: <p>I have a Lambda that does some things and needs to be trigered from Jenkins build. Jenkins uses EC2 agents with a specific &quot;jenkins&quot; role attached to them to execute the build. To access lambda we use LambdaURL, when we set auth type to NONE, everything works fine, but we want to have this endpoint secure, so we switched to AWS_IAM auth type. We set up lambda permissions to give &quot;jenkins&quot; role lambda:InvokeFunctionUrl rights for this lambda, I also attached full lambda permissions policy for this role during testing. But still we get &quot;Forbidden&quot; from that LambdaURL. I found this <a href="https://arpadt.com/articles/auth-types-lambda-function-urls" rel="nofollow noreferrer">blogpost</a> that states that in case of AWS_IAM auth type we also need AWS Sigv4 signature. But I don't understand how we can sign it in jenkins using that &quot;jenkins&quot; role. Am I missing something? What may be the best way to limit access to that FunctionURL- instead of auth type?</p>
  <p>Thanks!</p>