resource "aws_iam_role" "this" {
  name               = var.role_name
  assume_role_policy = local.assume_role_policy
}

resource "aws_iam_role_policy" "ecr_logs" {
  count  = local.inline_policy != null ? 1 : 0
  name   = local.inline_policy.name
  role   = aws_iam_role.this.id
  policy = local.inline_policy.policy
}
