Skip to content

Commit

Permalink
Add Load Test support (#121)
Browse files Browse the repository at this point in the history
* Add Load Test support

* make generate outcome

* Terraform fmt
  • Loading branch information
LaurentLesle authored Mar 19, 2024
1 parent 8a1c861 commit 6a94122
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 17 deletions.
38 changes: 26 additions & 12 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,16 @@ locals {
scope = "resourceGroup"
regex = "^[^\\/\"\\[\\]:|<>+=;,?*@&_][^\\/\"\\[\\]:|<>+=;,?*@&]+[^\\/\"\\[\\]:|<>+=;,?*@&.-]$"
}
load_test = {
name = substr(join("-", compact([local.prefix, "lt", local.suffix])), 0, 64)
name_unique = substr(join("-", compact([local.prefix, "lt", local.suffix_unique])), 0, 64)
dashes = true
slug = "lt"
min_length = 1
max_length = 64
scope = "resourceGroup"
regex = "^[a-zA-Z][a-zA-Z0-9-_]{0,62}[a-zA-Z0-9|]$"
}
local_network_gateway = {
name = substr(join("-", compact([local.prefix, "lgw", local.suffix])), 0, 80)
name_unique = substr(join("-", compact([local.prefix, "lgw", local.suffix_unique])), 0, 80)
Expand Down Expand Up @@ -1446,21 +1456,21 @@ locals {
scope = "parent"
regex = "^[^<>*%:.?\\+\\/]+[^<>*%:.?\\+\\/ ]$"
}
mssql_server = {
name = substr(join("-", compact([local.prefix, "sql", local.suffix])), 0, 63)
name_unique = substr(join("-", compact([local.prefix, "sql", local.suffix_unique])), 0, 63)
mssql_managed_instance = {
name = substr(join("-", compact([local.prefix, "sqlmi", local.suffix])), 0, 63)
name_unique = substr(join("-", compact([local.prefix, "sqlmi", local.suffix_unique])), 0, 63)
dashes = true
slug = "sql"
slug = "sqlmi"
min_length = 1
max_length = 63
scope = "global"
regex = "^[a-z0-9][a-z0-9-]+[a-z0-9]$"
}
mssql_managed_instance = {
name = lower(substr(join("-", compact([local.prefix, "sqlmi", local.suffix])), 0, 63))
name_unique = lower(substr(join("-", compact([local.prefix, "sqlmi", local.suffix_unique])), 0, 63))
mssql_server = {
name = substr(join("-", compact([local.prefix, "sql", local.suffix])), 0, 63)
name_unique = substr(join("-", compact([local.prefix, "sql", local.suffix_unique])), 0, 63)
dashes = true
slug = "sqlmi"
slug = "sql"
min_length = 1
max_length = 63
scope = "global"
Expand Down Expand Up @@ -2948,6 +2958,10 @@ locals {
valid_name = length(regexall(local.az.linux_virtual_machine_scale_set.regex, local.az.linux_virtual_machine_scale_set.name)) > 0 && length(local.az.linux_virtual_machine_scale_set.name) > local.az.linux_virtual_machine_scale_set.min_length
valid_name_unique = length(regexall(local.az.linux_virtual_machine_scale_set.regex, local.az.linux_virtual_machine_scale_set.name_unique)) > 0
}
load_test = {
valid_name = length(regexall(local.az.load_test.regex, local.az.load_test.name)) > 0 && length(local.az.load_test.name) > local.az.load_test.min_length
valid_name_unique = length(regexall(local.az.load_test.regex, local.az.load_test.name_unique)) > 0
}
local_network_gateway = {
valid_name = length(regexall(local.az.local_network_gateway.regex, local.az.local_network_gateway.name)) > 0 && length(local.az.local_network_gateway.name) > local.az.local_network_gateway.min_length
valid_name_unique = length(regexall(local.az.local_network_gateway.regex, local.az.local_network_gateway.name_unique)) > 0
Expand Down Expand Up @@ -3012,14 +3026,14 @@ locals {
valid_name = length(regexall(local.az.mssql_elasticpool.regex, local.az.mssql_elasticpool.name)) > 0 && length(local.az.mssql_elasticpool.name) > local.az.mssql_elasticpool.min_length
valid_name_unique = length(regexall(local.az.mssql_elasticpool.regex, local.az.mssql_elasticpool.name_unique)) > 0
}
mssql_server = {
valid_name = length(regexall(local.az.mssql_server.regex, local.az.mssql_server.name)) > 0 && length(local.az.mssql_server.name) > local.az.mssql_server.min_length
valid_name_unique = length(regexall(local.az.mssql_server.regex, local.az.mssql_server.name_unique)) > 0
}
mssql_managed_instance = {
valid_name = length(regexall(local.az.mssql_managed_instance.regex, local.az.mssql_managed_instance.name)) > 0 && length(local.az.mssql_managed_instance.name) > local.az.mssql_managed_instance.min_length
valid_name_unique = length(regexall(local.az.mssql_managed_instance.regex, local.az.mssql_managed_instance.name_unique)) > 0
}
mssql_server = {
valid_name = length(regexall(local.az.mssql_server.regex, local.az.mssql_server.name)) > 0 && length(local.az.mssql_server.name) > local.az.mssql_server.min_length
valid_name_unique = length(regexall(local.az.mssql_server.regex, local.az.mssql_server.name_unique)) > 0
}
mysql_database = {
valid_name = length(regexall(local.az.mysql_database.regex, local.az.mysql_database.name)) > 0 && length(local.az.mysql_database.name) > local.az.mysql_database.min_length
valid_name_unique = length(regexall(local.az.mysql_database.regex, local.az.mysql_database.name_unique)) > 0
Expand Down
15 changes: 10 additions & 5 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,11 @@ output "linux_virtual_machine_scale_set" {
description = "Linux Virtual Machine Scale Set"
}

output "load_test" {
value = local.az.load_test
description = "Load Test"
}

output "local_network_gateway" {
value = local.az.local_network_gateway
description = "Local Network Gateway"
Expand Down Expand Up @@ -711,16 +716,16 @@ output "mssql_elasticpool" {
description = "Mssql Elasticpool"
}

output "mssql_managed_instance" {
value = local.az.mssql_managed_instance
description = "Mssql Managed Instance"
}

output "mssql_server" {
value = local.az.mssql_server
description = "Mssql Server"
}

output "mssql_managed_instance" {
value = local.az.mssql_managed_instance
description = "Mssql Server Managed Instance"
}

output "mysql_database" {
value = local.az.mysql_database
description = "Mysql Database"
Expand Down
11 changes: 11 additions & 0 deletions resourceDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -1176,6 +1176,17 @@
"slug": "vmss",
"dashes": true
},
{
"name": "load_test",
"length": {
"min": 1,
"max": 64
},
"regex": "^[a-zA-Z][a-zA-Z0-9-_]{0,62}[a-zA-Z0-9|]$",
"scope": "resourceGroup",
"slug": "lt",
"dashes": true
},
{
"name": "local_network_gateway",
"length": {
Expand Down

0 comments on commit 6a94122

Please sign in to comment.