Examples for documentation for AzAPI provider including resource and update_resource
This commit is contained in:
28
quickstart/101-azapi-eventhub-network-rules/main-generic.tf
Normal file
28
quickstart/101-azapi-eventhub-network-rules/main-generic.tf
Normal file
@ -0,0 +1,28 @@
|
||||
# AzAPI update resource is used to enable Network Rule sets on Event Hub namespace
|
||||
resource "azapi_update_resource" "qs101" {
|
||||
type = "Microsoft.EventHub/namespaces/networkRuleSets@2021-11-01"
|
||||
name = "default"
|
||||
parent_id = azurerm_eventhub_namespace.qs101.id
|
||||
|
||||
body = jsonencode({
|
||||
properties = {
|
||||
defaultAction = "Deny"
|
||||
publicNetworkAccess = "Enabled"
|
||||
virtualNetworkRules = [
|
||||
{
|
||||
ignoreMissingVnetServiceEndpoint = false
|
||||
subnet = {
|
||||
# API bug, returned id replaced `resourceGroups` with `resourcegroups`
|
||||
id = replace(azurerm_subnet.qs101.id, "resourceGroups", "resourcegroups")
|
||||
}
|
||||
}
|
||||
]
|
||||
ipRules = [
|
||||
{
|
||||
action = "Allow"
|
||||
ipMask = "1.1.1.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user