"name" did not match regex "^[0-9a-z]([-0-9a-z]{0,61}[0-9a-z])?$"

Has anybody experienced this error before? Please help me out.

│ Error: name (“nqiic_storage”) can only consist of lowercase letters and numbers, and must be between 3 and 24 characters long│
│ with azurerm_storage_account.storage,
│ on main.tf line 19, in resource “azurerm_storage_account” “storage”:
│ 19: name = var.examplestorage



│ Error: “name” did not match regex “[1]([-0-9a-z]{0,61}[0-9a-z])?$”

│ with azurerm_sql_server.sqlserver,
│ on main.tf line 29, in resource “azurerm_sql_server” “sqlserver”:
│ 29: name = var.exampleserver



│ Error: “name” can contain only lowercase letters, numbers, and ‘-’, but can’t start or end with ‘-’ or have more than 63 characters.

│ with azurerm_sql_server.sqlserver,
│ on main.tf line 29, in resource “azurerm_sql_server” “sqlserver”:
│ 29: name = var.exampleserver



│ Error: Incorrect attribute value type

│ on main.tf line 43, in resource “azurerm_virtual_network” “vnet”:
│ 43: address_space = var.address_space
│ ├────────────────
│ │ var.address_space is “10.1.0.0/16”

│ Inappropriate value for attribute “address_space”: list of string required.


  1. 0-9a-z ↩︎

Hello,
let me help you with your concern.
you can’t use (_) in naming the resource use (-) instead.
replace (“nqiic_storage”) with (“nqiic-storage”).
thanks,
KodeKloud support