-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add example for
Microsoft.Network/networkManagers
's nested resources (
#667) * add example for `Microsoft.Network/networkManagers`'s nested resources * make terrafmt
- Loading branch information
Showing
6 changed files
with
686 additions
and
1 deletion.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
examples/Microsoft.Network_networkManagers_ipamPools@2024-01-01-preview/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
terraform { | ||
required_providers { | ||
azapi = { | ||
source = "Azure/azapi" | ||
} | ||
} | ||
} | ||
|
||
provider "azapi" { | ||
skip_provider_registration = false | ||
} | ||
|
||
variable "resource_name" { | ||
type = string | ||
default = "acctest0001" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
default = "westeurope" | ||
} | ||
|
||
data "azapi_client_config" "current" {} | ||
|
||
resource "azapi_resource" "resourceGroup" { | ||
type = "Microsoft.Resources/resourceGroups@2020-06-01" | ||
name = var.resource_name | ||
location = var.location | ||
} | ||
|
||
resource "azapi_resource" "networkManager" { | ||
type = "Microsoft.Network/networkManagers@2022-09-01" | ||
parent_id = azapi_resource.resourceGroup.id | ||
name = var.resource_name | ||
location = var.location | ||
body = { | ||
properties = { | ||
description = "" | ||
networkManagerScopeAccesses = [ | ||
"SecurityAdmin", | ||
] | ||
networkManagerScopes = { | ||
managementGroups = [ | ||
] | ||
subscriptions = [ | ||
"/subscriptions/${data.azapi_client_config.current.subscription_id}", | ||
] | ||
} | ||
} | ||
} | ||
retry = { | ||
error_message_regex = ["CannotDeleteResource"] | ||
} | ||
} | ||
|
||
resource "azapi_resource" "ipamPool" { | ||
type = "Microsoft.Network/networkManagers/ipamPools@2024-01-01-preview" | ||
parent_id = azapi_resource.networkManager.id | ||
name = var.resource_name | ||
location = var.location | ||
body = { | ||
properties = { | ||
addressPrefixes = [ | ||
"10.0.0.0/24", | ||
] | ||
description = "Test description." | ||
parentPoolName = "" | ||
displayName = "testDisplayName" | ||
} | ||
} | ||
|
||
tags = { | ||
myTag = "testTag" | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
examples/Microsoft.Network_networkManagers_ipamPools_staticCidr@2024-01-01-preview/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
terraform { | ||
required_providers { | ||
azapi = { | ||
source = "Azure/azapi" | ||
} | ||
} | ||
} | ||
|
||
provider "azapi" { | ||
skip_provider_registration = false | ||
} | ||
|
||
variable "resource_name" { | ||
type = string | ||
default = "acctest0001" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
default = "westeurope" | ||
} | ||
|
||
data "azapi_client_config" "current" {} | ||
|
||
resource "azapi_resource" "resourceGroup" { | ||
type = "Microsoft.Resources/resourceGroups@2020-06-01" | ||
name = var.resource_name | ||
location = var.location | ||
} | ||
|
||
resource "azapi_resource" "networkManager" { | ||
type = "Microsoft.Network/networkManagers@2022-09-01" | ||
parent_id = azapi_resource.resourceGroup.id | ||
name = var.resource_name | ||
location = var.location | ||
body = { | ||
properties = { | ||
description = "" | ||
networkManagerScopeAccesses = [ | ||
"SecurityAdmin", | ||
] | ||
networkManagerScopes = { | ||
managementGroups = [ | ||
] | ||
subscriptions = [ | ||
"/subscriptions/${data.azapi_client_config.current.subscription_id}", | ||
] | ||
} | ||
} | ||
} | ||
retry = { | ||
error_message_regex = ["CannotDeleteResource"] | ||
} | ||
} | ||
|
||
resource "azapi_resource" "ipamPool" { | ||
type = "Microsoft.Network/networkManagers/ipamPools@2024-01-01-preview" | ||
parent_id = azapi_resource.networkManager.id | ||
name = var.resource_name | ||
location = var.location | ||
body = { | ||
properties = { | ||
addressPrefixes = [ | ||
"10.0.0.0/24", | ||
] | ||
description = "Test description." | ||
parentPoolName = "" | ||
displayName = "testDisplayName" | ||
} | ||
} | ||
|
||
tags = { | ||
myTag = "testTag" | ||
} | ||
} | ||
|
||
resource "azapi_resource" "staticCidr" { | ||
type = "Microsoft.Network/networkManagers/ipamPools/staticCidrs@2024-01-01-preview" | ||
parent_id = azapi_resource.ipamPool.id | ||
name = var.resource_name | ||
body = { | ||
properties = { | ||
addressPrefixes = [ | ||
"10.0.0.0/25", | ||
] | ||
numberOfIPAddressesToAllocate = "" | ||
description = "test description" | ||
} | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
examples/Microsoft.Network_networkManagers_verifierWorkspace@2024-01-01-preview/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
terraform { | ||
required_providers { | ||
azapi = { | ||
source = "Azure/azapi" | ||
} | ||
} | ||
} | ||
|
||
provider "azapi" { | ||
skip_provider_registration = false | ||
} | ||
|
||
variable "resource_name" { | ||
type = string | ||
default = "acctest0001" | ||
} | ||
|
||
variable "location" { | ||
type = string | ||
default = "westeurope" | ||
} | ||
|
||
data "azapi_client_config" "current" {} | ||
|
||
resource "azapi_resource" "resourceGroup" { | ||
type = "Microsoft.Resources/resourceGroups@2020-06-01" | ||
name = var.resource_name | ||
location = var.location | ||
} | ||
|
||
resource "azapi_resource" "networkManager" { | ||
type = "Microsoft.Network/networkManagers@2022-09-01" | ||
parent_id = azapi_resource.resourceGroup.id | ||
name = var.resource_name | ||
location = var.location | ||
body = { | ||
properties = { | ||
description = "" | ||
networkManagerScopeAccesses = [ | ||
"SecurityAdmin", | ||
] | ||
networkManagerScopes = { | ||
managementGroups = [ | ||
] | ||
subscriptions = [ | ||
"/subscriptions/${data.azapi_client_config.current.subscription_id}", | ||
] | ||
} | ||
} | ||
} | ||
retry = { | ||
error_message_regex = ["CannotDeleteResource"] | ||
} | ||
} | ||
|
||
resource "azapi_resource" "verifierWorkspace" { | ||
type = "Microsoft.Network/networkManagers/verifierWorkspaces@2024-01-01-preview" | ||
parent_id = azapi_resource.networkManager.id | ||
name = var.resource_name | ||
location = var.location | ||
body = { | ||
properties = { | ||
description = "A sample workspace" | ||
} | ||
} | ||
|
||
tags = { | ||
myTag = "testTag" | ||
} | ||
} |
Oops, something went wrong.