Skip to content

Commit 64f7aa7

Browse files
rpoluriRaj Poluri
andauthored
add data location permissions (#305)
* hive metastore data location access permissions * fix * fix * update changelog --------- Co-authored-by: Raj Poluri <rpoluri@expediagroup.com>
1 parent 3e8a097 commit 64f7aa7

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
55

6+
## [7.10.3] - 2025-03-07
7+
### Added
8+
- Add data location permissions for metastore IAM role.
9+
610
## [7.10.2] - 2025-03-05
711
### Added
812
- Variable to configure catalog client ARNs.

lf.tf

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@ resource "aws_lakeformation_permissions" "hms_tbl_permissions" {
4949
}
5050
}
5151

52+
resource "aws_lakeformation_permissions" "hms_loc_permissions" {
53+
for_each = var.disable_glue_db_init && var.create_lf_resource ? {
54+
for schema in local.schemas_info : "${schema["schema_name"]}" => schema
55+
} : {}
56+
57+
principal = aws_iam_role.apiary_hms_readwrite.arn
58+
permissions = ["DATA_LOCATION_ACCESS"]
59+
60+
data_location {
61+
arn = aws_lakeformation_resource.apiary_data_bucket[each.key].arn
62+
}
63+
}
64+
65+
5266
resource "aws_lakeformation_permissions" "hms_system_db_permissions" {
5367
count = var.disable_glue_db_init && var.create_lf_resource ? 1 : 0
5468

@@ -72,6 +86,17 @@ resource "aws_lakeformation_permissions" "hms_system_tbl_permissions" {
7286
}
7387
}
7488

89+
resource "aws_lakeformation_permissions" "hms_sys_loc_permissions" {
90+
count = var.disable_glue_db_init && var.create_lf_resource ? 1 : 0
91+
92+
principal = aws_iam_role.apiary_hms_readwrite.arn
93+
permissions = ["DATA_LOCATION_ACCESS"]
94+
95+
data_location {
96+
arn = aws_lakeformation_resource.apiary_system_bucket[0].arn
97+
}
98+
}
99+
75100
locals {
76101
catalog_client_schemas = [
77102
for pair in setproduct(local.schemas_info[*]["schema_name"], var.lf_catalog_client_arns) : {

0 commit comments

Comments
 (0)