Skip to content

Commit

Permalink
add variable to expose index.html from tuf buckets
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Callaway <[email protected]>
  • Loading branch information
bobcallaway committed May 31, 2024
1 parent 0ea393c commit c49798e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions terraform/gcp/modules/sigstore/sigstore.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module "tuf" {
gcs_logging_enabled = var.gcs_logging_enabled
gcs_logging_bucket = var.gcs_logging_bucket
storage_class = var.tuf_storage_class
main_page_suffix = var.tuf_main_page_suffix

tuf_service_account_name = var.tuf_service_account_name

Expand Down
6 changes: 6 additions & 0 deletions terraform/gcp/modules/sigstore/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ variable "tuf_kms_location" {
default = "global"
}

variable "tuf_main_page_suffix" {
type = string
description = "path to tuf bucket's directory index when missing object is treated as potential directories"
default = ""
}

variable "ca_pool_name" {
description = "Certificate authority pool name"
type = string
Expand Down
8 changes: 8 additions & 0 deletions terraform/gcp/modules/tuf/tuf.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ resource "google_storage_bucket" "tuf" {
log_bucket = var.gcs_logging_bucket
}
}

website {
main_page_suffix = var.main_page_suffix
}
}

resource "google_storage_bucket_iam_member" "public_tuf_member" {
Expand Down Expand Up @@ -123,6 +127,10 @@ resource "google_storage_bucket" "tuf_preprod" {
log_bucket = var.gcs_logging_bucket
}
}

website {
main_page_suffix = var.main_page_suffix
}
}

resource "google_storage_bucket_iam_member" "public_tuf_preprod_member" {
Expand Down
6 changes: 6 additions & 0 deletions terraform/gcp/modules/tuf/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,9 @@ variable "tuf_key_viewers" {
description = "List of members who can view the public key. See https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_kms_key_ring_iam#argument-reference for supported values"
default = []
}

variable "main_page_suffix" {
type = string
description = "Behaves as the bucket's directory index where missing objects are treated as potential directories"
default = ""
}

0 comments on commit c49798e

Please sign in to comment.