Skip to content

Commit

Permalink
Add application_insights (Azure#29)
Browse files Browse the repository at this point in the history
* Add application_insights

* Update App Insights slug

Per https://docs.microsoft.com/en-us/azure/cloud-adoption-framework/ready/azure-best-practices/naming-and-tagging

* Update name restrictions

Per https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftinsights

* Update definition json and generate files

* Fix formatting
  • Loading branch information
Chris Hunt authored Sep 14, 2020
1 parent fba0aaa commit 7091351
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 @@ -115,6 +115,7 @@ postgresql_server = {
| analysis\_services\_server | n/a |
| api\_management | n/a |
| app\_configuration | n/a |
| application\_insights | n/a |
| application\_gateway | n/a |
| application\_security\_group | n/a |
| automation\_account | n/a |
Expand Down
14 changes: 14 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ locals {
scope = "resourceGroup"
regex = "^[a-zA-Z0-9_-]+$"
}
application_insights = {
name = substr(join("-", compact([local.prefix, "appi", local.suffix])), 0, 260)
name_unique = substr(join("-", compact([local.prefix, "appi", local.suffix_unique])), 0, 260)
dashes = true
slug = "appi"
min_length = 10
max_length = 260
scope = "resourceGroup"
regex = "^[^%\\&?/]+$"
}
role_assignment = {
name = substr(join("-", compact([local.prefix, "ra", local.suffix])), 0, 64)
name_unique = substr(join("-", compact([local.prefix, "ra", local.suffix_unique])), 0, 64)
Expand Down Expand Up @@ -2220,6 +2230,10 @@ locals {
valid_name = length(regexall(local.az.app_configuration.regex, local.az.app_configuration.name)) > 0 && length(local.az.app_configuration.name) > local.az.app_configuration.min_length
valid_name_unique = length(regexall(local.az.app_configuration.regex, local.az.app_configuration.name_unique)) > 0
}
application_insights = {
valid_name = length(regexall(local.az.application_insights.regex, local.az.application_insights.name)) > 0 && length(local.az.application_insights.name) > local.az.application_insights.min_length
valid_name_unique = length(regexall(local.az.application_insights.regex, local.az.application_insights.name_unique)) > 0
}
role_assignment = {
valid_name = length(regexall(local.az.role_assignment.regex, local.az.role_assignment.name)) > 0 && length(local.az.role_assignment.name) > local.az.role_assignment.min_length
valid_name_unique = length(regexall(local.az.role_assignment.regex, local.az.role_assignment.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 @@ -18,6 +18,10 @@ output "app_configuration" {
value = local.az.app_configuration
}

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

output "role_assignment" {
value = local.az.role_assignment
}
Expand Down
11 changes: 11 additions & 0 deletions resourceDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
"slug": "appcg",
"dashes": true
},
{
"name": "application_insights",
"length": {
"min": 10,
"max": 260
},
"regex": "^[^%\\\\&?/]+$",
"scope": "resourceGroup",
"slug": "appi",
"dashes": true
},
{
"name": "role_assignment",
"length": {
Expand Down

0 comments on commit 7091351

Please sign in to comment.