Skip to content

Commit

Permalink
Hyphen allowed in des and dsk (Azure#20)
Browse files Browse the repository at this point in the history
* Hyphen allowed in des and dsk

The value must have a length of at most 80.
The name must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.

* Add correct syntax for DES & managed disks in resourceDefinition.json

* Undo changes in main.tf

* go run main.go

* terraform fmt
  • Loading branch information
Marcel Sinn authored Jul 7, 2020
1 parent 3e60f79 commit 5ed9ddf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ locals {
regex = "^[a-zA-Z0-9][a-zA-Z0-9-_.]+[a-zA-Z0-9_]$"
}
disk_encryption_set = {
name = substr(join("", compact([local.prefix_safe, "des", local.suffix_safe])), 0, 80)
name_unique = substr(join("", compact([local.prefix_safe, "des", local.suffix_unique_safe])), 0, 80)
dashes = false
name = substr(join("-", compact([local.prefix, "des", local.suffix])), 0, 80)
name_unique = substr(join("-", compact([local.prefix, "des", local.suffix_unique])), 0, 80)
dashes = true
slug = "des"
min_length = 1
max_length = 80
Expand Down Expand Up @@ -352,9 +352,9 @@ locals {
regex = "^[^\\/\"\\[\\]:|<>+=;,?*@&_][^\\/\"\\[\\]:|<>+=;,?*@&]+[^\\/\"\\[\\]:|<>+=;,?*@&.-]$"
}
managed_disk = {
name = substr(join("", compact([local.prefix_safe, "dsk", local.suffix_safe])), 0, 80)
name_unique = substr(join("", compact([local.prefix_safe, "dsk", local.suffix_unique_safe])), 0, 80)
dashes = false
name = substr(join("-", compact([local.prefix, "dsk", local.suffix])), 0, 80)
name_unique = substr(join("-", compact([local.prefix, "dsk", local.suffix_unique])), 0, 80)
dashes = true
slug = "dsk"
min_length = 1
max_length = 80
Expand Down
6 changes: 3 additions & 3 deletions resourceDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
"regex": "^(?=.{1,80}$)[a-zA-Z0-9_]+$",
"scope": "resourceGroup",
"slug": "des",
"dashes": false
"dashes": true
},
{
"name": "image",
Expand Down Expand Up @@ -360,7 +360,7 @@
"regex": "^(?=.{1,80}$)[a-zA-Z0-9_]+$",
"scope": "resourceGroup",
"slug": "dsk",
"dashes": false
"dashes": true
},
{
"name": "virtual_machine",
Expand Down Expand Up @@ -2056,4 +2056,4 @@
"slug": "rlhc",
"dashes": true
}
]
]

0 comments on commit 5ed9ddf

Please sign in to comment.