Skip to content

Commit

Permalink
Examples: Updating broken examples (#28406)
Browse files Browse the repository at this point in the history
* fix examples

* fix remaining examples
  • Loading branch information
catriona-m authored Jan 16, 2025
1 parent 28dae03 commit 33c15ec
Show file tree
Hide file tree
Showing 40 changed files with 110 additions and 327 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resource "azurerm_key_vault_access_policy" "current_user" {
}

data "azuread_service_principal" "web_app_resource_provider" {
application_id = "abfa0a7c-a6b6-4736-8310-5855508787cd"
client_id = data.azurerm_client_config.current.client_id
}

resource "azurerm_key_vault_access_policy" "web_app_resource_provider" {
Expand Down
4 changes: 2 additions & 2 deletions examples/app-service/docker-authentication/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ resource "azurerm_linux_web_app" "example" {

site_config {
application_stack {
docker_image = "jackofallops/azure-containerapps-python-acctest"
docker_image_tag = "v0.0.1"
docker_image_name = "nginx:latest"
docker_registry_url = "https://index.docker.io"
}
}

Expand Down
24 changes: 5 additions & 19 deletions examples/azure-monitoring/eventhub_integration/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,13 @@ resource "azurerm_monitor_diagnostic_setting" "example" {
eventhub_name = azurerm_eventhub.example.name
eventhub_authorization_rule_id = azurerm_eventhub_namespace_authorization_rule.example.id

dynamic "log" {
for_each = data.azurerm_monitor_diagnostic_categories.example.logs
dynamic "enabled_log" {
for_each = data.azurerm_monitor_diagnostic_categories.example.log_category_types
content {
category = log.key

retention_policy {
enabled = false
days = 0
}
category = enabled_log.key
}
}
dynamic "metric" {
for_each = data.azurerm_monitor_diagnostic_categories.example.metrics

content {
category = metric.key

retention_policy {
enabled = false
days = 0
}
}
metric {
category = "AllMetrics"
}
}
11 changes: 6 additions & 5 deletions examples/batch/custom-image/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ resource "azurerm_image" "example" {
resource_group_name = azurerm_resource_group.example.name

os_disk {
os_type = "Linux"
os_state = "Generalized"
blob_uri = azurerm_virtual_machine.example.storage_os_disk.0.vhd_uri
size_gb = 30
caching = "None"
os_type = "Linux"
os_state = "Generalized"
blob_uri = azurerm_virtual_machine.example.storage_os_disk.0.vhd_uri
size_gb = 30
caching = "None"
storage_type = "Standard_LRS"
}

tags = {
Expand Down
2 changes: 1 addition & 1 deletion examples/cosmos-db/failover/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource "azurerm_cosmosdb_account" "example" {
// set ip_range_filter to allow azure services (0.0.0.0) and azure portal.
// https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-configure-firewall#allow-requests-from-the-azure-portal
// https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-configure-firewall#allow-requests-from-global-azure-datacenters-or-other-sources-within-azure
ip_range_filter = "0.0.0.0,104.42.195.92,40.76.54.131,52.176.6.30,52.169.50.45,52.187.184.26"
ip_range_filter = ["0.0.0.0", "104.42.195.92", "40.76.54.131", "52.176.6.30", "52.169.50.45", "52.187.184.26"]

consistency_policy {
consistency_level = "BoundedStaleness"
Expand Down
2 changes: 1 addition & 1 deletion examples/hdinsight/enterprise-security-package/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ resource "azurerm_subnet" "example" {
name = "${var.prefix}-subnet"
resource_group_name = azurerm_resource_group.example.name
virtual_network_name = azurerm_virtual_network.example.name
address_prefixes = [cidrsubnet(azurerm_virtual_network.example.address_space.0, 8, 0)]
address_prefixes = azurerm_virtual_network.example.address_space
}

resource "azurerm_network_security_group" "example" {
Expand Down
9 changes: 5 additions & 4 deletions examples/image/from_vhd/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ resource "azurerm_image" "example" {
resource_group_name = azurerm_resource_group.example.name

os_disk {
os_type = "Linux"
os_state = "Generalized"
blob_uri = azurerm_virtual_machine.example.storage_os_disk[0].vhd_uri
size_gb = 30
os_type = "Linux"
os_state = "Generalized"
blob_uri = azurerm_virtual_machine.example.storage_os_disk[0].vhd_uri
size_gb = 30
storage_type = "Standard_LRS"
}
}
2 changes: 1 addition & 1 deletion examples/kubernetes/egress-with-udr-azure-cni/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ resource "azurerm_route_table" "example" {
name = "${var.prefix}fwrt"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
disable_bgp_route_propagation = false
bgp_route_propagation_enabled = true

route {
name = "${var.prefix}fwrn"
Expand Down
2 changes: 1 addition & 1 deletion examples/kubernetes/egress-with-udr-kubenet/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ resource "azurerm_route_table" "example" {
name = "${var.prefix}fwrt"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
disable_bgp_route_propagation = false
bgp_route_propagation_enabled = true

route {
name = "${var.prefix}fwrn"
Expand Down
9 changes: 0 additions & 9 deletions examples/media-services/basic-with-assets/README.md

This file was deleted.

45 changes: 0 additions & 45 deletions examples/media-services/basic-with-assets/main.tf

This file was deleted.

10 changes: 0 additions & 10 deletions examples/media-services/basic-with-assets/variables.tf

This file was deleted.

9 changes: 0 additions & 9 deletions examples/media-services/basic/README.md

This file was deleted.

38 changes: 0 additions & 38 deletions examples/media-services/basic/main.tf

This file was deleted.

10 changes: 0 additions & 10 deletions examples/media-services/basic/variables.tf

This file was deleted.

9 changes: 0 additions & 9 deletions examples/media-services/multiple-storage-accounts/README.md

This file was deleted.

51 changes: 0 additions & 51 deletions examples/media-services/multiple-storage-accounts/main.tf

This file was deleted.

10 changes: 0 additions & 10 deletions examples/media-services/multiple-storage-accounts/variables.tf

This file was deleted.

10 changes: 5 additions & 5 deletions examples/netapp/nfsv3_volume_with_backup_policy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
provider "azurerm" {
features {
netapp {
prevent_volume_destruction = false
prevent_volume_destruction = false
delete_backups_on_backup_vault_destroy = true
}
}
Expand Down Expand Up @@ -59,7 +59,7 @@ resource "azurerm_netapp_backup_policy" "example" {
daily_backups_to_keep = 2
weekly_backups_to_keep = 2
monthly_backups_to_keep = 2
enabled = true
enabled = true
}

resource "azurerm_netapp_pool" "example" {
Expand Down Expand Up @@ -95,9 +95,9 @@ resource "azurerm_netapp_volume" "example" {
}

export_policy_rule {
rule_index = 1
allowed_clients = ["0.0.0.0/0"]
rule_index = 1
allowed_clients = ["0.0.0.0/0"]
protocols_enabled = ["NFSv3"]
unix_read_write = true
unix_read_write = true
}
}
1 change: 1 addition & 0 deletions examples/paloalto/ngfw-virtual-network-rulestack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ resource "azurerm_palo_alto_local_rulestack_rule" "example" {
rulestack_id = azurerm_palo_alto_local_rulestack.example.id
priority = 9999
action = "DenySilent"
protocol = "application-default"

applications = ["any"]

Expand Down
2 changes: 1 addition & 1 deletion examples/private-endpoint/application-gateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ resource "azurerm_subnet" "endpoint" {
virtual_network_name = azurerm_virtual_network.example.name
address_prefixes = ["10.0.2.0/24"]

private_endpoint_network_policies_enabled = false
private_endpoint_network_policies = "Disabled"
}

resource "azurerm_public_ip" "example" {
Expand Down
2 changes: 1 addition & 1 deletion examples/private-endpoint/postgresql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource "azurerm_subnet" "endpoint" {
virtual_network_name = azurerm_virtual_network.example.name
address_prefixes = ["10.0.2.0/24"]

private_endpoint_network_policies_enabled = false
private_endpoint_network_policies = "Disabled"
}

resource "azurerm_postgresql_server" "example" {
Expand Down
2 changes: 1 addition & 1 deletion examples/private-endpoint/private-dns-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ resource "azurerm_subnet" "endpoint" {
virtual_network_name = azurerm_virtual_network.example.name
address_prefixes = ["10.0.2.0/24"]

private_endpoint_network_policies_enabled = false
private_endpoint_network_policies = "Disabled"
}

resource "azurerm_private_dns_zone" "example" {
Expand Down
Loading

0 comments on commit 33c15ec

Please sign in to comment.