Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Modified resources for complaint_database pipeline #511

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 1 addition & 17 deletions datasets/cfpb_complaints/infra/cfpb_complaints_dataset.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,19 +24,3 @@ resource "google_bigquery_dataset" "cfpb_complaints" {
output "bigquery_dataset-cfpb_complaints-dataset_id" {
value = google_bigquery_dataset.cfpb_complaints.dataset_id
}

resource "google_storage_bucket" "cfpb-complaints" {
name = "${var.bucket_name_prefix}-cfpb-complaints"
force_destroy = true
location = "US"
uniform_bucket_level_access = true
lifecycle {
ignore_changes = [
logging,
]
}
}

output "storage_bucket-cfpb-complaints-name" {
value = google_storage_bucket.cfpb-complaints.name
}
13 changes: 4 additions & 9 deletions datasets/cfpb_complaints/infra/complaint_database_pipeline.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,15 +16,10 @@


resource "google_bigquery_table" "cfpb_complaints_complaint_database" {
project = var.project_id
dataset_id = "cfpb_complaints"
table_id = "complaint_database"

project = var.project_id
dataset_id = "cfpb_complaints"
table_id = "complaint_database"
description = "CFPB Complain table"




depends_on = [
google_bigquery_dataset.cfpb_complaints
]
Expand Down
2 changes: 1 addition & 1 deletion datasets/cfpb_complaints/infra/provider.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
5 changes: 4 additions & 1 deletion datasets/cfpb_complaints/infra/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,4 +20,7 @@ variable "bucket_name_prefix" {}
variable "impersonating_acct" {}
variable "region" {}
variable "env" {}
variable "iam_policies" {
default = {}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -53,9 +53,9 @@
"RENAME_MAPPINGS": '{"Complaint ID":"complaint_id","Date received":"date_received","Product":"product","Sub-product":"subproduct","Issue":"issue","Sub-issue":"subissue","Consumer complaint narrative":"consumer_complaint_narrative","Company response to consumer":"company_response_to_consumer","Company public response":"company_public_response","Company":"company_name","State":"state","ZIP code":"zip_code","Tags":"tags","Consumer consent provided?":"consumer_consent_provided","Submitted via":"submitted_via","Date sent to company":"date_sent_to_company","Timely response?":"timely_response","Consumer disputed?":"consumer_disputed"}',
},
resources={
"request_memory": "3G",
"request_memory": "4G",
"request_cpu": "1",
"request_ephemeral_storage": "10G",
"request_ephemeral_storage": "8G",
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ dag:
RENAME_MAPPINGS: >-
{"Complaint ID":"complaint_id","Date received":"date_received","Product":"product","Sub-product":"subproduct","Issue":"issue","Sub-issue":"subissue","Consumer complaint narrative":"consumer_complaint_narrative","Company response to consumer":"company_response_to_consumer","Company public response":"company_public_response","Company":"company_name","State":"state","ZIP code":"zip_code","Tags":"tags","Consumer consent provided?":"consumer_consent_provided","Submitted via":"submitted_via","Date sent to company":"date_sent_to_company","Timely response?":"timely_response","Consumer disputed?":"consumer_disputed"}
resources:
request_memory: "3G"
request_memory: "4G"
request_cpu: "1"
request_ephemeral_storage: "10G"
request_ephemeral_storage: "8G"

- operator: "GoogleCloudStorageToBigQueryOperator"
description: "Task to load CSV data to a BigQuery table"
Expand Down