Skip to content

Commit b3201b4

Browse files
fix: remove duplicate deferred foreign keys (#165)
* remove duplicate key CloudSQL logs and metrics
1 parent 98fa49a commit b3201b4

File tree

3 files changed

+60
-60
lines changed

3 files changed

+60
-60
lines changed

service/cloudsql/logs_access.tf

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -113,24 +113,24 @@ resource "observe_dataset" "mysql_data_access_logs" {
113113
}
114114
}
115115

116-
resource "observe_link" "sql_access_logs" {
117-
workspace = var.workspace.oid
118-
source = each.value.source
119-
target = each.value.target
120-
fields = each.value.fields
121-
label = each.key
122-
123-
for_each = {
124-
"PostGresDatabaseAccess" = {
125-
target = observe_dataset.cloud_sql_instance.oid
126-
fields = ["database_id"]
127-
source = observe_dataset.postgres_data_access_logs.oid
128-
}
129-
130-
"MySQLDatabaseAccess" = {
131-
target = observe_dataset.cloud_sql_instance.oid
132-
fields = ["database_id"]
133-
source = observe_dataset.mysql_data_access_logs.oid
134-
}
135-
}
136-
}
116+
# resource "observe_link" "sql_access_logs" {
117+
# workspace = var.workspace.oid
118+
# source = each.value.source
119+
# target = each.value.target
120+
# fields = each.value.fields
121+
# label = each.key
122+
123+
# for_each = {
124+
# "PostGresDatabaseAccess" = {
125+
# target = observe_dataset.cloud_sql_instance.oid
126+
# fields = ["database_id"]
127+
# source = observe_dataset.postgres_data_access_logs.oid
128+
# }
129+
130+
# "MySQLDatabaseAccess" = {
131+
# target = observe_dataset.cloud_sql_instance.oid
132+
# fields = ["database_id"]
133+
# source = observe_dataset.mysql_data_access_logs.oid
134+
# }
135+
# }
136+
# }

service/cloudsql/logs_error.tf

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,40 @@ resource "observe_dataset" "cloud_sql_logs_error" {
1616

1717
}
1818

19-
resource "observe_link" "sql_error_logs" {
20-
workspace = var.workspace.oid
21-
source = each.value.source
22-
target = each.value.target
23-
fields = each.value.fields
24-
label = each.key
25-
26-
for_each = {
27-
28-
"DatabaseErrors" = {
29-
target = observe_dataset.cloud_sql_instance.oid
30-
fields = ["database_id"]
31-
source = observe_dataset.cloud_sql_logs_error.oid
32-
}
33-
## If we want to create an error log for each platform
34-
# "PostGresDatabaseAccess" = {
35-
# target = observe_dataset.cloud_sql_instance.oid
36-
# fields = ["database_id"]
37-
# source = observe_dataset.postgres_error_logs.oid
38-
# }
39-
40-
# "MySQLDatabaseError" = {
41-
# target = observe_dataset.cloud_sql_instance.oid
42-
# fields = ["database_id"]
43-
# source = observe_dataset.mysql_error_logs.oid
44-
# }
45-
46-
# "SQLServerDatabaseError" = {
47-
# target = observe_dataset.cloud_sql_instance.oid
48-
# fields = ["database_id"]
49-
# source = observe_dataset.sqlserver_error_logs.oid
50-
# }
51-
}
52-
}
19+
# resource "observe_link" "sql_error_logs" {
20+
# workspace = var.workspace.oid
21+
# source = each.value.source
22+
# target = each.value.target
23+
# fields = each.value.fields
24+
# label = each.key
25+
26+
# for_each = {
27+
28+
# "DatabaseErrors" = {
29+
# target = observe_dataset.cloud_sql_instance.oid
30+
# fields = ["database_id"]
31+
# source = observe_dataset.cloud_sql_logs_error.oid
32+
# }
33+
# ## If we want to create an error log for each platform
34+
# # "PostGresDatabaseAccess" = {
35+
# # target = observe_dataset.cloud_sql_instance.oid
36+
# # fields = ["database_id"]
37+
# # source = observe_dataset.postgres_error_logs.oid
38+
# # }
39+
40+
# # "MySQLDatabaseError" = {
41+
# # target = observe_dataset.cloud_sql_instance.oid
42+
# # fields = ["database_id"]
43+
# # source = observe_dataset.mysql_error_logs.oid
44+
# # }
45+
46+
# # "SQLServerDatabaseError" = {
47+
# # target = observe_dataset.cloud_sql_instance.oid
48+
# # fields = ["database_id"]
49+
# # source = observe_dataset.sqlserver_error_logs.oid
50+
# # }
51+
# }
52+
# }
5353

5454
## If we want to create an error log for each platform
5555

service/cloudsql/metrics.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,11 @@ resource "observe_link" "cloud_sql_metrics" {
245245
}
246246

247247

248-
"Cloud SQL Metrics Wide" = {
249-
target = observe_dataset.cloud_sql_instance.oid
250-
fields = ["database_id"]
251-
source = observe_dataset.cloud_sql_metrics_wide[0].oid
252-
}
248+
# "Cloud SQL Metrics Wide" = {
249+
# target = observe_dataset.cloud_sql_instance.oid
250+
# fields = ["database_id"]
251+
# source = observe_dataset.cloud_sql_metrics_wide[0].oid
252+
# }
253253
} : {}
254254

255255
workspace = var.workspace.oid

0 commit comments

Comments
 (0)