Skip to content

Commit

Permalink
AVM review 1 (#35)
Browse files Browse the repository at this point in the history
* commit before pull

* pull main, update docs

* add default for application_type for application_insights
  • Loading branch information
donovm4 authored Apr 18, 2024
1 parent 658a81f commit a75310d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Type:

```hcl
object({
application_type = optional(string)
application_type = optional(string, "web")
inherit_tags = optional(bool, false)
location = optional(string)
name = optional(string)
Expand Down Expand Up @@ -809,7 +809,7 @@ Description: Should Application Insights be enabled for the Function App?

Type: `bool`

Default: `false`
Default: `true`

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

Expand Down Expand Up @@ -1036,8 +1036,6 @@ Description: A map of private endpoints to create on this resource. The map key
- `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.
- `name` - The name of the IP configuration.
- `private_ip_address` - The private IP address of the IP configuration.
- `inherit_lock` - (Optional) Should the private endpoint inherit the lock from the parent resource? Defaults to `true`.
- `inherit_tags` - (Optional) Should the private endpoint inherit the tags from the parent resource? Defaults to `true`.

Type:

Expand Down Expand Up @@ -1070,8 +1068,6 @@ map(object({
name = string
private_ip_address = string
})), {})
# inherit_lock = optional(bool, true)
# inherit_tags = optional(bool, true)
}))
```

Expand Down
6 changes: 3 additions & 3 deletions main.application_insights.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ resource "azurerm_application_insights" "this" {
count = var.enable_application_insights ? 1 : 0

application_type = var.application_insights.application_type
location = var.application_insights.location
name = var.application_insights.name
resource_group_name = var.application_insights.resource_group_name
location = coalesce(var.application_insights.location, var.location)
name = coalesce(var.application_insights.name, "ai-${var.name}")
resource_group_name = coalesce(var.application_insights.resource_group_name, var.resource_group_name)
daily_data_cap_in_gb = var.application_insights.daily_data_cap_in_gb
daily_data_cap_notifications_disabled = var.application_insights.daily_data_cap_notifications_disabled
disable_ip_masking = var.application_insights.disable_ip_masking
Expand Down
8 changes: 2 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ variable "app_settings" {

variable "application_insights" {
type = object({
application_type = optional(string)
application_type = optional(string, "web")
inherit_tags = optional(bool, false)
location = optional(string)
name = optional(string)
Expand Down Expand Up @@ -734,7 +734,7 @@ variable "diagnostic_settings" {

variable "enable_application_insights" {
type = bool
default = false
default = true
description = "Should Application Insights be enabled for the Function App?"
}

Expand Down Expand Up @@ -946,8 +946,6 @@ variable "private_endpoints" {
name = string
private_ip_address = string
})), {})
# inherit_lock = optional(bool, true)
# inherit_tags = optional(bool, true)
}))
default = {}
description = <<DESCRIPTION
Expand All @@ -968,8 +966,6 @@ A map of private endpoints to create on this resource. The map key is deliberate
- `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.
- `name` - The name of the IP configuration.
- `private_ip_address` - The private IP address of the IP configuration.
- `inherit_lock` - (Optional) Should the private endpoint inherit the lock from the parent resource? Defaults to `true`.
- `inherit_tags` - (Optional) Should the private endpoint inherit the tags from the parent resource? Defaults to `true`.
DESCRIPTION
nullable = false
}
Expand Down

0 comments on commit a75310d

Please sign in to comment.