Sets up a Lambda function URL to be invoked by a specific IAM role from a different AWS account.

Terraform Template

resource "aws_lambda_function_url" "url" {
  authorization_type = "AWS_IAM"
  function_name = "aws_lambda_function.example.function_name"
}

resource "aws_lambda_permission" "url" {
  action = "lambda:InvokeFunctionUrl"
  function_name = "aws_lambda_function.example.function_name"
  function_url_auth_type = "AWS_IAM"
  principal = "arn:aws:iam::444455556666:role/example"
  source_account = "444455556666"
}