indy-singh / multi-region-active-active-latency-based-routing

MIT License
0 stars 0 forks source link

Fix the hard coded reference to GenericLambdaExecutionRole #1

Open indy-singh opened 7 months ago

indy-singh commented 7 months ago

https://github.com/indy-singh/multi-region-active-active-latency-based-routing/blob/5b0e833b9cb01e41b21d3c7409198ef7c53c9410/stack/data.tf#L3

indy-singh commented 7 months ago

The terraform for this resource looks like

data "aws_iam_policy_document" "assume_role" {
  provider = aws.region
  statement {
    effect = "Allow"

    principals {
      type        = "Service"
      identifiers = ["lambda.amazonaws.com"]
    }

    actions = ["sts:AssumeRole"]
  }
}

resource "aws_iam_role" "lambda_execution_role" {
  provider           = aws.region
  name               = "GenericLambdaExecutionRole"
  assume_role_policy = data.aws_iam_policy_document.assume_role.json
  managed_policy_arns = [
    "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
  ]
}