@@ -4,35 +4,35 @@ main.tf for the time being.
44 */
55
66resource "aws_security_group" "glue_sg" {
7- name = " glue-sg"
7+ name = " glue-sg"
88 description = " Common security group for Glue jobs"
9- vpc_id = data. aws_vpc . default . id
9+ vpc_id = data. aws_vpc . default . id
1010}
1111
1212resource "aws_vpc_security_group_ingress_rule" "glue_sg_allow_connections_from_self" {
13- security_group_id = aws_security_group. glue_sg . id
14- ip_protocol = " -1"
13+ security_group_id = aws_security_group. glue_sg . id
14+ ip_protocol = " -1"
1515 referenced_security_group_id = aws_security_group. glue_sg . id
1616}
1717
1818resource "aws_vpc_security_group_egress_rule" "glue_gs_allow_outbound_connections" {
1919 security_group_id = aws_security_group. glue_sg . id
20- ip_protocol = " -1"
21- cidr_ipv4 = " 0.0.0.0/0"
20+ ip_protocol = " -1"
21+ cidr_ipv4 = " 0.0.0.0/0"
2222}
2323
2424resource "aws_s3_bucket" "glue_scripts" {
25- bucket = " ${ var . name } -glue-scripts-bucket"
25+ bucket = " ${ var . name } -glue-scripts-bucket"
2626 force_destroy = true
2727}
2828
2929resource "aws_s3_bucket" "aws_glue_input_bucket" {
30- bucket = " ${ var . name } -glue-s3-input"
30+ bucket = " ${ var . name } -glue-s3-input"
3131 force_destroy = true
3232}
3333
3434resource "aws_s3_bucket" "aws_glue_output_bucket" {
35- bucket = " ${ var . name } -glue-s3-output"
35+ bucket = " ${ var . name } -glue-s3-output"
3636 force_destroy = true
3737}
3838
@@ -41,7 +41,7 @@ resource "aws_glue_catalog_database" "aws_glue_catalog" {
4141}
4242
4343resource "aws_glue_crawler" "aws_glue_crawler" {
44- database_name = aws_glue_catalog_database. aws_glue_catalog . name
44+ database_name = aws_glue_catalog_database. aws_glue_catalog . name
4545 name = " ${ var . name } -glue-data-catalog-crawler"
4646 role = aws_iam_role. glue_job_role . arn
4747 schedule = " cron(0 12 * * ? *)"
@@ -82,13 +82,13 @@ resource "aws_glue_job" "python_shell_job" {
8282 }
8383
8484 default_arguments = {
85- " --job-language" = " python" # Default is python
86- " --additional-python-modules" = replace (file (abspath (" ${ path . module } /../etls/loadFIPS/requirements.txt" )), " \n " , " , " )
87- " --MAX_RETRIES" = " 3"
88- " --DB_SECRET_ARN" = module.rds.db_instance_master_user_secret_arn
89- " --DB_HOST" = module.rds.db_instance_address
90- " --DB_PORT" = module.rds.db_instance_port
91- " --DB_NAME" = var.db_name
85+ " --job-language" = " python" # Default is python
86+ " --additional-python-modules" = replace (file (abspath (" ${ path . module } /../etls/loadFIPS/requirements.txt" )), " \n " , " , " )
87+ " --MAX_RETRIES" = " 3"
88+ " --DB_SECRET_ARN" = module.rds.db_instance_master_user_secret_arn
89+ " --DB_HOST" = module.rds.db_instance_address
90+ " --DB_PORT" = module.rds.db_instance_port
91+ " --DB_NAME" = var.db_name
9292 }
9393
9494 execution_property {
@@ -101,15 +101,15 @@ resource "aws_glue_job" "python_shell_job" {
101101}
102102
103103resource "aws_glue_job" "pyspark_job" {
104- name = " nppes-to-s3-pyspark-job"
105- description = " A simple pyspark job that moves a single table from one location to another"
106- glue_version = " 5.0"
107- role_arn = aws_iam_role. glue_job_role . arn
104+ name = " nppes-to-s3-pyspark-job"
105+ description = " A simple pyspark job that moves a single table from one location to another"
106+ glue_version = " 5.0"
107+ role_arn = aws_iam_role. glue_job_role . arn
108108 number_of_workers = 2
109- worker_type = " G.1X"
110- max_retries = 0
111- timeout = 2880
112- connections = []
109+ worker_type = " G.1X"
110+ max_retries = 0
111+ timeout = 2880
112+ connections = []
113113
114114 command {
115115 script_location = " s3://${ aws_s3_object . glue_job_script . bucket } /${ aws_s3_object . glue_job_script_pyspark . key } "
@@ -183,13 +183,13 @@ resource "aws_iam_policy" "glue_job_policy" {
183183}
184184
185185resource "aws_iam_policy_attachment" "glue_job_policy_attachment" {
186- name = " glue_job_policy_attachment"
186+ name = " glue_job_policy_attachment"
187187 policy_arn = aws_iam_policy. glue_job_policy . arn
188- roles = [aws_iam_role . glue_job_role . name ]
188+ roles = [aws_iam_role . glue_job_role . name ]
189189}
190190
191191resource "aws_iam_policy_attachment" "glue_job_managed_policy_attachment" {
192- name = " glue_job_managed_policy_attachment"
192+ name = " glue_job_managed_policy_attachment"
193193 policy_arn = " arn:aws-us-gov:iam::aws:policy/service-role/AWSGlueServiceRole"
194- roles = [aws_iam_role . glue_job_role . name ]
194+ roles = [aws_iam_role . glue_job_role . name ]
195195}
0 commit comments