Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update prefix description at the stack level #211

Open
vburckhardt opened this issue Sep 27, 2024 · 3 comments
Open

update prefix description at the stack level #211

vburckhardt opened this issue Sep 27, 2024 · 3 comments

Comments

@vburckhardt
Copy link
Member

The prefix for landing zone requires to not start with a number (specific to landing zone). Suggest to take the description for the prefix in landingzone and use it at the stack level.

@vburckhardt
Copy link
Member Author

vburckhardt commented Sep 27, 2024

Hi @toddgiguere - do you have the context for the extra restriction on end and start with letters only - which service is putting this restriction?

variable "prefix" {
  description = "A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 16 or fewer characters."
  type        = string

  validation {
    error_message = "Prefix must begin and end with a letter and contain only letters, numbers, and - characters."
    condition     = can(regex("^([A-z]|[a-z][-a-z0-9]*[a-z0-9])$", var.prefix))
  }
}

@toddgiguere
Copy link
Contributor

@vburckhardt where did you see the above code block? In patterns/roks/variables.tf it has a different description:

variable "prefix" {
  description = "A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 13 or fewer characters."
  type        = string

  validation {
    error_message = "Prefix must begin with a letter and contain only lowercase letters, numbers, and - characters. Prefixes must end with a lowercase letter or number and be 13 or fewer characters."
    condition     = can(regex("^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", var.prefix)) && length(var.prefix) <= 13
  }
}

@toddgiguere
Copy link
Contributor

@vburckhardt The prefix restrictions were part of the initial code that we took over, looking at the git blame the restriction of "must begin with letter" has been there since the very first commit from the other team.

@ocofaigh ocofaigh transferred this issue from terraform-ibm-modules/dev-rag Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants