Skip to content

Commit e84e303

Browse files
Fix glue database visibility (#2498)
* add unrestricted database access * add liberator access to parking dept * update db names from etl state * formatting * add identifier_prefix * add address api db * fixup
1 parent 7996f9f commit e84e303

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

terraform/core/05-departments.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,24 @@ module "department_parking" {
7373
departmental_airflow_user = true
7474
mwaa_etl_scripts_bucket_arn = aws_s3_bucket.mwaa_etl_scripts_bucket.arn
7575
mwaa_key_arn = aws_kms_key.mwaa_key.arn
76+
additional_glue_database_access = [
77+
{
78+
database_name = "${local.identifier_prefix}-liberator-raw-zone"
79+
actions = ["glue:GetTable", "glue:GetTables"]
80+
},
81+
{
82+
database_name = "${local.identifier_prefix}-liberator-refined-zone"
83+
actions = ["glue:GetTable", "glue:GetTables"]
84+
},
85+
{
86+
database_name = "${local.identifier_prefix}-liberator-trusted-zone"
87+
actions = ["glue:GetTable", "glue:GetTables"]
88+
},
89+
{
90+
database_name = "${local.identifier_prefix}-raw-zone-unrestricted-address-api"
91+
actions = ["glue:GetTable", "glue:GetTables"]
92+
},
93+
]
7694
}
7795

7896
module "department_finance" {

terraform/modules/department/50-aws-iam-policies.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ data "aws_iam_policy_document" "read_only_glue_access" {
202202
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/${aws_glue_catalog_database.raw_zone_catalog_database.name}/*",
203203
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/${aws_glue_catalog_database.refined_zone_catalog_database.name}/*",
204204
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/${aws_glue_catalog_database.trusted_zone_catalog_database.name}/*",
205+
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/unrestricted-raw-zone/*",
206+
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/unrestricted-refined-zone/*",
207+
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/unrestricted-trusted-zone/*",
208+
205209
]
206210
}
207211

@@ -585,6 +589,9 @@ data "aws_iam_policy_document" "glue_access" {
585589
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/${aws_glue_catalog_database.raw_zone_catalog_database.name}/*",
586590
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/${aws_glue_catalog_database.refined_zone_catalog_database.name}/*",
587591
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/${aws_glue_catalog_database.trusted_zone_catalog_database.name}/*",
592+
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/unrestricted-raw-zone/*",
593+
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/unrestricted-refined-zone/*",
594+
"arn:aws:glue:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:table/unrestricted-trusted-zone/*",
588595
]
589596
}
590597

0 commit comments

Comments
 (0)