Skip to content

Commit

Permalink
Add permissions to access Glue scripts bucket
Browse files Browse the repository at this point in the history
The Glue job needs to be able to read the Python script in order to run it.
  • Loading branch information
sjwmoveon authored and woodhull committed Jul 14, 2020
1 parent 6e77b47 commit c3ef98b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions glue_job.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ resource "aws_iam_role_policy" "controlshift_data_export_bucket_access" {
policy = data.aws_iam_policy_document.controlshift_data_export_bucket.json
}

resource "aws_iam_role_policy" "controlshift_glue_scripts_bucket_access" {
name = "AllowsAccessToGlueScriptsBucket"
role = aws_iam_role.glue_service_role.id
policy = data.aws_iam_policy_document.controlshift_data_export_bucket.json
}

data "aws_iam_policy_document" "controlshift_data_export_bucket" {
statement {
effect = "Allow"
Expand All @@ -89,6 +95,20 @@ data "aws_iam_policy_document" "controlshift_data_export_bucket" {
}
}

data "aws_iam_policy_document" "controlshift_glue_scripts_bucket" {
statement {
effect = "Allow"
actions = [
"s3:GetObject",
"s3:GetBucketLocation",
"s3:ListBucket"
]
resources = [
"arn:aws:s3:::${var.glue_scripts_bucket_name}/*"
]
}
}

data "aws_subnet" "redshift_subnet" {
id = var.redshift_subnet_id
}
Expand Down

0 comments on commit c3ef98b

Please sign in to comment.