kuriko 0.3.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/module/main.tf CHANGED
@@ -2,7 +2,8 @@
2
2
  #
3
3
  # Who can do what (README "Rules that don't bend", enforced here by IAM):
4
4
  # kuriko-gateway reads data source credentials (only the secrets policy.yaml names, granted one by one), uses the KMS key,
5
- # deploys tools as kuriko-tools. The only identity that can touch credentials.
5
+ # deploys tools as kuriko-tools. The only identity that can touch credentials. Reads the BigQuery
6
+ # datasets policy.yaml names (granted by whoever manages each dataset: see output gateway_member).
6
7
  # kuriko-web reads only its own secrets (database URL, session secret, IdP client secret).
7
8
  # kuriko-tools nothing. Tools reach data only through the gateway.
8
9
  # kuriko-builder builds tools: reads uploaded sources, writes build logs, pushes to kuriko-tools.
@@ -37,6 +38,7 @@ resource "google_project_service" "apis" {
37
38
  "cloudbuild.googleapis.com",
38
39
  "storage.googleapis.com",
39
40
  "pubsub.googleapis.com",
41
+ "bigquery.googleapis.com",
40
42
  ])
41
43
  service = each.value
42
44
  disable_on_destroy = false
@@ -256,6 +258,16 @@ resource "google_kms_crypto_key_iam_member" "gateway" {
256
258
  member = google_service_account.gateway.member
257
259
  }
258
260
 
261
+ # ---------------------------------------------------------------- the gateway reads BigQuery
262
+
263
+ # Running a query (a row rule, or a view) is a job in this project, billed here. It reads nothing by
264
+ # itself: which datasets the gateway can read is granted on each dataset by whoever manages it.
265
+ resource "google_project_iam_member" "gateway_bigquery_jobs" {
266
+ project = var.project_id
267
+ role = "roles/bigquery.jobUser"
268
+ member = google_service_account.gateway.member
269
+ }
270
+
259
271
  # ---------------------------------------------------------------- the gateway runs tools
260
272
 
261
273
  resource "google_project_iam_member" "gateway_run" {
package/module/outputs.tf CHANGED
@@ -37,3 +37,13 @@ output "tools_repository" {
37
37
  description = "Images of the tools people build, pushed by kuriko-builder."
38
38
  value = "${var.region}-docker.pkg.dev/${var.project_id}/${google_artifact_registry_repository.tools.repository_id}"
39
39
  }
40
+
41
+ output "gateway_service_account" {
42
+ description = "The one identity that reads company data. Grant it read access to data Kuriko should reach (e.g. a BigQuery dataset), in the Terraform that owns that data."
43
+ value = google_service_account.gateway.email
44
+ }
45
+
46
+ output "gateway_member" {
47
+ description = "The gateway as an IAM member, e.g. member = module.kuriko.gateway_member on a google_bigquery_dataset_iam_member."
48
+ value = google_service_account.gateway.member
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuriko",
3
- "version": "0.3.2",
3
+ "version": "0.5.0",
4
4
  "description": "Kuriko's admin CLI: install, upgrade and destroy Kuriko in your own cloud.",
5
5
  "type": "module",
6
6
  "bin": {