Skip to content

Commit

Permalink
fix: corrections from .avm pre-commit and aligning examples to AV…
Browse files Browse the repository at this point in the history
…M specification

* fix: add prevent deletion block to provider block in examples
* chore: bump version
* fix: results from running ".avm pre-commit"
  • Loading branch information
kewalaka authored Mar 16, 2024
1 parent db1bad0 commit f710a98
Show file tree
Hide file tree
Showing 19 changed files with 175 additions and 137 deletions.
10 changes: 7 additions & 3 deletions examples/dapr_component/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ terraform {
provider "azurerm" {
skip_provider_registration = true
features {}
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
# This ensures we have unique CAF compliant names for our resources.
Expand All @@ -27,14 +31,14 @@ module "naming" {
# This is required for resource modules
resource "azurerm_resource_group" "this" {
name = module.naming.resource_group.name_unique
location = "australiaeast"
name = module.naming.resource_group.name_unique
}
resource "azurerm_log_analytics_workspace" "this" {
location = azurerm_resource_group.this.location
name = module.naming.log_analytics_workspace.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
}
module "managedenvironment" {
Expand Down
10 changes: 7 additions & 3 deletions examples/dapr_component/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ terraform {

provider "azurerm" {
skip_provider_registration = true
features {}
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}

# This ensures we have unique CAF compliant names for our resources.
Expand All @@ -21,14 +25,14 @@ module "naming" {

# This is required for resource modules
resource "azurerm_resource_group" "this" {
name = module.naming.resource_group.name_unique
location = "australiaeast"
name = module.naming.resource_group.name_unique
}

resource "azurerm_log_analytics_workspace" "this" {
location = azurerm_resource_group.this.location
name = module.naming.log_analytics_workspace.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
}

module "managedenvironment" {
Expand Down
10 changes: 7 additions & 3 deletions examples/default/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ terraform {
provider "azurerm" {
skip_provider_registration = true
features {}
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
# This ensures we have unique CAF compliant names for our resources.
Expand All @@ -27,14 +31,14 @@ module "naming" {
# This is required for resource modules
resource "azurerm_resource_group" "this" {
name = module.naming.resource_group.name_unique
location = "australiaeast"
name = module.naming.resource_group.name_unique
}
resource "azurerm_log_analytics_workspace" "this" {
location = azurerm_resource_group.this.location
name = module.naming.log_analytics_workspace.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
}
module "managedenvironment" {
Expand Down
10 changes: 7 additions & 3 deletions examples/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ terraform {

provider "azurerm" {
skip_provider_registration = true
features {}
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}

# This ensures we have unique CAF compliant names for our resources.
Expand All @@ -21,14 +25,14 @@ module "naming" {

# This is required for resource modules
resource "azurerm_resource_group" "this" {
name = module.naming.resource_group.name_unique
location = "australiaeast"
name = module.naming.resource_group.name_unique
}

resource "azurerm_log_analytics_workspace" "this" {
location = azurerm_resource_group.this.location
name = module.naming.log_analytics_workspace.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
}

module "managedenvironment" {
Expand Down
18 changes: 11 additions & 7 deletions examples/storage_share/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ terraform {
provider "azurerm" {
skip_provider_registration = true
features {}
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
# This ensures we have unique CAF compliant names for our resources.
Expand All @@ -27,28 +31,28 @@ module "naming" {
# This is required for resource modules
resource "azurerm_resource_group" "this" {
name = module.naming.resource_group.name_unique
location = "australiaeast"
name = module.naming.resource_group.name_unique
}
resource "azurerm_log_analytics_workspace" "this" {
location = azurerm_resource_group.this.location
name = module.naming.log_analytics_workspace.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
}
resource "azurerm_storage_account" "this" {
account_replication_type = "LRS"
account_tier = "Standard"
location = azurerm_resource_group.this.location
name = module.naming.storage_account.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_storage_share" "this" {
name = "sharename"
storage_account_name = azurerm_storage_account.this.name
quota = 5
storage_account_name = azurerm_storage_account.this.name
}
module "managedenvironment" {
Expand Down
18 changes: 11 additions & 7 deletions examples/storage_share/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ terraform {

provider "azurerm" {
skip_provider_registration = true
features {}
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}

# This ensures we have unique CAF compliant names for our resources.
Expand All @@ -21,28 +25,28 @@ module "naming" {

# This is required for resource modules
resource "azurerm_resource_group" "this" {
name = module.naming.resource_group.name_unique
location = "australiaeast"
name = module.naming.resource_group.name_unique
}

resource "azurerm_log_analytics_workspace" "this" {
location = azurerm_resource_group.this.location
name = module.naming.log_analytics_workspace.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
}

resource "azurerm_storage_account" "this" {
account_replication_type = "LRS"
account_tier = "Standard"
location = azurerm_resource_group.this.location
name = module.naming.storage_account.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
account_tier = "Standard"
account_replication_type = "LRS"
}

resource "azurerm_storage_share" "this" {
name = "sharename"
storage_account_name = azurerm_storage_account.this.name
quota = 5
storage_account_name = azurerm_storage_account.this.name
}

module "managedenvironment" {
Expand Down
18 changes: 12 additions & 6 deletions examples/workload_profile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ terraform {
provider "azurerm" {
skip_provider_registration = true
features {}
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
# This ensures we have unique CAF compliant names for our resources.
Expand All @@ -31,31 +35,33 @@ module "naming" {
# This is required for resource modules
resource "azurerm_resource_group" "this" {
name = module.naming.resource_group.name_unique
location = "australiaeast"
name = module.naming.resource_group.name_unique
}
resource "azurerm_log_analytics_workspace" "this" {
location = azurerm_resource_group.this.location
name = module.naming.log_analytics_workspace.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
}
# Create the vnet to use with vnet integration
resource "azurerm_virtual_network" "this" {
name = module.naming.virtual_network.name_unique
address_space = ["192.168.0.0/23"]
location = azurerm_resource_group.this.location
name = module.naming.virtual_network.name_unique
resource_group_name = azurerm_resource_group.this.name
address_space = ["192.168.0.0/23"]
}
resource "azurerm_subnet" "this" {
address_prefixes = ["192.168.0.0/23"]
name = module.naming.subnet.name_unique
resource_group_name = azurerm_resource_group.this.name
virtual_network_name = azurerm_virtual_network.this.name
address_prefixes = ["192.168.0.0/23"]
delegation {
name = "Microsoft.App.environments"
service_delegation {
name = "Microsoft.App/environments"
actions = ["Microsoft.Network/virtualNetworks/subnets/join/action"]
Expand Down
18 changes: 12 additions & 6 deletions examples/workload_profile/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ terraform {

provider "azurerm" {
skip_provider_registration = true
features {}
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}

# This ensures we have unique CAF compliant names for our resources.
Expand All @@ -21,31 +25,33 @@ module "naming" {

# This is required for resource modules
resource "azurerm_resource_group" "this" {
name = module.naming.resource_group.name_unique
location = "australiaeast"
name = module.naming.resource_group.name_unique
}

resource "azurerm_log_analytics_workspace" "this" {
location = azurerm_resource_group.this.location
name = module.naming.log_analytics_workspace.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
}

# Create the vnet to use with vnet integration
resource "azurerm_virtual_network" "this" {
name = module.naming.virtual_network.name_unique
address_space = ["192.168.0.0/23"]
location = azurerm_resource_group.this.location
name = module.naming.virtual_network.name_unique
resource_group_name = azurerm_resource_group.this.name
address_space = ["192.168.0.0/23"]
}

resource "azurerm_subnet" "this" {
address_prefixes = ["192.168.0.0/23"]
name = module.naming.subnet.name_unique
resource_group_name = azurerm_resource_group.this.name
virtual_network_name = azurerm_virtual_network.this.name
address_prefixes = ["192.168.0.0/23"]

delegation {
name = "Microsoft.App.environments"

service_delegation {
name = "Microsoft.App/environments"
actions = ["Microsoft.Network/virtualNetworks/subnets/join/action"]
Expand Down
18 changes: 12 additions & 6 deletions examples/workload_profile_internal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ terraform {
provider "azurerm" {
skip_provider_registration = true
features {}
features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
}
# This ensures we have unique CAF compliant names for our resources.
Expand All @@ -27,31 +31,33 @@ module "naming" {
# This is required for resource modules
resource "azurerm_resource_group" "this" {
name = module.naming.resource_group.name_unique
location = "australiaeast"
name = module.naming.resource_group.name_unique
}
resource "azurerm_log_analytics_workspace" "this" {
location = azurerm_resource_group.this.location
name = module.naming.log_analytics_workspace.name_unique
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
}
# Create the vnet to use with vnet integration
resource "azurerm_virtual_network" "this" {
name = module.naming.virtual_network.name_unique
address_space = ["192.168.0.0/23"]
location = azurerm_resource_group.this.location
name = module.naming.virtual_network.name_unique
resource_group_name = azurerm_resource_group.this.name
address_space = ["192.168.0.0/23"]
}
resource "azurerm_subnet" "this" {
address_prefixes = ["192.168.0.0/23"]
name = module.naming.subnet.name_unique
resource_group_name = azurerm_resource_group.this.name
virtual_network_name = azurerm_virtual_network.this.name
address_prefixes = ["192.168.0.0/23"]
delegation {
name = "Microsoft.App.environments"
service_delegation {
name = "Microsoft.App/environments"
actions = ["Microsoft.Network/virtualNetworks/subnets/join/action"]
Expand Down
Loading

0 comments on commit f710a98

Please sign in to comment.