Skip to content

Commit

Permalink
Create a VPC Endpoint for S3, which is required for Glue jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
anero committed Nov 16, 2021
1 parent 2103b17 commit 371a542
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions glue_job.tf
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,14 @@ resource "aws_cloudwatch_event_target" "notify_failed_glue_job" {
target_id = "notify-failed-glue-job-run"
arn = aws_sns_topic.glue_job_failure.arn
}


data "aws_vpc" "main" {
id = var.vpc_id
}

# Glue jobs require a VPC endpoint for connecting to S3
resource "aws_vpc_endpoint" "s3" {
vpc_id = data.aws_vpc.main.id
service_name = "com.amazonaws.${var.aws_region}.s3"
}
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,8 @@ variable "glue_physical_connection_requirements" {
type = object({ availability_zone=string, subnet_id=string, security_group_id_list=list(string) })
description = "A terraform map of the physical_connection_requirements property of the glue redshift connection. See Terraform aws_glue_connection docs."
}

variable "vpc_id" {
type = string
description = "The ID of the VPC Glue uses for connecting with Redshift"
}

0 comments on commit 371a542

Please sign in to comment.