Data Source: aws_lakeformation_permissions

Get permissions for a principal to access metadata in the Data Catalog and data organized in underlying data storage such as Amazon S3. Permissions are granted to a principal, in a Data Catalog, relative to a Lake Formation resource, which includes the Data Catalog, databases, tables, LF-tags, and LF-tag policies. For more information, see Security and Access Control to Metadata and Data in Lake Formation.

Example Usage

Permissions For A Lake Formation S3 Resource

data "aws_lakeformation_permissions" "test" {
  principal = aws_iam_role.workflow_role.arn

  data_location {
    arn = aws_lakeformation_resource.test.arn
  }
}

Permissions For A Glue Catalog Database

data "aws_lakeformation_permissions" "test" {
  principal = aws_iam_role.workflow_role.arn

  database {
    name       = aws_glue_catalog_database.test.name
    catalog_id = "110376042874"
  }
}

Permissions For Tag-Based Access Control

data "aws_lakeformation_permissions" "test" {
  principal = aws_iam_role.workflow_role.arn
  lf_tag_policy {
    resource_type = "DATABASE"
    expression {
      key    = "Team"
      values = ["Sales"]
    }
    expression {
      key    = "Environment"
      values = ["Dev", "Production"]
    }
  }
}

Argument Reference

The following arguments are required:

One of the following is required:

The following arguments are optional:

data_cells_filter

data_location

The following argument is required:

The following argument is optional:

database

The following argument is required:

The following argument is optional:

lf_tag

The following arguments are required:

The following argument is optional:

lf_tag_policy

The following arguments are required:

The following argument is optional:

expression

table

The following argument is required:

The following arguments are optional:

table_with_columns

The following arguments are required:

The following arguments are optional:

Attribute Reference

In addition to the above arguments, the following attribute is exported: