Skip to content

Commit a75310d

Browse files
authored
AVM review 1 (#35)
* commit before pull * pull main, update docs * add default for application_type for application_insights
1 parent 658a81f commit a75310d

3 files changed

Lines changed: 7 additions & 15 deletions

File tree

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Type:
130130

131131
```hcl
132132
object({
133-
application_type = optional(string)
133+
application_type = optional(string, "web")
134134
inherit_tags = optional(bool, false)
135135
location = optional(string)
136136
name = optional(string)
@@ -809,7 +809,7 @@ Description: Should Application Insights be enabled for the Function App?
809809

810810
Type: `bool`
811811

812-
Default: `false`
812+
Default: `true`
813813

814814
### <a name="input_enable_telemetry"></a> [enable\_telemetry](#input\_enable\_telemetry)
815815

@@ -1036,8 +1036,6 @@ Description: A map of private endpoints to create on this resource. The map key
10361036
- `ip_configurations` - (Optional) A map of IP configurations to create on the private endpoint. If not specified the platform will create one. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.
10371037
- `name` - The name of the IP configuration.
10381038
- `private_ip_address` - The private IP address of the IP configuration.
1039-
- `inherit_lock` - (Optional) Should the private endpoint inherit the lock from the parent resource? Defaults to `true`.
1040-
- `inherit_tags` - (Optional) Should the private endpoint inherit the tags from the parent resource? Defaults to `true`.
10411039

10421040
Type:
10431041

@@ -1070,8 +1068,6 @@ map(object({
10701068
name = string
10711069
private_ip_address = string
10721070
})), {})
1073-
# inherit_lock = optional(bool, true)
1074-
# inherit_tags = optional(bool, true)
10751071
}))
10761072
```
10771073

main.application_insights.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ resource "azurerm_application_insights" "this" {
22
count = var.enable_application_insights ? 1 : 0
33

44
application_type = var.application_insights.application_type
5-
location = var.application_insights.location
6-
name = var.application_insights.name
7-
resource_group_name = var.application_insights.resource_group_name
5+
location = coalesce(var.application_insights.location, var.location)
6+
name = coalesce(var.application_insights.name, "ai-${var.name}")
7+
resource_group_name = coalesce(var.application_insights.resource_group_name, var.resource_group_name)
88
daily_data_cap_in_gb = var.application_insights.daily_data_cap_in_gb
99
daily_data_cap_notifications_disabled = var.application_insights.daily_data_cap_notifications_disabled
1010
disable_ip_masking = var.application_insights.disable_ip_masking

variables.tf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ variable "app_settings" {
6969

7070
variable "application_insights" {
7171
type = object({
72-
application_type = optional(string)
72+
application_type = optional(string, "web")
7373
inherit_tags = optional(bool, false)
7474
location = optional(string)
7575
name = optional(string)
@@ -734,7 +734,7 @@ variable "diagnostic_settings" {
734734

735735
variable "enable_application_insights" {
736736
type = bool
737-
default = false
737+
default = true
738738
description = "Should Application Insights be enabled for the Function App?"
739739
}
740740

@@ -946,8 +946,6 @@ variable "private_endpoints" {
946946
name = string
947947
private_ip_address = string
948948
})), {})
949-
# inherit_lock = optional(bool, true)
950-
# inherit_tags = optional(bool, true)
951949
}))
952950
default = {}
953951
description = <<DESCRIPTION
@@ -968,8 +966,6 @@ A map of private endpoints to create on this resource. The map key is deliberate
968966
- `ip_configurations` - (Optional) A map of IP configurations to create on the private endpoint. If not specified the platform will create one. The map key is deliberately arbitrary to avoid issues where map keys maybe unknown at plan time.
969967
- `name` - The name of the IP configuration.
970968
- `private_ip_address` - The private IP address of the IP configuration.
971-
- `inherit_lock` - (Optional) Should the private endpoint inherit the lock from the parent resource? Defaults to `true`.
972-
- `inherit_tags` - (Optional) Should the private endpoint inherit the tags from the parent resource? Defaults to `true`.
973969
DESCRIPTION
974970
nullable = false
975971
}

0 commit comments

Comments
 (0)