claranet / terraform-aws-lambda

Terraform module for AWS Lambda functions
MIT License
157 stars 126 forks source link

Support multi region deployments #10

Closed bashtoni closed 6 years ago

bashtoni commented 6 years ago

IAM roles and Lambda function names must be globally unique for an account. Append random a consistent random string to make this happen.

raymondbutcher commented 6 years ago

Have you considered passing a globally unique function name into the module? (like you would do with a standard aws_lambda_function resource)

data "aws_region" "current" {
  current = true
}

module "lambda" {
  source  = "claranet/lambda/aws"
  version = "0.7.0"

  function_name = "my-lambda-function-${data.aws_region.current.name}"

  ...
}
bashtoni commented 6 years ago

I hadn't. Maybe I'll just update the README to suggest that..