Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.
This repository was archived by the owner on Aug 20, 2025. It is now read-only.

gcp_enforce_naming DOES NOT work when a random string added to resource name #404

@zack-amirakulov

Description

@zack-amirakulov

gcp_enforce_naming DOES NOT work when a random string is added to the resource name. An error with placeholder-BpLnfgDs

Reproduced with the following TF code:

resource "random_string" "random_prefix" {
  length  = 8
  special = false
  upper   = false
}

resource "google_storage_bucket" "bucket" {
  name     = "${var.name}-${var.environment}-${random_string.random_prefix.result}"
  project  = var.project_id
  location = var.location
}

Getting error:
//storage.googleapis.com/placeholder-BpLnfgDs: placeholder-BpLnfgDs does not obey the naming convention. Use built-in Terraform modules for provisioning resources. Full address: //storage.googleapis.com/placeholder-BpLnfgDs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions