Skip to content

Add variable validation for customer_id #16

@xingao267

Description

@xingao267

Something like the following

variable "customer_id" {
  description = "..."
  type        = string
  validation {
    condition     = can(regex("^customers/C0[a-z0-9]{7}$", var.customer_id))
    error_message = "Customer ID must be in the form customers/C0xxxxxxx."
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions