Skip to content

Commit

Permalink
Add User Assigned Identity (Azure#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
devblackops authored Oct 21, 2021
1 parent a31a1ef commit d86d409
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ postgresql_server = {
| template\_deployment | n/a |
| traffic\_manager\_profile | n/a |
| unique-seed | n/a |
| user\_assigned\_identity | n/a |
| validation | n/a |
| virtual\_machine | n/a |
| virtual\_machine\_extension | n/a |
Expand Down
14 changes: 14 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2146,6 +2146,16 @@ locals {
scope = "global"
regex = "^[a-zA-Z0-9][a-zA-Z0-9-.]+[a-zA-Z0-9_]$"
}
user_assigned_identity = {
name = substr(join("-", compact([local.prefix, "uai", local.suffix])), 0, 128)
name_unique = substr(join("-", compact([local.prefix, "uai", local.suffix_unique])), 0, 128)
dashes = true
slug = "uai"
min_length = 3
max_length = 128
scope = "resourceGroup"
regex = "^[a-zA-Z0-9-_]+$"
}
virtual_machine = {
name = substr(join("-", compact([local.prefix, "vm", local.suffix])), 0, 15)
name_unique = substr(join("-", compact([local.prefix, "vm", local.suffix_unique])), 0, 15)
Expand Down Expand Up @@ -3092,6 +3102,10 @@ locals {
valid_name = length(regexall(local.az.traffic_manager_profile.regex, local.az.traffic_manager_profile.name)) > 0 && length(local.az.traffic_manager_profile.name) > local.az.traffic_manager_profile.min_length
valid_name_unique = length(regexall(local.az.traffic_manager_profile.regex, local.az.traffic_manager_profile.name_unique)) > 0
}
user_assigned_identity = {
valid_name = length(regexall(local.az.user_assigned_identity.regex, local.az.user_assigned_identity.name)) > 0 && length(local.az.user_assigned_identity.name) > local.az.user_assigned_identity.min_length
valid_name_unique = length(regexall(local.az.user_assigned_identity.regex, local.az.user_assigned_identity.name_unique)) > 0
}
virtual_machine = {
valid_name = length(regexall(local.az.virtual_machine.regex, local.az.virtual_machine.name)) > 0 && length(local.az.virtual_machine.name) > local.az.virtual_machine.min_length
valid_name_unique = length(regexall(local.az.virtual_machine.regex, local.az.virtual_machine.name_unique)) > 0
Expand Down
4 changes: 4 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,10 @@ output "traffic_manager_profile" {
value = local.az.traffic_manager_profile
}

output "user_assigned_identity" {
value = local.az.user_assigned_identity
}

output "virtual_machine" {
value = local.az.virtual_machine
}
Expand Down
11 changes: 11 additions & 0 deletions resourceDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -2012,6 +2012,17 @@
"slug": "traf",
"dashes": true
},
{
"name": "user_assigned_identity",
"length": {
"min": 3,
"max": 128
},
"regex": "^[a-zA-Z0-9-_]+$",
"scope": "resourceGroup",
"slug": "uai",
"dashes": true
},
{
"name": "virtual_machine",
"length": {
Expand Down

0 comments on commit d86d409

Please sign in to comment.