terraform-google-modules/terraform-google-cloud-storage

Bucket names are not validated

nbugden opened this issue · 2 comments

TL;DR

Terraform produces a valid plan despite bucket names not adhering to the bucket name requirements in the docs. When this plan is applied it fails to provision the bucket.

Expected behavior

Terraform plan should fail when the bucket name(s) are invalid. When validating the terraform plan as part of PR check requirements, this would block merging bucket name(s) that cannot be applied.

Observed behavior

Terraform plan is successful even though bucket name(s) are invalid. When validating the terraform plan as part of PR check requirements, this would block allow merging bucket name(s) that cannot be applied. Resulting in a fix needing to be pushed.

Terraform Configuration

module "bucket" {
  source  = "terraform-google-modules/cloud-storage/google//modules/simple_bucket"
  version = "~> 5.0"

  name       = "my-really-long-bucket-name-with-invalid-ChAraCTers-*&^-and-google-in-the-name"
  project_id = "example-project"
  location   = "us-east1"
  iam_members = [{
    role   = "roles/storage.objectViewer"
    member = "user:example-user@example.com"
  }]
}

Terraform Version

Terraform v1.7.4
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v5.22.0
+ provider registry.terraform.io/hashicorp/google-beta v5.22.0
+ provider registry.terraform.io/hashicorp/null v3.2.2
+ provider registry.terraform.io/hashicorp/random v3.6.0
+ provider registry.terraform.io/hashicorp/time v0.11.1

Additional information

No response

Validate after the following changes are merged to the provider:

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days