Enhances access control for EMR by setting up default permissions and allowing external data filtering with a specific allow list and authorized session tags.

Terraform Template

resource "aws_lakeformation_data_lake_settings" "example" {
  admins = ["aws_iam_user.test.arn", "aws_iam_role.test.arn"]
  allow_external_data_filtering = true
  authorized_session_tag_value_list = ["Amazon EMR"]

  create_database_default_permissions {
    permissions = ["SELECT", "ALTER", "DROP"]
    principal = "aws_iam_user.test.arn"
  }

  create_table_default_permissions {
    permissions = ["ALL"]
    principal = "aws_iam_role.test.arn"
  }
  external_data_filtering_allow_list = ["data.aws_caller_identity.current.account_id", "data.aws_caller_identity.third_party.account_id"]
}