diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c5d0806..5ba0297f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## v0.14.0 +FEATURES: +- Support generating and testing with `azapi` dynamic property feature. + +BUG FIXES: +- Fix the bug that the default resource name is not randomly generated. + ## v0.13.0 FEATURES: - Support `credscan` command to scan the credentials in the testing configuration files. diff --git a/dependency/azapi.go b/dependency/azapi.go index 8a37f8fe..3ee20aae 100644 --- a/dependency/azapi.go +++ b/dependency/azapi.go @@ -3,6 +3,7 @@ package dependency import ( "embed" "fmt" + "os" "path" "strings" "sync" @@ -42,6 +43,9 @@ func LoadAzapiDependencies() ([]Dependency, error) { } for _, entry := range entries { filename := path.Join(dir, entry.Name(), "main.tf") + if _, err := StaticFiles.Open(filename); os.IsNotExist(err) { + filename = path.Join(dir, entry.Name(), "basic", "main.tf") + } data, err := StaticFiles.ReadFile(filename) if err != nil { return nil, err diff --git a/dependency/azapi_examples/Microsoft.AVS_privateClouds@2022-05-01/main.tf b/dependency/azapi_examples/Microsoft.AVS_privateClouds@2022-05-01/main.tf index 69b191bc..97e89334 100644 --- a/dependency/azapi_examples/Microsoft.AVS_privateClouds@2022-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.AVS_privateClouds@2022-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "privateCloud" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { internet = "Disabled" managementCluster = { @@ -42,7 +42,7 @@ resource "azapi_resource" "privateCloud" { sku = { name = "av36" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AVS_privateClouds_authorizations@2022-05-01/main.tf b/dependency/azapi_examples/Microsoft.AVS_privateClouds_authorizations@2022-05-01/main.tf index bc0268f7..755a3fea 100644 --- a/dependency/azapi_examples/Microsoft.AVS_privateClouds_authorizations@2022-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.AVS_privateClouds_authorizations@2022-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "privateCloud" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { internet = "Disabled" managementCluster = { @@ -42,7 +42,7 @@ resource "azapi_resource" "privateCloud" { sku = { name = "av36" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AlertsManagement_actionRules@2021-08-08/main.tf b/dependency/azapi_examples/Microsoft.AlertsManagement_actionRules@2021-08-08/main.tf index 375f86b2..f841e879 100644 --- a/dependency/azapi_examples/Microsoft.AlertsManagement_actionRules@2021-08-08/main.tf +++ b/dependency/azapi_examples/Microsoft.AlertsManagement_actionRules@2021-08-08/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "actionRule" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { actions = [ { @@ -45,7 +45,7 @@ resource "azapi_resource" "actionRule" { ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AlertsManagement_prometheusRuleGroups@2023-03-01/main.tf b/dependency/azapi_examples/Microsoft.AlertsManagement_prometheusRuleGroups@2023-03-01/main.tf index 8f3d7db0..de6ca463 100644 --- a/dependency/azapi_examples/Microsoft.AlertsManagement_prometheusRuleGroups@2023-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.AlertsManagement_prometheusRuleGroups@2023-03-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "account" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,7 +46,7 @@ resource "azapi_resource" "prometheusRuleGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { clusterName = "" description = "" @@ -66,7 +66,7 @@ resource "azapi_resource" "prometheusRuleGroup" { ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AnalysisServices_servers@2017-08-01/main.tf b/dependency/azapi_examples/Microsoft.AnalysisServices_servers@2017-08-01/main.tf index b52e687b..195896ae 100644 --- a/dependency/azapi_examples/Microsoft.AnalysisServices_servers@2017-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.AnalysisServices_servers@2017-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { asAdministrators = { members = [ @@ -46,7 +46,7 @@ resource "azapi_resource" "server" { sku = { name = "B1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service@2021-08-01/main.tf index fdb897c9..5e729ebb 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -67,7 +64,7 @@ resource "azapi_resource" "service" { capacity = 1 name = "Developer" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_apiVersionSets@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_apiVersionSets@2021-08-01/main.tf index 81a0f03f..0a4530fb 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_apiVersionSets@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_apiVersionSets@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,13 +61,13 @@ resource "azapi_resource" "apiVersionSet" { type = "Microsoft.ApiManagement/service/apiVersionSets@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "TestDescription1" displayName = "TestApiVersionSet1230630032559674766" versioningScheme = "Segment" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_apis@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_apis@2021-08-01/main.tf index f000276d..713b1832 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_apis@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_apis@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +61,7 @@ resource "azapi_resource" "api" { type = "Microsoft.ApiManagement/service/apis@2021-08-01" parent_id = azapi_resource.service.id name = "${var.resource_name};rev=1" - body = jsonencode({ + body = { properties = { apiRevisionDescription = "" apiType = "http" @@ -82,7 +79,7 @@ resource "azapi_resource" "api" { subscriptionRequired = true type = "http" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_diagnostics@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_diagnostics@2021-08-01/main.tf index 91eda2d0..fdc86aa9 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_diagnostics@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_diagnostics@2021-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -43,7 +43,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,10 +53,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -77,7 +74,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -86,7 +83,7 @@ resource "azapi_resource" "api" { type = "Microsoft.ApiManagement/service/apis@2021-08-01" parent_id = azapi_resource.service.id name = "${var.resource_name};rev=1" - body = jsonencode({ + body = { properties = { apiType = "http" apiVersion = "" @@ -95,7 +92,7 @@ resource "azapi_resource" "api" { type = "http" value = "http://conferenceapi.azurewebsites.net/?format=json" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -104,31 +101,33 @@ resource "azapi_resource" "logger" { type = "Microsoft.ApiManagement/service/loggers@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { credentials = { - instrumentationKey = jsondecode(azapi_resource.component.output).properties.InstrumentationKey + instrumentationKey = azapi_resource.component.output.properties.InstrumentationKey } description = "" isBuffered = true loggerType = "applicationInsights" } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.credentials.instrumentationKey"] + lifecycle { + ignore_changes = [body.properties.credentials.instrumentationKey] + } } resource "azapi_resource" "diagnostic" { type = "Microsoft.ApiManagement/service/apis/diagnostics@2021-08-01" parent_id = azapi_resource.api.id name = "applicationinsights" - body = jsonencode({ + body = { properties = { loggerId = azapi_resource.logger.id operationNameFormat = "Name" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_policies@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_policies@2021-08-01/main.tf index 8515be07..64b821eb 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_policies@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_policies@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +61,7 @@ resource "azapi_resource" "api" { type = "Microsoft.ApiManagement/service/apis@2021-08-01" parent_id = azapi_resource.service.id name = "${var.resource_name};rev=1" - body = jsonencode({ + body = { properties = { apiRevisionDescription = "" apiType = "http" @@ -82,7 +79,7 @@ resource "azapi_resource" "api" { subscriptionRequired = true type = "http" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -91,7 +88,7 @@ resource "azapi_resource" "policy" { type = "Microsoft.ApiManagement/service/apis/policies@2021-08-01" parent_id = azapi_resource.api.id name = "policy" - body = jsonencode({ + body = { properties = { format = "xml" value = <<-EOT @@ -103,9 +100,11 @@ resource "azapi_resource" "policy" { EOT } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.value"] + lifecycle { + ignore_changes = [body.properties.value] + } } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_releases@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_releases@2021-08-01/main.tf index ac06c0a6..7ff0355c 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_releases@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_releases@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +61,7 @@ resource "azapi_resource" "api" { type = "Microsoft.ApiManagement/service/apis@2021-08-01" parent_id = azapi_resource.service.id name = "${var.resource_name};rev=1" - body = jsonencode({ + body = { properties = { apiRevisionDescription = "" apiType = "http" @@ -82,7 +79,7 @@ resource "azapi_resource" "api" { subscriptionRequired = true type = "http" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -91,12 +88,12 @@ resource "azapi_resource" "release" { type = "Microsoft.ApiManagement/service/apis/releases@2021-08-01" parent_id = azapi_resource.api.id name = var.resource_name - body = jsonencode({ + body = { properties = { apiId = trimsuffix(azapi_resource.api.id, ";rev=1") notes = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_schemas@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_schemas@2021-08-01/main.tf index d1cc5f09..a9e6aeb9 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_schemas@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_apis_schemas@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +61,7 @@ resource "azapi_resource" "api" { type = "Microsoft.ApiManagement/service/apis@2021-08-01" parent_id = azapi_resource.service.id name = "${var.resource_name};rev=1" - body = jsonencode({ + body = { properties = { apiRevisionDescription = "" apiType = "http" @@ -82,7 +79,7 @@ resource "azapi_resource" "api" { subscriptionRequired = true type = "http" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -91,14 +88,14 @@ resource "azapi_resource" "schema" { type = "Microsoft.ApiManagement/service/apis/schemas@2021-08-01" parent_id = azapi_resource.api.id name = var.resource_name - body = jsonencode({ + body = { properties = { contentType = "application/vnd.ms-azure-apim.xsd+xml" document = { value = "\n\n " } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_authorizationServers@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_authorizationServers@2021-08-01/main.tf index ee511ea9..b2a8b7d8 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_authorizationServers@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_authorizationServers@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +61,7 @@ resource "azapi_resource" "authorizationServer" { type = "Microsoft.ApiManagement/service/authorizationServers@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { authorizationEndpoint = "https://azacceptance.hashicorptest.com/client/authorize" authorizationMethods = [ @@ -87,7 +84,7 @@ resource "azapi_resource" "authorizationServer" { tokenBodyParameters = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_backends@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_backends@2021-08-01/main.tf index 7c948c12..0df5899c 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_backends@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_backends@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,12 +61,12 @@ resource "azapi_resource" "backend" { type = "Microsoft.ApiManagement/service/backends@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { protocol = "http" url = "https://acctest" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_caches@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_caches@2021-08-01/main.tf index 3b3b8b2e..856b0997 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_caches@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_caches@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -65,7 +62,7 @@ resource "azapi_resource" "redis" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "eastus" - body = jsonencode({ + body = { properties = { sku = { capacity = 2 @@ -75,7 +72,7 @@ resource "azapi_resource" "redis" { enableNonSslPort = true minimumTlsVersion = "1.2" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -91,14 +88,16 @@ resource "azapi_resource" "cache" { type = "Microsoft.ApiManagement/service/caches@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { - connectionString = "${azapi_resource.redis.name}.redis.cache.windows.net:6380,password=${jsondecode(data.azapi_resource_action.listKeys.output).primaryKey},ssl=true,abortConnect=False" + connectionString = "${azapi_resource.redis.name}.redis.cache.windows.net:6380,password=${data.azapi_resource_action.listKeys.output.primaryKey},ssl=true,abortConnect=False" useFromLocation = "default" } - }) + } schema_validation_enabled = false - ignore_body_changes = ["properties.connectionString"] response_export_values = ["*"] + lifecycle { + ignore_changes = [body.properties.connectionString] + } } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_certificates@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_certificates@2021-08-01/main.tf index d0f7fb66..088d1e30 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_certificates@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_certificates@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,12 +61,12 @@ resource "azapi_resource" "certificate" { type = "Microsoft.ApiManagement/service/certificates@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { data = "MIIKmQIBAzCCCl8GCSqGSIb3DQEHAaCCClAEggpMMIIKSDCCBP8GCSqGSIb3DQEHBqCCBPAwggTsAgEAMIIE5QYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIp1c0ydxiVG0CAggAgIIEuA5qATScE+dBHsldt+cfd/PjV+FAei7+lyYXm2IN1TZ1mFEce3T6MlGaqXoHMlYlIEVtvxNp2qpbYyGbboCRYTmB1tHbDbwDAg0bO8J8ing2xOvkoKx+sFX7L0I+FcGz5ucJRoDus6K6GdMgWOi+vlEdliBpH7Lgk+8+SXpFf/JadnEY49Dr4XMUBs/fXe6BxB89b9H/5mUg1SQFuxnGQrdvEW7tNFJR7k9BUO/95X8b4mQZdqfXBzgayOKTcB7JShXA9gjyAbxsF2g5EXlmWNJoRVo8xPcybPgarDdfjM4L0eEzvB4mgn6JimCaHxt9Gb3PGhPJ0mFzVbJTPQgiFpjpREwDWVYk7LeKvjyLn70O9pQyCi8tjZGw5XfIHlt7P+EHEdXXYR7z7gbgNQmWFMjYEX2puAKjYyjYsZ3ZxlWWNsrWZA/lNE5BgIBAcNAT2NBGAGbe4floniM8RPpQJ/Tj53nFQxav2sY/toWRSA8z7/bMGmQZEh9Dun61YJc+yb0dzn0K98FlEw1+Uu4fR8l6/e4xvmpdH3tOVak0xFRJLdILlO9VwJ3Ins8CODFHV4J4DnuMyINonctjTl9qy66+pVf6ePX0Io5k+49hU3u19jZy/oN8xxTGDMGVQinZ19yNC5TJ7RJ4fb682Jk+P8dwc+1icbBydZo3a/n1JdglMjPJK4+f0iW/+KIBFD2oZlEt8/Hi+IzyXT2BJHuZJmPa61vxHurA/urGH06ybpcrSEkBC0Lcm07Ie5Ov/UQVcdwF2MM3f3Iv5hrdRogBmB5pe1sYwNGJanCy4dABwpu+qVrtBGZEdBRl4h6IUTTzFDJltVcAmi60blvB8pCufDnD+PdJobAD5FIcsMDl0hiB7AgDbtOWygE1i/b5GnoVsfOGt4iUclikKxCig4m500IgX/XgUBiY1RwkHIXZQ1mXyWBAnaFgPA7BOt70Qbj9wy9S60FvrElVG9NWXuTdGY+ECWkoEzjiGnCEL+T1Cv43b8SlL5GCCftIUHlM/ss8oBzcJmUJsUsv/ZHTcj3GKyHud5cIT4rli542dDkoZj0O6fsvE+yFM7kZaQrTzuPlstfnvi5OeJQ4+aJBeL+rEXvEspLn02i2Rg1afZAll6fk+epPJOxW2pkrVslDMj/0RfLr4dRi5uzBiJb3pILfCDJs9Nqzj2GMWOFudQn5OHbcbx6dtoB1RcdsZHSGTn+MrjoXey2nmIlg372aLR7tCH06Z66U9FagAr51DZAKq2ry0T6gR4sWtzHlS063xFH4JeCHAJouWqEwgxeBu1zSZneDlMaC1ifcB0fOML8658vi1B697wLP0Muc6UW4mqfuN7AMl1fJQ7vO5oTDgWbPd6bSrLk46zmN3vC3VzMqQVa/1BbKgGkTOaVIZJuK0OuN2hyaVLNvm8XQ2O5QWE6aY2l3fm7m4hbT2AXRd/ulquZRhbQa7jIyjTb6SwLZG9wpvRJ5pR/C1V/QitI4GrViMOgEX+LV2TzXZxmkBV45/dDJ9Vh+2LEUKvcbkWjxZEbgltyCOdDHbTA5ydcNCHi/t/L371N6mCcXJH4FC7za1LpNmXeRIZa4lUuW602YH0DCYTnZ95UqMNyXMIIFQQYJKoZIhvcNAQcBoIIFMgSCBS4wggUqMIIFJgYLKoZIhvcNAQwKAQKgggTuMIIE6jAcBgoqhkiG9w0BDAEDMA4ECMwUHG/3/JVkAgIIAASCBMivDxcmzXtuXLPeu468SGYRJk994sSYqjK6fKP4090KXsDgX+IkggKJWqZqyRb0Dq7EusKpMyrSJNtz9Cfl3+S/vsbX6mGz4TY1g4VNvkyJyUjqUjKIDL2SlULRa7ldEvpOciy0Ms/6PBQXOTyVr5Rd1dFUFSbkLAruIWTULK0OfQoFjuQXmDvunRBrqSbHtjID9m1OwdcTfzMGHjsXth3iSWSTTh5+Eg/6H+/9kGC9VEEURqFD3Gx2kWKjqSlZyf/LSOTBcQ6+qRQZT1B1ZnPAVBU9Xn9Z6Tq0EMNfNg9+pv1GlLBUg1Hqo8RAW1nNOBSBHXS0nq062j48luQOotthKOc1rkjQd91Q9qTLFlU12gllQw+ejHVVvEEPHtxJ7HVr/lvM/5mt2oObTJb01JcfVnYrnI3NnNSWRULx/tznhB2yoKqjtrnZAW3zNU9TQQVyLVjt2lIXhE4oXk0I+Cxmvbh+YJF6XLrATGc6yuL02ZInrC59ufkclcnjnTSGnXWr9gzIndZ6wSS0B+6bMpLxamvE4XDhAQCn6MEGGVcY9nMydxaWU3o7Is0J1nd/KZWgfXeOoZx10olSR22+PBKy8Gsge2mMbR2QvhUKNyXLTV3pOnxtjGf88PhseqDpwZ5++DOSFfi0spsDvfXJNO0F0f0JYrMNXbqlxO4uExj146thivXZVlR1n5Bo4eL0OoVIXn1w/MuU0suQvZm+kD8uVuajyBnJsnhsCWx2eTZ2vzHQTKB2EtYeDPioWSomTVVjIdg8A9pTzvvhe8MzFXvRMXFc9+ToN+uLjJqHRSmpZIGJvZQXCKrlCC9KRjP1HIhJhyfuYoEjTkF3IVeXS1tnA5CH5oilOG+guLKXNPWsrCXEpewz6i907ugx/VWTAmEMzYwMCDzCnW2l+mI8P56nWrwI0vDuk1GhIs6nn+Nhc6FPHD1996zyZ7hfmO7h25tto00IoVgI9QlhwtWLz10ZltLG581JvO7jEwT4u/nYxD7aO0Llb3ytNKihalFZMaY20a1dhVBsPwiWUpZcMmPoYySSiukyw350WiV/Z2NAsyeGRTWpdKcBi7gna0NN6fn0QLSdTcPKutASCplNExnI1IkkBFb3TmlF5HrrwmVht+vqxEHbRjDwEnKkvGcUbLWdjUjSWVNNbCbo8KbLAXcBPcjTHxIRw3gkLcS+yL0//uSENgo/LpHBZsO5d6as820lpYmHIjvyxhAMpMNlOPmUIW+cOgcf328wNaHaVWalIwfSGJdqGgC4msvP8vOcGWYgLkdrqJGWjhDs40x7LuFEBWgpgu6E2FfPOPTsqs5QxNKTgCw/eXjK92dZkdqO0Y7oLavU3OaJeWFJpAuZcC84Rwup2K0d4CXvZ0bOtpISSTr3VZeXRl8SkN2bQtgit9BJ2qGAy9blNObk1q8yOaVppercZMgG96DK23ZQ9uLRmliqytE1tXFKNKegwxGorKodoMwpRzClBz37KIYGJvFOYVya11v3gdcfeMcRTPdZG5dbI6US9DNk6fbShBJpc7PvYgMc8Vr+xEfzZXPnY2M8d+uJJomrU5ZQXcjy9jtyE4ToBz5ajh4Hq6Khlv6v5y2C+GrXb5+2KoSkcAYpTxlzAnjk9pYMZkwxJTAjBgkqhkiG9w0BCRUxFgQURdOwIJIHIprOPt5IqfZOf/7JJoQwMTAhMAkGBSsOAwIaBQAEFCaYzKHAOxuYPxNGezkbQ8Tp9cGsBAiTp8/jb7QK5AICCAAK" password = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_diagnostics@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_diagnostics@2021-08-01/main.tf index c571aa42..2b4a60fc 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_diagnostics@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_diagnostics@2021-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -43,7 +43,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,10 +53,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -77,7 +74,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -86,31 +83,33 @@ resource "azapi_resource" "logger" { type = "Microsoft.ApiManagement/service/loggers@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { credentials = { - instrumentationKey = jsondecode(azapi_resource.component.output).properties.InstrumentationKey + instrumentationKey = azapi_resource.component.output.properties.InstrumentationKey } description = "" isBuffered = true loggerType = "applicationInsights" } - }) + } schema_validation_enabled = false - ignore_body_changes = ["properties.credentials.instrumentationKey"] response_export_values = ["*"] + lifecycle { + ignore_changes = [body.properties.credentials.instrumentationKey] + } } resource "azapi_resource" "diagnostic" { type = "Microsoft.ApiManagement/service/diagnostics@2021-08-01" parent_id = azapi_resource.service.id name = "applicationinsights" - body = jsonencode({ + body = { properties = { loggerId = azapi_resource.logger.id operationNameFormat = "Name" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways@2021-08-01/main.tf index 780a5c2b..69839ece 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -67,7 +64,7 @@ resource "azapi_resource" "service" { capacity = 1 name = "Developer" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -81,7 +78,7 @@ resource "azapi_resource" "gateway" { type = "Microsoft.ApiManagement/service/gateways@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" locationData = { @@ -91,7 +88,7 @@ resource "azapi_resource" "gateway" { name = "test" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways_certificateAuthorities@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways_certificateAuthorities@2021-08-01/main.tf index 24d8e35a..e88a8d18 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways_certificateAuthorities@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways_certificateAuthorities@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -67,7 +64,7 @@ resource "azapi_resource" "service" { capacity = 1 name = "Developer" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -81,7 +78,7 @@ resource "azapi_resource" "gateway" { type = "Microsoft.ApiManagement/service/gateways@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" locationData = { @@ -91,7 +88,7 @@ resource "azapi_resource" "gateway" { name = "test" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,12 +97,12 @@ resource "azapi_resource" "certificate" { type = "Microsoft.ApiManagement/service/certificates@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { data = "MIIKmQIBAzCCCl8GCSqGSIb3DQEHAaCCClAEggpMMIIKSDCCBP8GCSqGSIb3DQEHBqCCBPAwggTsAgEAMIIE5QYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIp1c0ydxiVG0CAggAgIIEuA5qATScE+dBHsldt+cfd/PjV+FAei7+lyYXm2IN1TZ1mFEce3T6MlGaqXoHMlYlIEVtvxNp2qpbYyGbboCRYTmB1tHbDbwDAg0bO8J8ing2xOvkoKx+sFX7L0I+FcGz5ucJRoDus6K6GdMgWOi+vlEdliBpH7Lgk+8+SXpFf/JadnEY49Dr4XMUBs/fXe6BxB89b9H/5mUg1SQFuxnGQrdvEW7tNFJR7k9BUO/95X8b4mQZdqfXBzgayOKTcB7JShXA9gjyAbxsF2g5EXlmWNJoRVo8xPcybPgarDdfjM4L0eEzvB4mgn6JimCaHxt9Gb3PGhPJ0mFzVbJTPQgiFpjpREwDWVYk7LeKvjyLn70O9pQyCi8tjZGw5XfIHlt7P+EHEdXXYR7z7gbgNQmWFMjYEX2puAKjYyjYsZ3ZxlWWNsrWZA/lNE5BgIBAcNAT2NBGAGbe4floniM8RPpQJ/Tj53nFQxav2sY/toWRSA8z7/bMGmQZEh9Dun61YJc+yb0dzn0K98FlEw1+Uu4fR8l6/e4xvmpdH3tOVak0xFRJLdILlO9VwJ3Ins8CODFHV4J4DnuMyINonctjTl9qy66+pVf6ePX0Io5k+49hU3u19jZy/oN8xxTGDMGVQinZ19yNC5TJ7RJ4fb682Jk+P8dwc+1icbBydZo3a/n1JdglMjPJK4+f0iW/+KIBFD2oZlEt8/Hi+IzyXT2BJHuZJmPa61vxHurA/urGH06ybpcrSEkBC0Lcm07Ie5Ov/UQVcdwF2MM3f3Iv5hrdRogBmB5pe1sYwNGJanCy4dABwpu+qVrtBGZEdBRl4h6IUTTzFDJltVcAmi60blvB8pCufDnD+PdJobAD5FIcsMDl0hiB7AgDbtOWygE1i/b5GnoVsfOGt4iUclikKxCig4m500IgX/XgUBiY1RwkHIXZQ1mXyWBAnaFgPA7BOt70Qbj9wy9S60FvrElVG9NWXuTdGY+ECWkoEzjiGnCEL+T1Cv43b8SlL5GCCftIUHlM/ss8oBzcJmUJsUsv/ZHTcj3GKyHud5cIT4rli542dDkoZj0O6fsvE+yFM7kZaQrTzuPlstfnvi5OeJQ4+aJBeL+rEXvEspLn02i2Rg1afZAll6fk+epPJOxW2pkrVslDMj/0RfLr4dRi5uzBiJb3pILfCDJs9Nqzj2GMWOFudQn5OHbcbx6dtoB1RcdsZHSGTn+MrjoXey2nmIlg372aLR7tCH06Z66U9FagAr51DZAKq2ry0T6gR4sWtzHlS063xFH4JeCHAJouWqEwgxeBu1zSZneDlMaC1ifcB0fOML8658vi1B697wLP0Muc6UW4mqfuN7AMl1fJQ7vO5oTDgWbPd6bSrLk46zmN3vC3VzMqQVa/1BbKgGkTOaVIZJuK0OuN2hyaVLNvm8XQ2O5QWE6aY2l3fm7m4hbT2AXRd/ulquZRhbQa7jIyjTb6SwLZG9wpvRJ5pR/C1V/QitI4GrViMOgEX+LV2TzXZxmkBV45/dDJ9Vh+2LEUKvcbkWjxZEbgltyCOdDHbTA5ydcNCHi/t/L371N6mCcXJH4FC7za1LpNmXeRIZa4lUuW602YH0DCYTnZ95UqMNyXMIIFQQYJKoZIhvcNAQcBoIIFMgSCBS4wggUqMIIFJgYLKoZIhvcNAQwKAQKgggTuMIIE6jAcBgoqhkiG9w0BDAEDMA4ECMwUHG/3/JVkAgIIAASCBMivDxcmzXtuXLPeu468SGYRJk994sSYqjK6fKP4090KXsDgX+IkggKJWqZqyRb0Dq7EusKpMyrSJNtz9Cfl3+S/vsbX6mGz4TY1g4VNvkyJyUjqUjKIDL2SlULRa7ldEvpOciy0Ms/6PBQXOTyVr5Rd1dFUFSbkLAruIWTULK0OfQoFjuQXmDvunRBrqSbHtjID9m1OwdcTfzMGHjsXth3iSWSTTh5+Eg/6H+/9kGC9VEEURqFD3Gx2kWKjqSlZyf/LSOTBcQ6+qRQZT1B1ZnPAVBU9Xn9Z6Tq0EMNfNg9+pv1GlLBUg1Hqo8RAW1nNOBSBHXS0nq062j48luQOotthKOc1rkjQd91Q9qTLFlU12gllQw+ejHVVvEEPHtxJ7HVr/lvM/5mt2oObTJb01JcfVnYrnI3NnNSWRULx/tznhB2yoKqjtrnZAW3zNU9TQQVyLVjt2lIXhE4oXk0I+Cxmvbh+YJF6XLrATGc6yuL02ZInrC59ufkclcnjnTSGnXWr9gzIndZ6wSS0B+6bMpLxamvE4XDhAQCn6MEGGVcY9nMydxaWU3o7Is0J1nd/KZWgfXeOoZx10olSR22+PBKy8Gsge2mMbR2QvhUKNyXLTV3pOnxtjGf88PhseqDpwZ5++DOSFfi0spsDvfXJNO0F0f0JYrMNXbqlxO4uExj146thivXZVlR1n5Bo4eL0OoVIXn1w/MuU0suQvZm+kD8uVuajyBnJsnhsCWx2eTZ2vzHQTKB2EtYeDPioWSomTVVjIdg8A9pTzvvhe8MzFXvRMXFc9+ToN+uLjJqHRSmpZIGJvZQXCKrlCC9KRjP1HIhJhyfuYoEjTkF3IVeXS1tnA5CH5oilOG+guLKXNPWsrCXEpewz6i907ugx/VWTAmEMzYwMCDzCnW2l+mI8P56nWrwI0vDuk1GhIs6nn+Nhc6FPHD1996zyZ7hfmO7h25tto00IoVgI9QlhwtWLz10ZltLG581JvO7jEwT4u/nYxD7aO0Llb3ytNKihalFZMaY20a1dhVBsPwiWUpZcMmPoYySSiukyw350WiV/Z2NAsyeGRTWpdKcBi7gna0NN6fn0QLSdTcPKutASCplNExnI1IkkBFb3TmlF5HrrwmVht+vqxEHbRjDwEnKkvGcUbLWdjUjSWVNNbCbo8KbLAXcBPcjTHxIRw3gkLcS+yL0//uSENgo/LpHBZsO5d6as820lpYmHIjvyxhAMpMNlOPmUIW+cOgcf328wNaHaVWalIwfSGJdqGgC4msvP8vOcGWYgLkdrqJGWjhDs40x7LuFEBWgpgu6E2FfPOPTsqs5QxNKTgCw/eXjK92dZkdqO0Y7oLavU3OaJeWFJpAuZcC84Rwup2K0d4CXvZ0bOtpISSTr3VZeXRl8SkN2bQtgit9BJ2qGAy9blNObk1q8yOaVppercZMgG96DK23ZQ9uLRmliqytE1tXFKNKegwxGorKodoMwpRzClBz37KIYGJvFOYVya11v3gdcfeMcRTPdZG5dbI6US9DNk6fbShBJpc7PvYgMc8Vr+xEfzZXPnY2M8d+uJJomrU5ZQXcjy9jtyE4ToBz5ajh4Hq6Khlv6v5y2C+GrXb5+2KoSkcAYpTxlzAnjk9pYMZkwxJTAjBgkqhkiG9w0BCRUxFgQURdOwIJIHIprOPt5IqfZOf/7JJoQwMTAhMAkGBSsOAwIaBQAEFCaYzKHAOxuYPxNGezkbQ8Tp9cGsBAiTp8/jb7QK5AICCAAK" password = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -114,11 +111,11 @@ resource "azapi_resource" "certificateAuthority" { type = "Microsoft.ApiManagement/service/gateways/certificateAuthorities@2021-08-01" parent_id = azapi_resource.gateway.id name = azapi_resource.certificate.name - body = jsonencode({ + body = { properties = { isTrusted = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways_hostnameConfigurations@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways_hostnameConfigurations@2021-08-01/main.tf index ce7ea489..c827619d 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways_hostnameConfigurations@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_gateways_hostnameConfigurations@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -67,7 +64,7 @@ resource "azapi_resource" "service" { capacity = 1 name = "Developer" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -81,7 +78,7 @@ resource "azapi_resource" "gateway" { type = "Microsoft.ApiManagement/service/gateways@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" locationData = { @@ -91,7 +88,7 @@ resource "azapi_resource" "gateway" { name = "test" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,12 +97,12 @@ resource "azapi_resource" "certificate" { type = "Microsoft.ApiManagement/service/certificates@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { data = "MIIKmQIBAzCCCl8GCSqGSIb3DQEHAaCCClAEggpMMIIKSDCCBP8GCSqGSIb3DQEHBqCCBPAwggTsAgEAMIIE5QYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIp1c0ydxiVG0CAggAgIIEuA5qATScE+dBHsldt+cfd/PjV+FAei7+lyYXm2IN1TZ1mFEce3T6MlGaqXoHMlYlIEVtvxNp2qpbYyGbboCRYTmB1tHbDbwDAg0bO8J8ing2xOvkoKx+sFX7L0I+FcGz5ucJRoDus6K6GdMgWOi+vlEdliBpH7Lgk+8+SXpFf/JadnEY49Dr4XMUBs/fXe6BxB89b9H/5mUg1SQFuxnGQrdvEW7tNFJR7k9BUO/95X8b4mQZdqfXBzgayOKTcB7JShXA9gjyAbxsF2g5EXlmWNJoRVo8xPcybPgarDdfjM4L0eEzvB4mgn6JimCaHxt9Gb3PGhPJ0mFzVbJTPQgiFpjpREwDWVYk7LeKvjyLn70O9pQyCi8tjZGw5XfIHlt7P+EHEdXXYR7z7gbgNQmWFMjYEX2puAKjYyjYsZ3ZxlWWNsrWZA/lNE5BgIBAcNAT2NBGAGbe4floniM8RPpQJ/Tj53nFQxav2sY/toWRSA8z7/bMGmQZEh9Dun61YJc+yb0dzn0K98FlEw1+Uu4fR8l6/e4xvmpdH3tOVak0xFRJLdILlO9VwJ3Ins8CODFHV4J4DnuMyINonctjTl9qy66+pVf6ePX0Io5k+49hU3u19jZy/oN8xxTGDMGVQinZ19yNC5TJ7RJ4fb682Jk+P8dwc+1icbBydZo3a/n1JdglMjPJK4+f0iW/+KIBFD2oZlEt8/Hi+IzyXT2BJHuZJmPa61vxHurA/urGH06ybpcrSEkBC0Lcm07Ie5Ov/UQVcdwF2MM3f3Iv5hrdRogBmB5pe1sYwNGJanCy4dABwpu+qVrtBGZEdBRl4h6IUTTzFDJltVcAmi60blvB8pCufDnD+PdJobAD5FIcsMDl0hiB7AgDbtOWygE1i/b5GnoVsfOGt4iUclikKxCig4m500IgX/XgUBiY1RwkHIXZQ1mXyWBAnaFgPA7BOt70Qbj9wy9S60FvrElVG9NWXuTdGY+ECWkoEzjiGnCEL+T1Cv43b8SlL5GCCftIUHlM/ss8oBzcJmUJsUsv/ZHTcj3GKyHud5cIT4rli542dDkoZj0O6fsvE+yFM7kZaQrTzuPlstfnvi5OeJQ4+aJBeL+rEXvEspLn02i2Rg1afZAll6fk+epPJOxW2pkrVslDMj/0RfLr4dRi5uzBiJb3pILfCDJs9Nqzj2GMWOFudQn5OHbcbx6dtoB1RcdsZHSGTn+MrjoXey2nmIlg372aLR7tCH06Z66U9FagAr51DZAKq2ry0T6gR4sWtzHlS063xFH4JeCHAJouWqEwgxeBu1zSZneDlMaC1ifcB0fOML8658vi1B697wLP0Muc6UW4mqfuN7AMl1fJQ7vO5oTDgWbPd6bSrLk46zmN3vC3VzMqQVa/1BbKgGkTOaVIZJuK0OuN2hyaVLNvm8XQ2O5QWE6aY2l3fm7m4hbT2AXRd/ulquZRhbQa7jIyjTb6SwLZG9wpvRJ5pR/C1V/QitI4GrViMOgEX+LV2TzXZxmkBV45/dDJ9Vh+2LEUKvcbkWjxZEbgltyCOdDHbTA5ydcNCHi/t/L371N6mCcXJH4FC7za1LpNmXeRIZa4lUuW602YH0DCYTnZ95UqMNyXMIIFQQYJKoZIhvcNAQcBoIIFMgSCBS4wggUqMIIFJgYLKoZIhvcNAQwKAQKgggTuMIIE6jAcBgoqhkiG9w0BDAEDMA4ECMwUHG/3/JVkAgIIAASCBMivDxcmzXtuXLPeu468SGYRJk994sSYqjK6fKP4090KXsDgX+IkggKJWqZqyRb0Dq7EusKpMyrSJNtz9Cfl3+S/vsbX6mGz4TY1g4VNvkyJyUjqUjKIDL2SlULRa7ldEvpOciy0Ms/6PBQXOTyVr5Rd1dFUFSbkLAruIWTULK0OfQoFjuQXmDvunRBrqSbHtjID9m1OwdcTfzMGHjsXth3iSWSTTh5+Eg/6H+/9kGC9VEEURqFD3Gx2kWKjqSlZyf/LSOTBcQ6+qRQZT1B1ZnPAVBU9Xn9Z6Tq0EMNfNg9+pv1GlLBUg1Hqo8RAW1nNOBSBHXS0nq062j48luQOotthKOc1rkjQd91Q9qTLFlU12gllQw+ejHVVvEEPHtxJ7HVr/lvM/5mt2oObTJb01JcfVnYrnI3NnNSWRULx/tznhB2yoKqjtrnZAW3zNU9TQQVyLVjt2lIXhE4oXk0I+Cxmvbh+YJF6XLrATGc6yuL02ZInrC59ufkclcnjnTSGnXWr9gzIndZ6wSS0B+6bMpLxamvE4XDhAQCn6MEGGVcY9nMydxaWU3o7Is0J1nd/KZWgfXeOoZx10olSR22+PBKy8Gsge2mMbR2QvhUKNyXLTV3pOnxtjGf88PhseqDpwZ5++DOSFfi0spsDvfXJNO0F0f0JYrMNXbqlxO4uExj146thivXZVlR1n5Bo4eL0OoVIXn1w/MuU0suQvZm+kD8uVuajyBnJsnhsCWx2eTZ2vzHQTKB2EtYeDPioWSomTVVjIdg8A9pTzvvhe8MzFXvRMXFc9+ToN+uLjJqHRSmpZIGJvZQXCKrlCC9KRjP1HIhJhyfuYoEjTkF3IVeXS1tnA5CH5oilOG+guLKXNPWsrCXEpewz6i907ugx/VWTAmEMzYwMCDzCnW2l+mI8P56nWrwI0vDuk1GhIs6nn+Nhc6FPHD1996zyZ7hfmO7h25tto00IoVgI9QlhwtWLz10ZltLG581JvO7jEwT4u/nYxD7aO0Llb3ytNKihalFZMaY20a1dhVBsPwiWUpZcMmPoYySSiukyw350WiV/Z2NAsyeGRTWpdKcBi7gna0NN6fn0QLSdTcPKutASCplNExnI1IkkBFb3TmlF5HrrwmVht+vqxEHbRjDwEnKkvGcUbLWdjUjSWVNNbCbo8KbLAXcBPcjTHxIRw3gkLcS+yL0//uSENgo/LpHBZsO5d6as820lpYmHIjvyxhAMpMNlOPmUIW+cOgcf328wNaHaVWalIwfSGJdqGgC4msvP8vOcGWYgLkdrqJGWjhDs40x7LuFEBWgpgu6E2FfPOPTsqs5QxNKTgCw/eXjK92dZkdqO0Y7oLavU3OaJeWFJpAuZcC84Rwup2K0d4CXvZ0bOtpISSTr3VZeXRl8SkN2bQtgit9BJ2qGAy9blNObk1q8yOaVppercZMgG96DK23ZQ9uLRmliqytE1tXFKNKegwxGorKodoMwpRzClBz37KIYGJvFOYVya11v3gdcfeMcRTPdZG5dbI6US9DNk6fbShBJpc7PvYgMc8Vr+xEfzZXPnY2M8d+uJJomrU5ZQXcjy9jtyE4ToBz5ajh4Hq6Khlv6v5y2C+GrXb5+2KoSkcAYpTxlzAnjk9pYMZkwxJTAjBgkqhkiG9w0BCRUxFgQURdOwIJIHIprOPt5IqfZOf/7JJoQwMTAhMAkGBSsOAwIaBQAEFCaYzKHAOxuYPxNGezkbQ8Tp9cGsBAiTp8/jb7QK5AICCAAK" password = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -114,7 +111,7 @@ resource "azapi_resource" "hostnameConfiguration" { type = "Microsoft.ApiManagement/service/gateways/hostnameConfigurations@2021-08-01" parent_id = azapi_resource.gateway.id name = var.resource_name - body = jsonencode({ + body = { properties = { certificateId = azapi_resource.certificate.id hostname = "host-name-230630032559671742" @@ -123,7 +120,7 @@ resource "azapi_resource" "hostnameConfiguration" { tls10Enabled = false tls11Enabled = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_groups@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_groups@2021-08-01/main.tf index 7b8b4126..b2d661d4 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_groups@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_groups@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -67,7 +64,7 @@ resource "azapi_resource" "service" { capacity = 1 name = "Developer" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -81,14 +78,14 @@ resource "azapi_resource" "group" { type = "Microsoft.ApiManagement/service/groups@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" displayName = "Test Group" externalId = "" type = "custom" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_identityProviders@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_identityProviders@2021-08-01/main.tf index 97fd0913..8ac84f3c 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_identityProviders@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_identityProviders@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -67,7 +64,7 @@ resource "azapi_resource" "service" { capacity = 1 name = "Developer" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -81,13 +78,13 @@ resource "azapi_resource" "identityProvider" { type = "Microsoft.ApiManagement/service/identityProviders@2021-08-01" parent_id = azapi_resource.service.id name = "twitter" - body = jsonencode({ + body = { properties = { clientId = "00000000000000000000000000000000" clientSecret = "00000000000000000000000000000000" type = "twitter" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_loggers@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_loggers@2021-08-01/main.tf index 931c222c..01ec0f59 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_loggers@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_loggers@2021-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -43,7 +43,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,10 +53,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -77,7 +74,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -86,18 +83,20 @@ resource "azapi_resource" "logger" { type = "Microsoft.ApiManagement/service/loggers@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { credentials = { - instrumentationKey = jsondecode(azapi_resource.component.output).properties.InstrumentationKey + instrumentationKey = azapi_resource.component.output.properties.InstrumentationKey } description = "" isBuffered = true loggerType = "applicationInsights" } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.credentials.instrumentationKey"] + lifecycle { + ignore_changes = [body.properties.credentials.instrumentationKey] + } } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_namedValues@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_namedValues@2021-08-01/main.tf index abbaa61c..97edbddd 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_namedValues@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_namedValues@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +61,7 @@ resource "azapi_resource" "namedValue" { type = "Microsoft.ApiManagement/service/namedValues@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { displayName = "TestProperty230630032559683679" secret = false @@ -74,7 +71,7 @@ resource "azapi_resource" "namedValue" { ] value = "Test Value" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_openidConnectProviders@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_openidConnectProviders@2021-08-01/main.tf index cd1f40a3..9900d5cd 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_openidConnectProviders@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_openidConnectProviders@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +61,7 @@ resource "azapi_resource" "openidConnectProvider" { type = "Microsoft.ApiManagement/service/openidConnectProviders@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { clientId = "00001111-2222-3333-230630032559684401" clientSecret = "230630032559684401-cwdavsxbacsaxZX-230630032559684401" @@ -72,7 +69,7 @@ resource "azapi_resource" "openidConnectProvider" { displayName = "Initial Name" metadataEndpoint = "https://azacceptance.hashicorptest.com/example/foo" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_portalsettings@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_portalsettings@2021-08-01/main.tf index 6afd1b45..3c42ec60 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_portalsettings@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_portalsettings@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -67,7 +64,7 @@ resource "azapi_resource" "service" { capacity = 1 name = "Developer" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -81,7 +78,7 @@ resource "azapi_update_resource" "portalsetting" { type = "Microsoft.ApiManagement/service/portalsettings@2021-08-01" parent_id = azapi_resource.service.id name = "signup" - body = jsonencode({ + body = { properties = { enabled = false termsOfService = { @@ -90,7 +87,7 @@ resource "azapi_update_resource" "portalsetting" { text = "" } } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_products@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_products@2021-08-01/main.tf index 512c0388..78b3b887 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_products@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_products@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +61,7 @@ resource "azapi_resource" "product" { type = "Microsoft.ApiManagement/service/products@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" displayName = "Test Product" @@ -72,7 +69,7 @@ resource "azapi_resource" "product" { subscriptionRequired = false terms = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_products_policies@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_products_policies@2021-08-01/main.tf index 2daaeb2c..554c6681 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_products_policies@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_products_policies@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +61,7 @@ resource "azapi_resource" "product" { type = "Microsoft.ApiManagement/service/products@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" displayName = "Test Product" @@ -72,7 +69,7 @@ resource "azapi_resource" "product" { subscriptionRequired = false terms = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -81,12 +78,12 @@ resource "azapi_resource" "policy2" { type = "Microsoft.ApiManagement/service/products/policies@2021-08-01" parent_id = azapi_resource.product.id name = "policy" - body = jsonencode({ + body = { properties = { format = "rawxml-link" value = "https://gist.githubusercontent.com/riordanp/ca22f8113afae0eb38cc12d718fd048d/raw/d6ac89a2f35a6881a7729f8cb4883179dc88eea1/example.xml" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_products_tags@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_products_tags@2021-08-01/main.tf index a7244cd0..1a3d5782 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_products_tags@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_products_tags@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +61,7 @@ resource "azapi_resource" "product" { type = "Microsoft.ApiManagement/service/products@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" displayName = "Test Product" @@ -72,7 +69,7 @@ resource "azapi_resource" "product" { subscriptionRequired = false terms = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -81,11 +78,11 @@ resource "azapi_resource" "service_tag" { type = "Microsoft.ApiManagement/service/tags@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { displayName = var.resource_name } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_schemas@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_schemas@2021-08-01/main.tf index e5d87e4b..cfa79ffe 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_schemas@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_schemas@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,13 +61,13 @@ resource "azapi_resource" "schema" { type = "Microsoft.ApiManagement/service/schemas@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" schemaType = "xml" value = " \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_subscriptions@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_subscriptions@2021-08-01/main.tf index eb09e360..f816a0fb 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_subscriptions@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_subscriptions@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -67,7 +64,7 @@ resource "azapi_resource" "service" { capacity = 1 name = "Developer" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -81,7 +78,7 @@ resource "azapi_resource" "product" { type = "Microsoft.ApiManagement/service/products@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" displayName = "Test Product" @@ -89,7 +86,7 @@ resource "azapi_resource" "product" { subscriptionRequired = true terms = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,13 +95,13 @@ resource "azapi_resource" "user" { type = "Microsoft.ApiManagement/service/users@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { email = "azure-acctest230630032559695401@example.com" firstName = "Acceptance" lastName = "Test" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -113,7 +110,7 @@ resource "azapi_resource" "subscription" { type = "Microsoft.ApiManagement/service/subscriptions@2021-08-01" parent_id = azapi_resource.service.id name = "0f393927-8f2d-499d-906f-c03943328d31" - body = jsonencode({ + body = { properties = { allowTracing = true displayName = "Butter Parser API Enterprise Edition" @@ -121,7 +118,7 @@ resource "azapi_resource" "subscription" { scope = azapi_resource.product.id state = "submitted" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_tags@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_tags@2021-08-01/main.tf index 7a246a25..a93ed857 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_tags@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_tags@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -55,7 +52,7 @@ resource "azapi_resource" "service" { capacity = 0 name = "Consumption" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,11 +61,11 @@ resource "azapi_resource" "tag" { type = "Microsoft.ApiManagement/service/tags@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { displayName = var.resource_name } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ApiManagement_service_users@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.ApiManagement_service_users@2021-08-01/main.tf index ee91c317..8a4d7b72 100644 --- a/dependency/azapi_examples/Microsoft.ApiManagement_service_users@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ApiManagement_service_users@2021-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { certificates = [ ] @@ -67,7 +64,7 @@ resource "azapi_resource" "service" { capacity = 1 name = "Developer" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -81,13 +78,13 @@ resource "azapi_resource" "user" { type = "Microsoft.ApiManagement/service/users@2021-08-01" parent_id = azapi_resource.service.id name = var.resource_name - body = jsonencode({ + body = { properties = { email = "azure-acctest230630032559695401@example.com" firstName = "Acceptance" lastName = "Test" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppConfiguration_configurationStores@2023-03-01/main.tf b/dependency/azapi_examples/Microsoft.AppConfiguration_configurationStores@2023-03-01/main.tf index 7327ceae..1615c9ae 100644 --- a/dependency/azapi_examples/Microsoft.AppConfiguration_configurationStores@2023-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.AppConfiguration_configurationStores@2023-03-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "configurationStore" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false enablePurgeProtection = false @@ -43,7 +39,7 @@ resource "azapi_resource" "configurationStore" { sku = { name = "standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring@2023-05-01-preview/main.tf index a399ea23..7d806fd8 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "S0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_DevToolPortals@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_DevToolPortals@2023-05-01-preview/main.tf index 7ac2ea9a..a85af8ec 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_DevToolPortals@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_DevToolPortals@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "DevToolPortal" { type = "Microsoft.AppPlatform/Spring/DevToolPortals@2023-05-01-preview" parent_id = azapi_resource.Spring.id name = "default" - body = jsonencode({ + body = { properties = { features = { applicationAccelerator = { @@ -59,7 +59,7 @@ resource "azapi_resource" "DevToolPortal" { } public = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apiPortals@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apiPortals@2023-05-01-preview/main.tf index 3e3743b7..ae834a22 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apiPortals@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apiPortals@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "apiPortal" { type = "Microsoft.AppPlatform/Spring/apiPortals@2023-05-01-preview" parent_id = azapi_resource.Spring.id name = "default" - body = jsonencode({ + body = { properties = { gatewayIds = [ ] @@ -59,7 +59,7 @@ resource "azapi_resource" "apiPortal" { name = "E0" tier = "Enterprise" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apiPortals_domains@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apiPortals_domains@2023-05-01-preview/main.tf index 13885c23..8bf31484 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apiPortals_domains@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apiPortals_domains@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "apiPortal" { type = "Microsoft.AppPlatform/Spring/apiPortals@2023-05-01-preview" parent_id = azapi_resource.Spring.id name = "default" - body = jsonencode({ + body = { properties = { gatewayIds = [ ] @@ -59,7 +59,7 @@ resource "azapi_resource" "apiPortal" { name = "E0" tier = "Enterprise" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -68,11 +68,11 @@ resource "azapi_resource" "domain" { type = "Microsoft.AppPlatform/Spring/apiPortals/domains@2023-05-01-preview" parent_id = azapi_resource.apiPortal.id name = "${var.resource_name}.azuremicroservices.io" - body = jsonencode({ + body = { properties = { thumbprint = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationAccelerators@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationAccelerators@2023-05-01-preview/main.tf index 1403d4bc..26070b53 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationAccelerators@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationAccelerators@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationAccelerators_customizedAccelerators@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationAccelerators_customizedAccelerators@2023-05-01-preview/main.tf index 83b68f88..37471dd2 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationAccelerators_customizedAccelerators@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationAccelerators_customizedAccelerators@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -55,7 +55,7 @@ resource "azapi_resource" "customizedAccelerator" { type = "Microsoft.AppPlatform/Spring/applicationAccelerators/customizedAccelerators@2023-05-01-preview" parent_id = azapi_resource.applicationAccelerator.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" displayName = "" @@ -70,7 +70,7 @@ resource "azapi_resource" "customizedAccelerator" { } iconUrl = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationLiveViews@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationLiveViews@2023-05-01-preview/main.tf index 91d20667..e0b52ebc 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationLiveViews@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_applicationLiveViews@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps@2023-05-01-preview/main.tf index 3991241a..9ad042d2 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,17 +48,14 @@ resource "azapi_resource" "app" { parent_id = azapi_resource.Spring.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { customPersistentDisks = [ ] enableEndToEndTLS = false public = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps_bindings@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps_bindings@2023-05-01-preview/main.tf index 34abd8f8..5e825455 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps_bindings@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps_bindings@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "S0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,17 +48,14 @@ resource "azapi_resource" "app" { parent_id = azapi_resource.Spring.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { customPersistentDisks = [ ] enableEndToEndTLS = false public = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -68,7 +65,7 @@ resource "azapi_resource" "redis" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { sku = { capacity = 2 @@ -78,7 +75,7 @@ resource "azapi_resource" "redis" { enableNonSslPort = true minimumTlsVersion = "1.2" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -94,15 +91,15 @@ resource "azapi_resource" "binding" { type = "Microsoft.AppPlatform/Spring/apps/bindings@2023-05-01-preview" parent_id = azapi_resource.app.id name = var.resource_name - body = jsonencode({ + body = { properties = { bindingParameters = { useSsl = "true" } - key = jsondecode(data.azapi_resource_action.listKeys.output).primaryKey + key = data.azapi_resource_action.listKeys.output.primaryKey resourceId = azapi_resource.redis.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps_deployments@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps_deployments@2023-05-01-preview/main.tf index 79721c86..b7bcbae6 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps_deployments@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_apps_deployments@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,17 +48,14 @@ resource "azapi_resource" "app" { parent_id = azapi_resource.Spring.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { customPersistentDisks = [ ] enableEndToEndTLS = false public = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,7 +64,7 @@ resource "azapi_resource" "deployment" { type = "Microsoft.AppPlatform/Spring/apps/deployments@2023-05-01-preview" parent_id = azapi_resource.app.id name = var.resource_name - body = jsonencode({ + body = { properties = { deploymentSettings = { environmentVariables = { @@ -91,7 +88,7 @@ resource "azapi_resource" "deployment" { name = "E0" tier = "Enterprise" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/main.tf index b82d573c..dfc163d2 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,10 +53,10 @@ resource "azapi_resource_action" "buildService" { type = "Microsoft.AppPlatform/Spring/buildServices@2023-05-01-preview" resource_id = data.azapi_resource_id.buildService.id method = "PUT" - body = jsonencode({ + body = { properties = { } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders@2023-05-01-preview/main.tf index e8e89db2..f91b0768 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,10 +53,10 @@ resource "azapi_resource_action" "buildService" { type = "Microsoft.AppPlatform/Spring/buildServices@2023-05-01-preview" resource_id = data.azapi_resource_id.buildService.id method = "PUT" - body = jsonencode({ + body = { properties = { } - }) + } response_export_values = ["*"] } @@ -64,7 +64,7 @@ resource "azapi_resource" "builder" { type = "Microsoft.AppPlatform/Spring/buildServices/builders@2023-05-01-preview" parent_id = azapi_resource_action.buildService.id name = var.resource_name - body = jsonencode({ + body = { properties = { buildpackGroups = [ { @@ -81,7 +81,7 @@ resource "azapi_resource" "builder" { version = "base" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders_buildpackBindings@2023-05-01-preview copy/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders_buildpackBindings@2023-05-01-preview copy/main.tf index acfc2b6f..16d94ff2 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders_buildpackBindings@2023-05-01-preview copy/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders_buildpackBindings@2023-05-01-preview copy/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,10 +53,10 @@ resource "azapi_resource_action" "buildService" { type = "Microsoft.AppPlatform/Spring/buildServices@2023-05-01-preview" resource_id = data.azapi_resource_id.buildService.id method = "PUT" - body = jsonencode({ + body = { properties = { } - }) + } response_export_values = ["*"] } @@ -64,7 +64,7 @@ resource "azapi_resource" "builder" { type = "Microsoft.AppPlatform/Spring/buildServices/builders@2023-05-01-preview" parent_id = azapi_resource_action.buildService.id name = var.resource_name - body = jsonencode({ + body = { properties = { buildpackGroups = [ { @@ -81,7 +81,7 @@ resource "azapi_resource" "builder" { version = "base" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -90,11 +90,11 @@ resource "azapi_resource" "buildpackBinding" { type = "Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings@2023-05-01-preview" parent_id = azapi_resource.builder.id name = var.resource_name - body = jsonencode({ + body = { properties = { bindingType = "ApplicationInsights" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders_buildpackBindings@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders_buildpackBindings@2023-05-01-preview/main.tf index acfc2b6f..16d94ff2 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders_buildpackBindings@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_buildServices_builders_buildpackBindings@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,10 +53,10 @@ resource "azapi_resource_action" "buildService" { type = "Microsoft.AppPlatform/Spring/buildServices@2023-05-01-preview" resource_id = data.azapi_resource_id.buildService.id method = "PUT" - body = jsonencode({ + body = { properties = { } - }) + } response_export_values = ["*"] } @@ -64,7 +64,7 @@ resource "azapi_resource" "builder" { type = "Microsoft.AppPlatform/Spring/buildServices/builders@2023-05-01-preview" parent_id = azapi_resource_action.buildService.id name = var.resource_name - body = jsonencode({ + body = { properties = { buildpackGroups = [ { @@ -81,7 +81,7 @@ resource "azapi_resource" "builder" { version = "base" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -90,11 +90,11 @@ resource "azapi_resource" "buildpackBinding" { type = "Microsoft.AppPlatform/Spring/buildServices/builders/buildpackBindings@2023-05-01-preview" parent_id = azapi_resource.builder.id name = var.resource_name - body = jsonencode({ + body = { properties = { bindingType = "ApplicationInsights" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_configServers@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_configServers@2023-05-01-preview/main.tf index c7ce0979..d30d5859 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_configServers@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_configServers@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "S0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,12 +47,12 @@ resource "azapi_update_resource" "configServer" { type = "Microsoft.AppPlatform/Spring/configServers@2023-05-01-preview" parent_id = azapi_resource.Spring.id name = "default" - body = jsonencode({ + body = { properties = { configServer = { } } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_configurationServices@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_configurationServices@2023-05-01-preview/main.tf index 5bd0964c..8b584821 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_configurationServices@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_configurationServices@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,14 +47,14 @@ resource "azapi_resource" "configurationService" { type = "Microsoft.AppPlatform/Spring/configurationServices@2023-05-01-preview" parent_id = azapi_resource.Spring.id name = "default" - body = jsonencode({ + body = { properties = { settings = { gitProperty = { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways@2023-05-01-preview/main.tf index f455b71d..bbbfbde5 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "gateway" { type = "Microsoft.AppPlatform/Spring/gateways@2023-05-01-preview" parent_id = azapi_resource.Spring.id name = "default" - body = jsonencode({ + body = { properties = { httpsOnly = false public = false @@ -57,7 +57,7 @@ resource "azapi_resource" "gateway" { name = "E0" tier = "Enterprise" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways_domains@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways_domains@2023-05-01-preview/main.tf index 405abea8..875b8e7e 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways_domains@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways_domains@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "gateway" { type = "Microsoft.AppPlatform/Spring/gateways@2023-05-01-preview" parent_id = azapi_resource.Spring.id name = "default" - body = jsonencode({ + body = { properties = { httpsOnly = false public = false @@ -57,7 +57,7 @@ resource "azapi_resource" "gateway" { name = "E0" tier = "Enterprise" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -66,11 +66,11 @@ resource "azapi_resource" "domain" { type = "Microsoft.AppPlatform/Spring/gateways/domains@2023-05-01-preview" parent_id = azapi_resource.gateway.id name = "${var.resource_name}.azuremicroservices.io" - body = jsonencode({ + body = { properties = { thumbprint = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways_routeConfigs@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways_routeConfigs@2023-05-01-preview/main.tf index 5ae19ed3..86c4a026 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways_routeConfigs@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_gateways_routeConfigs@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "E0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "gateway" { type = "Microsoft.AppPlatform/Spring/gateways@2023-05-01-preview" parent_id = azapi_resource.Spring.id name = "default" - body = jsonencode({ + body = { properties = { httpsOnly = false public = false @@ -57,7 +57,7 @@ resource "azapi_resource" "gateway" { name = "E0" tier = "Enterprise" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,17 +67,14 @@ resource "azapi_resource" "app" { parent_id = azapi_resource.Spring.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { customPersistentDisks = [ ] enableEndToEndTLS = false public = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -86,7 +83,7 @@ resource "azapi_resource" "routeConfig" { type = "Microsoft.AppPlatform/Spring/gateways/routeConfigs@2023-05-01-preview" parent_id = azapi_resource.gateway.id name = var.resource_name - body = jsonencode({ + body = { properties = { appResourceId = azapi_resource.app.id protocol = "HTTP" @@ -94,7 +91,7 @@ resource "azapi_resource" "routeConfig" { ] ssoEnabled = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_monitoringSettings@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_monitoringSettings@2023-05-01-preview/main.tf index 959a50d1..5c280a99 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_monitoringSettings@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_monitoringSettings@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "S0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,11 +47,11 @@ resource "azapi_update_resource" "monitoringSetting" { type = "Microsoft.AppPlatform/Spring/monitoringSettings@2023-05-01-preview" parent_id = azapi_resource.Spring.id name = "default" - body = jsonencode({ + body = { properties = { traceEnabled = false } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_storages@2023-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_storages@2023-05-01-preview/main.tf index 8f067238..ba3952ae 100644 --- a/dependency/azapi_examples/Microsoft.AppPlatform_Spring_storages@2023-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AppPlatform_Spring_storages@2023-05-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "S0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,10 +48,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -83,7 +80,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,13 +96,13 @@ resource "azapi_resource" "storage" { type = "Microsoft.AppPlatform/Spring/storages@2023-05-01-preview" parent_id = azapi_resource.Spring.id name = var.resource_name - body = jsonencode({ + body = { properties = { - accountKey = jsondecode(data.azapi_resource_action.listKeys.output).keys[0].value + accountKey = data.azapi_resource_action.listKeys.output.keys[0].value accountName = azapi_resource.storageAccount.name storageType = "StorageAccount" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.App_containerApps@2022-03-01/main.tf b/dependency/azapi_examples/Microsoft.App_containerApps@2022-03-01/main.tf index f364a7ea..24b1a816 100644 --- a/dependency/azapi_examples/Microsoft.App_containerApps@2022-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.App_containerApps@2022-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,19 +64,19 @@ resource "azapi_resource" "managedEnvironment" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { appLogsConfiguration = { destination = "log-analytics" logAnalyticsConfiguration = { - customerId = jsondecode(azapi_resource.workspace.output).properties.customerId - sharedKey = jsondecode(data.azapi_resource_action.sharedKeys.output).primarySharedKey + customerId = azapi_resource.workspace.output.properties.customerId + sharedKey = data.azapi_resource_action.sharedKeys.output.primarySharedKey } } vnetConfiguration = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -86,11 +86,7 @@ resource "azapi_resource" "containerApp" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { configuration = { activeRevisionsMode = "Single" @@ -121,7 +117,7 @@ resource "azapi_resource" "containerApp" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.App_managedEnvironments@2022-03-01/main.tf b/dependency/azapi_examples/Microsoft.App_managedEnvironments@2022-03-01/main.tf index c5bbbdfd..32cb48c4 100644 --- a/dependency/azapi_examples/Microsoft.App_managedEnvironments@2022-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.App_managedEnvironments@2022-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,19 +64,19 @@ resource "azapi_resource" "managedEnvironment" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { appLogsConfiguration = { destination = "log-analytics" logAnalyticsConfiguration = { - customerId = jsondecode(azapi_resource.workspace.output).properties.customerId - sharedKey = jsondecode(data.azapi_resource_action.sharedKeys.output).primarySharedKey + customerId = azapi_resource.workspace.output.properties.customerId + sharedKey = data.azapi_resource_action.sharedKeys.output.primarySharedKey } } vnetConfiguration = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.App_managedEnvironments_certificates@2022-03-01/main.tf b/dependency/azapi_examples/Microsoft.App_managedEnvironments_certificates@2022-03-01/main.tf index f651b3e2..87c50c0c 100644 --- a/dependency/azapi_examples/Microsoft.App_managedEnvironments_certificates@2022-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.App_managedEnvironments_certificates@2022-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,19 +64,19 @@ resource "azapi_resource" "managedEnvironment" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { appLogsConfiguration = { destination = "log-analytics" logAnalyticsConfiguration = { - customerId = jsondecode(azapi_resource.workspace.output).properties.customerId - sharedKey = jsondecode(data.azapi_resource_action.sharedKeys.output).primarySharedKey + customerId = azapi_resource.workspace.output.properties.customerId + sharedKey = data.azapi_resource_action.sharedKeys.output.primarySharedKey } } vnetConfiguration = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -86,12 +86,12 @@ resource "azapi_resource" "certificate" { parent_id = azapi_resource.managedEnvironment.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { password = "TestAcc" value = "MIIKEQIBAzCCCdcGCSqGSIb3DQEHAaCCCcgEggnEMIIJwDCCBHcGCSqGSIb3DQEHBqCCBGgwggRkAgEAMIIEXQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIC/GU56w4YWICAggAgIIEME9dVUOUs44yTqMunA5mEqo8YC4evKVXEA8ESnlfh8QVNEpyWzxwx83t6tg0Dfjk4INCGnDrAxqhQ/685mWQ9IM7J944BTznoN6uK9EqMtDVwavqwapvVR+yCCzqCMIQWUrrAiUzNPFQELCaMg1S13pjHOVd0iJSxvJ98Dga35baMyheYnLYksz1OObCyrn4yAHoyVnenqZd46He0ZmQS3pUrnTYe3U56fZDapRE6peRL5ItIpFrytaV7+KLisQdpQKDPkeew/zaf+p1hT57EHfUFgBYWFMgN4f1egqkKKDrh112Z+C6CUlps5N0AYGZ+ozLMNd1t/x87gCH5AuNeQEIBfDkmhLvZWZ5vLOiEKAoAQxFaMK+U+Vih6msysaQ7NhFA+h/NMmdt9RPm9pV7X+Qq7KNKHnhMZ7mNqxKvdidPOj5UGqhnN/OXrY8MykoedDakwwE9ZCY3ZQS9IN8kjwl2m9gJy18A2hZK+m3jEYGfn6tDayN6eAod1q/OnP7Tujp06pZFZ8HyXIbTPApuFYXSbAWhdBuCHGj0PzthLRzN8iv3T1d46oaEjjQddpM683RWH+daFtXLX7gMH4QjHxRND3IxEzHOiehLwOr2w6bgzIEeXksDPqitz/RGLgs4f10B6cvkCuGTXUCAQcel2IN4fM7dpD5uyg40q+xaFjmF/OLRdjS1vCezDvxVbRpazZOxMFMPQykBFcInP4vKURZ09MujElbBHSiglNjYGEC8k1Ehcqmz9GqU5o+9JHYFr2AgRqIIyz7jIjCZxsD0psdVjIPSYac6Qze5BK+qq/cH/ilIaNq3WGgwCtPA1pcicVYAYwB4czTHUfteO1FjlGYqbGu1b4GA4HzPLBUjTaFla4FgnO7je4PT7A3u3xaVAsCC1rZWKM4atYmkckboC4XE14mYlU625Hoap/xvKW6cbVAucBRkxMps/bV1Pik6N3YLeG2KUMQ77yNDGgv3qZ6XpgJ1Um7QZyW1XdQqtktZBror0bNUsG3Kkp/XPNxWhJLPI3baY84dqoRsXaDIh7k+iV+UuX/Tz70PqWThwANHJ2BmkwXUY1cyiHqJ4mBnu9t/oitjVVYr3a5UGKDzQY6Tcjrp22npiDrnEKpdwqUeShqb0mO4cCAksYy6jh7Eirk1Gdlk/tbMBMCN16Wbsh3kk/i9utQAc4R6+VFq5+/26noW/Q24a4onRGjZ5+rUXlGDUjzssJPxXM6906qMZIpdMB2nZMUp4P6UcPgB3t8FQa8SJs3gIFTxmf9Dce1qloHeXGX7UZ3IGZRZPqxXuBOzCbKf5/M2c3Pe6Vl3Jt/LTN22ghKR4VrVz7Ron71NU+CCvH4LbOyEnnzWe1ePO6RCdpRcN1bUJYa1htvWKb9WUMywfLiKjC6Cx+ezfFZ1DYvXsjq6MzKq22/XE4/fM0wggVBBgkqhkiG9w0BBwGgggUyBIIFLjCCBSowggUmBgsqhkiG9w0BDAoBAqCCBO4wggTqMBwGCiqGSIb3DQEMAQMwDgQIGRXiBvDEL+QCAggABIIEyLn7jmjZLfuFF366QMW9j8TolTxeyuMxsaPnEmw1sIc9Y6IlKzCqzGt3qAgSgdTPV6flNJBcoI4oQFhes7EDcpNfrAxzIRBQYS7i2JC/T68GNfkTIlb0sq8oU4JgoGMXDPjhgQ3yUNkn4xnxfpxy7N1mo41LfJVovG8JsBtg0boV2OovxKYTVFg4X1W4KD+BcJMkI+gjlmHcrnWkDFEycEddxznZINaf9LiZsoSh6gvSGXSRBrmFkG5nWXB/Q25r6cxHm4ZNIKYLFyCV8waq5R1fnvuiT62BI8vYyD1NO+Py2FGFO3vqV/7KrrD8x9eijSv2+ooe220Lqi2lR8HNlwrgh9my4Fak6SzQC5E2iAStzZrRtUr3Xfs4di8ixwgpC6HAt/egOCocKI6aJhouJJoihrow4axeKYdsjKgXairNElIu0/aTdKXptdfXuAos2ct42AHDP3TVngH6q+2B8HPyokQjegr+WE6Jfw9aHeLIBIPK3pFAUqH7hDHFt2OM4GZDaDMesNYhFaX+IJqdIbvr97eaLDFgrhVhB4kvRw7E2VW2K9aXDmDlIRP2XmXEcbC31cKzV19A4W7rEuTdJ9IJb06sCmU/jIGSdm9g+fKKXd15K9D+U+kyhCwqzEZt0JYsJIzypq15nL+QQX61renMUwfU13H0RYjjvqU3CGH3shUGcl0FvQoMPQy1a04ZvOsGiqLlR3lkiEbov7a/prJCkH1AAwezUHiSrn/Y7rVWGLHyd4k6Hd7wBvzRia3MmYDertXdEiinyMqPBiVRdd/NkSkjiBgLpHl3VleKJzmrlLfENnMt2iLSr3ZbhmVpJfn6wMhsqdIbkQT3CcSIoVo91U8JL6U38s4kArKtjgHgSUtST6Aw2o06EOWvVSp2BpsLNth/s21vK7Z1xnrZ06fO/msj+ElzsmLpPVGFpG3D8MW1ULZd2VqtK6cPFPyaYjUE3ZahGn50/DIVaSikvv6Yh4YjMBksiBfsLdndvfIit29i/eRTd3T28WPmvY87k6uG8xgYoDlwXmrBHdl57NktM8ND+Z9HUww4/issZkvvh7MdU2YbDOQsBs2kIYf6h2udRpztXBpecyI2WmFW8tsKXhv4vdx+xldEwtHQL4/UWgofkNl2LeABpn00kRjZ+rybD2p7cCmXKQbM+I6Yu564hC1lffAMBrMT5yUFgzCdmkRJT+8xp1C/zxWGx16dFImpTIPNmjGBU6UcfBg+fpFocybQ8s+yb2Xoq/s/NxpYDO5vqQT/rpPtKCQls8DLMssGgGAyvZ+e0qCnfK5BKUKtxA0tz/mXZrt+Ty6w6KjdZ6Ntmjt546tXTBeRrCJZlwJmPKehpeN5HopDQ7LyWqrKXLGlArCLmB1Xz1LUR1vL4KD7RdO/93LWN5EWQDRtoZCVFU/tCqRh+s4Ljw5jsiFBCczoF3z3dDSid3VL864bXB2neq/wHHhChSnODo6HhdaPfGYSFw7m4kFh7tn3MimFyTdJGqtPdLckFCqckZsliZyCqEAu05xgQJqjrnBEH8B/z3Aq3hHWiR0z1v8jPc8MUlBGeaTjl29c8DSx7gBh7c0Qs0yTxHd1TcELijPvy5dwzEenBYXDCbaxPW0Vm9AHsHVF2A2iuzElMCMGCSqGSIb3DQEJFTEWBBRwppPHAzTboDcfcZuQ6/YqIKiy2zAxMCEwCQYFKw4DAhoFAAQUNIuVDYFIRiHWnbIWwMphIFjOWckECND1GYVTSUGNAgIIAA==" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.App_managedEnvironments_daprComponents@2022-03-01/main.tf b/dependency/azapi_examples/Microsoft.App_managedEnvironments_daprComponents@2022-03-01/main.tf index f0851b96..bd69765e 100644 --- a/dependency/azapi_examples/Microsoft.App_managedEnvironments_daprComponents@2022-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.App_managedEnvironments_daprComponents@2022-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,19 +64,19 @@ resource "azapi_resource" "managedEnvironment" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { appLogsConfiguration = { destination = "log-analytics" logAnalyticsConfiguration = { - customerId = jsondecode(azapi_resource.workspace.output).properties.customerId - sharedKey = jsondecode(data.azapi_resource_action.sharedKeys.output).primarySharedKey + customerId = azapi_resource.workspace.output.properties.customerId + sharedKey = data.azapi_resource_action.sharedKeys.output.primarySharedKey } } vnetConfiguration = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -85,7 +85,7 @@ resource "azapi_resource" "daprComponent" { type = "Microsoft.App/managedEnvironments/daprComponents@2022-03-01" parent_id = azapi_resource.managedEnvironment.id name = var.resource_name - body = jsonencode({ + body = { properties = { componentType = "state.azure.blobstorage" ignoreErrors = false @@ -93,7 +93,7 @@ resource "azapi_resource" "daprComponent" { scopes = null version = "v1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.App_managedEnvironments_storages@2022-03-01/main.tf b/dependency/azapi_examples/Microsoft.App_managedEnvironments_storages@2022-03-01/main.tf index 11db3737..b2d3ff41 100644 --- a/dependency/azapi_examples/Microsoft.App_managedEnvironments_storages@2022-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.App_managedEnvironments_storages@2022-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,10 +57,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -95,7 +92,7 @@ resource "azapi_resource" "storageAccount" { tags = { environment = "accTest" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -112,19 +109,19 @@ resource "azapi_resource" "managedEnvironment" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { appLogsConfiguration = { destination = "log-analytics" logAnalyticsConfiguration = { - customerId = jsondecode(azapi_resource.workspace.output).properties.customerId - sharedKey = jsondecode(data.azapi_resource_action.sharedKeys.output).primarySharedKey + customerId = azapi_resource.workspace.output.properties.customerId + sharedKey = data.azapi_resource_action.sharedKeys.output.primarySharedKey } } vnetConfiguration = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -140,16 +137,16 @@ resource "azapi_resource" "storage" { type = "Microsoft.App/managedEnvironments/storages@2022-03-01" parent_id = azapi_resource.managedEnvironment.id name = var.resource_name - body = jsonencode({ + body = { properties = { azureFile = { accessMode = "ReadWrite" - accountKey = jsondecode(data.azapi_resource_action.listKeys.output).keys[0].value - accountName = jsondecode(azapi_resource.storageAccount.output).name + accountKey = data.azapi_resource_action.listKeys.output.keys[0].value + accountName = azapi_resource.storageAccount.output.name shareName = "testsharehkez7" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Authorization_locks@2020-05-01/main.tf b/dependency/azapi_examples/Microsoft.Authorization_locks@2020-05-01/main.tf index dc9476c7..e4472c64 100644 --- a/dependency/azapi_examples/Microsoft.Authorization_locks@2020-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Authorization_locks@2020-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -44,7 +44,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Basic" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,12 +53,12 @@ resource "azapi_resource" "lock" { type = "Microsoft.Authorization/locks@2020-05-01" parent_id = azapi_resource.publicIPAddress.id name = var.resource_name - body = jsonencode({ + body = { properties = { level = "CanNotDelete" notes = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Authorization_policyAssignments@2022-06-01/main.tf b/dependency/azapi_examples/Microsoft.Authorization_policyAssignments@2022-06-01/main.tf index 0a8b24d0..c03481ba 100644 --- a/dependency/azapi_examples/Microsoft.Authorization_policyAssignments@2022-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Authorization_policyAssignments@2022-06-01/main.tf @@ -41,7 +41,7 @@ resource "azapi_resource" "policyDefinition" { type = "Microsoft.Authorization/policyDefinitions@2021-06-01" parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" displayName = "my-policy-definition" @@ -69,7 +69,7 @@ resource "azapi_resource" "policyDefinition" { } policyType = "Custom" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +78,7 @@ resource "azapi_resource" "policyAssignment" { type = "Microsoft.Authorization/policyAssignments@2022-06-01" parent_id = data.azapi_resource.subscription.id name = var.resource_name - body = jsonencode({ + body = { properties = { displayName = "" enforcementMode = "Default" @@ -94,7 +94,7 @@ resource "azapi_resource" "policyAssignment" { policyDefinitionId = azapi_resource.policyDefinition.id scope = data.azapi_resource.subscription.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Authorization_policyDefinitions@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Authorization_policyDefinitions@2021-06-01/main.tf index a9e5f6db..7bdbbc9d 100644 --- a/dependency/azapi_examples/Microsoft.Authorization_policyDefinitions@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Authorization_policyDefinitions@2021-06-01/main.tf @@ -35,7 +35,7 @@ resource "azapi_resource" "policyDefinition" { type = "Microsoft.Authorization/policyDefinitions@2021-06-01" parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" displayName = "my-policy-definition" @@ -63,7 +63,7 @@ resource "azapi_resource" "policyDefinition" { } policyType = "Custom" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Authorization_policyExemptions@2020-07-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Authorization_policyExemptions@2020-07-01-preview/main.tf index cd25f2b2..aec42e06 100644 --- a/dependency/azapi_examples/Microsoft.Authorization_policyExemptions@2020-07-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Authorization_policyExemptions@2020-07-01-preview/main.tf @@ -41,7 +41,7 @@ resource "azapi_resource" "policyDefinition" { type = "Microsoft.Authorization/policyDefinitions@2021-06-01" parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" displayName = "my-policy-definition" @@ -69,7 +69,7 @@ resource "azapi_resource" "policyDefinition" { } policyType = "Custom" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -79,18 +79,18 @@ resource "azapi_resource" "policyAssignment" { parent_id = data.azapi_resource.subscription.id name = var.resource_name location = "westeurope" - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { displayName = "" enforcementMode = "Default" policyDefinitionId = azapi_resource.policyDefinition.id scope = data.azapi_resource.subscription.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,14 +99,14 @@ resource "azapi_resource" "policyExemption" { type = "Microsoft.Authorization/policyExemptions@2020-07-01-preview" parent_id = data.azapi_resource.subscription.id name = var.resource_name - body = jsonencode({ + body = { properties = { exemptionCategory = "Mitigated" policyAssignmentId = azapi_resource.policyAssignment.id policyDefinitionReferenceIds = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Authorization_roleDefinitions@2018-01-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Authorization_roleDefinitions@2018-01-01-preview/main.tf index e2c002b9..92f08a17 100644 --- a/dependency/azapi_examples/Microsoft.Authorization_roleDefinitions@2018-01-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Authorization_roleDefinitions@2018-01-01-preview/main.tf @@ -41,7 +41,7 @@ resource "azapi_resource" "roleDefinition" { type = "Microsoft.Authorization/roleDefinitions@2018-01-01-preview" parent_id = data.azapi_resource.subscription.id name = "6faae21a-0cd6-4536-8c23-a278823d12ed" - body = jsonencode({ + body = { properties = { assignableScopes = [ data.azapi_resource.subscription.id, @@ -63,7 +63,7 @@ resource "azapi_resource" "roleDefinition" { roleName = var.resource_name type = "CustomRole" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automanage_configurationProfiles@2022-05-04/main.tf b/dependency/azapi_examples/Microsoft.Automanage_configurationProfiles@2022-05-04/main.tf index c5f4f692..9bcaa662 100644 --- a/dependency/azapi_examples/Microsoft.Automanage_configurationProfiles@2022-05-04/main.tf +++ b/dependency/azapi_examples/Microsoft.Automanage_configurationProfiles@2022-05-04/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "configurationProfile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { configuration = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts@2021-06-22/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts@2021-06-22/main.tf index db5737e5..db953796 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts@2021-06-22/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts@2021-06-22/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_certificates@2020-01-13-preview/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_certificates@2020-01-13-preview/main.tf index 0907b5ae..0fd3a8ca 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_certificates@2020-01-13-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_certificates@2020-01-13-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,13 +50,13 @@ resource "azapi_resource" "certificate" { type = "Microsoft.Automation/automationAccounts/certificates@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { base64Value = "MIIJXQIBAzCCCSMGCSqGSIb3DQEHAaCCCRQEggkQMIIJDDCCA0cGCSqGSIb3DQEHBqCCAzgwggM0AgEAMIIDLQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIgZpS0MR7AtwCAggAgIIDABD/o+pR2WXdr9RKUXVH3+L5/iNcSEAf5IFtBs2DftFE4wF+y32TUsp67M0LY4YfGLs3UEyv6qL2Mf1/nHRL87CaKWza9Dzz1H+TWIffA2fj/AsqLr+6QDJ4Ur9cvmvqdL2xL0hfmWt3RwCn7F0JLBfwLeColacsLkEqwqStGkFvjQ8r2CJ+E0xZ8GRzOdT8TOz0cGNzDl3dkSeRGYqDQ5/5NlGE6n3MJTqhullbff61hM6NBEZyB9xhNNs6zkT5j6Askx40YFpEStdFJ1TQSRMLDoCEpb6lqYY+HQ07ezoxYKvK/XMq43eN15sZz320ktkEkUF5ICyAry+ud1Cd6ReSV6ai4JvOaZGNwLVuFxinAq8TXqpBlqLOQSJCA6dItWo1O4snfPKTqblj8LxRYecLR8Pl9R55iVf2rh6p70b89UviTWrdlnUxhz3Ilb2CDC1dFIZCy8/qVA7pT0NwfNrhCIqv+qUrIRdhMAJkifa61EIQPUKJaWJutpnBHg82T1FKKpuIqgQvHnsctrQegW1KdF1WJKa/p8knRbKKeID4TQxM/c5+GdP+wAfsNjEedoZ4Z9Ud69ZMGYHrv21CgdafSzfhSecuz89kDzG8XNVXjIjhRA3aRkxMXK+xPD2ikmy0kZjBchpTbzy7zfC8SHfKypUkYTSqbQKakgqSQY9Ydd0XxGS+GovQ4TgCDr1qHCP8KYhtYbuW8PPDUblhLOxJzP3AzDbmMuZfFrRzUrq24F8FgOVvFiGrvLVgOXzMOX+mah+cli5fw3XqnBeu72yYhhXi/jxCHZ4C8I2T0okcCu016f4a0T9+dx///F7HsEjIkGI/Vrpiqiwclu1BXdiUwGpWBDvMHjTa0nD/2mqMZzSD6KclmeuQEzGLcgbVUzcg2VYGMfw8PHlDJNCJVZKf6TaK39+M+tW1BRB4/vSjBeZ2rSHDHzIykUGWmowPnb8mb50CaRa3k1iqhGmzcIaGbsDupPc+lTXB+VuaDQT+WAquINnhKQqIsgopDvmh1zCCBb0GCSqGSIb3DQEHAaCCBa4EggWqMIIFpjCCBaIGCyqGSIb3DQEMCgECoIIE7jCCBOowHAYKKoZIhvcNAQwBAzAOBAicxAYjkBRUlAICCAAEggTI6TAZVzV4qOBs34TeAIembvZyAxzknzIMB1jdKWQJgRXbeICY9v4ch68ilhKJGkzexOwqaEcOuB7rG8GKw4f+DIimLTSpHdKXpqVlUbhapQxnKvOvrcX3jJrfBmXu7cqaEXwol5b6Sx4zKbryAyNqACHxD2XOeUFG0man/aoVrJVfyLgv4i+K/I3hNwtaX4NY4Yegmlm05MH+pInHmt2lNKLKJhwgMiImarmoixFymSvt/4bqBfZMzXf4iWzacK+MjHVLZL6B7AeY026AGEOmlH/yEQCpee/LXzkpG3iAABQlVPuioYTv7svTiEi9IQa3qg2xjLQKAC8rsaUabNZ4rRJgmU2BNrzhgkNpKCjtLqpXMUB+hGi8njlLVciIxjElG3xpu829sNCm/hnXUyTiGvamNbQ0LfsFBttXX0OtnYeWoaBQMUsPsnc7HqsPVo2TD29PMs6Pgh2k6H6L7HSUWv5TN7kRFujDGCG79AKjSHTlF6htrioo3ZZRxUMOAWB4KBrLxLrR3Fs1B5etvvUd+nG2GY4sKZf2ezwblfjCqNYX2CmbH8xT+2L0WRBfp+QsOEZP8VnBpO1uSLhqogIr4fs10sWq9CZ8fnE4NRGgb1Di++8OSeXxSiIJox4zsME8HjePUKTajO2l/q22D29CCMh6aPW2cWQSDBbHE80UMrb2ewa/lKohviqm1Z/BaHRyqAf4J5szrroQe0KrFGk/7ju3s4xZ3qagg+vhgQin8csHrolq1mW2RiTSzNgPyTP54axZqAXO75LxcYoexsxZi1anvubc8L49kuD6Sra8SU9Op0GYSLQwtVug0IqYaQbZFiN8CW5cxG6T1F6CBSM91xBBld3Cq8xwTltOBG1u1jXgMHWTeXCBzBPADC8zmJ8Xth4ZBRdOj8krUQI07feTz+xFhVRs4FHgimJBzv9HtqvDaZFUajQyBLRucTqC5pj4bVcZCKPAwTr4dpgb0C4OvYJD92YDI5h1lUgdC1oRERf9gv0j+gfOJwnDNPq8WwmdvHbYdoATPqIqLcfFig5bElX1BRQGnP6CmfUzU/yiN48saHoYw0Xsg/C6pBvI9daxz/8qpsAjacJw/SkUveqLxkSvrRyiDm6mnTb0L/tl/wk0KwOT5SkR7viD7GvG5ChSr9nhfIjcOXEuorNEe8bEgrwrQqinCz9Q3UGZI0ZdsvI+2eK9YRgyp4p2Z4skXlPZP2p9MbTJDLdIAwFsvtwCBfM/SQc93YkkIvT6JQvAs9krhnWbMg5jpgQR7gRZvUyLkscxq1Q0hFmWQ9eeyACgOmC8iC6tjANLaAM9gu6i8PnTWIgy5DKzxyCi8ql0JgCtT+oMVz9bA8HY9sxB5v+qSssQB2j110URUTw77XFHfmas8vR7fajhuOTgBN5ohyidHSC3LlKv6l5r1NbI+66nYDabJn/DEk2VpkJ2+0HhmiW6mTqGSTf2P1prHzGXKnQpxodr5s5Z/X94Nwc3jyhZcDkOOEDpw0DvrwBjjhaTRnMvA7x1Re8aBQC9+5cXnG45x6AGMI1kB/wwE9PLZM7EiyTh2mj2cqZQ84H9uG2MhSBMMKC8fDxB/rezV+2HF4gBHOYbLw6YBZKXVvL1sb07yMOhirBcs1eOMYGgMCMGCSqGSIb3DQEJFTEWBBSuuXuBpo6JiIUJcpFqi4ts2POYEzB5BgkrBgEEAYI3EQExbB5qAE0AaQBjAHIAbwBzAG8AZgB0ACAARQBuAGgAYQBuAGMAZQBkACAAUgBTAEEAIABhAG4AZAAgAEEARQBTACAAQwByAHkAcAB0AG8AZwByAGEAcABoAGkAYwAgAFAAcgBvAHYAaQBkAGUAcjAxMCEwCQYFKw4DAhoFAAQUbe4FrGhxVExQjYdlCaXBHX2nbG4ECAHH8i4dQCJDAgIIAA==" description = "" isExportable = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_configurations@2022-08-08/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_configurations@2022-08-08/main.tf index ab6ab344..1bf4fca8 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_configurations@2022-08-08/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_configurations@2022-08-08/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,7 +51,7 @@ resource "azapi_resource" "configuration" { parent_id = azapi_resource.automationAccount.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "test" logVerbose = false @@ -63,7 +63,7 @@ resource "azapi_resource" "configuration" { tags = { ENV = "prod" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_connectionTypes@2020-01-13-preview/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_connectionTypes@2020-01-13-preview/main.tf index 66d1fe59..6f173896 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_connectionTypes@2020-01-13-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_connectionTypes@2020-01-13-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,7 +50,7 @@ resource "azapi_resource" "connectionType" { type = "Microsoft.Automation/automationAccounts/connectionTypes@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { fieldDefinitions = { my_def = { @@ -61,7 +61,7 @@ resource "azapi_resource" "connectionType" { } isGlobal = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_connections@2020-01-13-preview/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_connections@2020-01-13-preview/main.tf index e6f6942c..d24f3fa1 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_connections@2020-01-13-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_connections@2020-01-13-preview/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -52,7 +52,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -61,7 +61,7 @@ resource "azapi_resource" "connection" { type = "Microsoft.Automation/automationAccounts/connections@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { connectionType = { name = "AzureServicePrincipal" @@ -74,7 +74,7 @@ resource "azapi_resource" "connection" { TenantId = data.azurerm_client_config.current.tenant_id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_credentials@2020-01-13-preview/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_credentials@2020-01-13-preview/main.tf index 664e7138..fd93ba2d 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_credentials@2020-01-13-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_credentials@2020-01-13-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,13 +50,13 @@ resource "azapi_resource" "credential" { type = "Microsoft.Automation/automationAccounts/credentials@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" password = "test_pwd" userName = "test_user" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_hybridRunbookWorkerGroups@2021-06-22/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_hybridRunbookWorkerGroups@2021-06-22/main.tf index 745983ce..97cf0897 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_hybridRunbookWorkerGroups@2021-06-22/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_hybridRunbookWorkerGroups@2021-06-22/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,13 +50,13 @@ resource "azapi_resource" "credential" { type = "Microsoft.Automation/automationAccounts/credentials@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" password = "test_pwd" userName = "test_user" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -65,11 +65,11 @@ resource "azapi_resource" "hybridRunbookWorkerGroup" { type = "Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups@2021-06-22" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { credential = { name = azapi_resource.credential.name } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_hybridRunbookWorkerGroups_hybridRunbookWorkers@2021-06-22/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_hybridRunbookWorkerGroups_hybridRunbookWorkers@2021-06-22/main.tf index 06995396..cff289df 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_hybridRunbookWorkerGroups_hybridRunbookWorkers@2021-06-22/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_hybridRunbookWorkerGroups_hybridRunbookWorkers@2021-06-22/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,7 +51,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -65,17 +65,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "internal" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -87,7 +89,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -96,13 +98,13 @@ resource "azapi_resource" "credential" { type = "Microsoft.Automation/automationAccounts/credentials@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" password = "test_pwd" userName = "test_user" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -111,11 +113,11 @@ resource "azapi_resource" "hybridRunbookWorkerGroup" { type = "Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups@2021-06-22" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { credential = { name = azapi_resource.credential.name } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -125,7 +127,7 @@ resource "azapi_resource" "networkInterface" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enableAcceleratedNetworking = false enableIPForwarding = false @@ -143,7 +145,7 @@ resource "azapi_resource" "networkInterface" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -153,7 +155,7 @@ resource "azapi_resource" "virtualMachine" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { additionalCapabilities = { } @@ -222,7 +224,7 @@ resource "azapi_resource" "virtualMachine" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -231,11 +233,11 @@ resource "azapi_resource" "hybridRunbookWorker" { type = "Microsoft.Automation/automationAccounts/hybridRunbookWorkerGroups/hybridRunbookWorkers@2021-06-22" parent_id = azapi_resource.hybridRunbookWorkerGroup.id name = "c7714056-5ba8-4bbe-920e-2993171164eb" - body = jsonencode({ + body = { properties = { vmResourceId = azapi_resource.virtualMachine.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_jobSchedules@2020-01-13-preview/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_jobSchedules@2020-01-13-preview/main.tf index 29f58cd4..79f96f5c 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_jobSchedules@2020-01-13-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_jobSchedules@2020-01-13-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,7 +51,7 @@ resource "azapi_resource" "runbook" { parent_id = azapi_resource.automationAccount.id name = "Get-AzureVMTutorial" location = var.location - body = jsonencode({ + body = { properties = { description = "This is a test runbook for terraform acceptance test" draft = { @@ -61,7 +61,7 @@ resource "azapi_resource" "runbook" { logVerbose = true runbookType = "PowerShell" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,14 +76,14 @@ resource "azapi_resource" "schedule" { type = "Microsoft.Automation/automationAccounts/schedules@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" frequency = "OneTime" startTime = "2024-07-05T08:51:00+00:00" timeZone = "Etc/UTC" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -92,7 +92,7 @@ resource "azapi_resource" "jobSchedule" { type = "Microsoft.Automation/automationAccounts/jobSchedules@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = "194a324f-9e3d-43ee-1234-c968b797edd5" - body = jsonencode({ + body = { properties = { runbook = { name = azapi_resource.runbook.name @@ -101,7 +101,7 @@ resource "azapi_resource" "jobSchedule" { name = azapi_resource.schedule.name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] depends_on = [azapi_resource_action.public_runbook] diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_modules@2020-01-13-preview/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_modules@2020-01-13-preview/main.tf index c7981115..baafed7f 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_modules@2020-01-13-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_modules@2020-01-13-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,13 +50,13 @@ resource "azapi_resource" "module" { type = "Microsoft.Automation/automationAccounts/modules@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = "xActiveDirectory" - body = jsonencode({ + body = { properties = { contentLink = { uri = "https://devopsgallerystorage.blob.core.windows.net/packages/xactivedirectory.2.19.0.nupkg" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_runbooks@2019-06-01/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_runbooks@2019-06-01/main.tf index ff74cf0e..1da929e3 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_runbooks@2019-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_runbooks@2019-06-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,7 +51,7 @@ resource "azapi_resource" "runbook" { parent_id = azapi_resource.automationAccount.id name = "Get-AzureVMTutorial" location = var.location - body = jsonencode({ + body = { properties = { description = "This is a test runbook for terraform acceptance test" draft = { @@ -61,7 +61,7 @@ resource "azapi_resource" "runbook" { logVerbose = true runbookType = "PowerShell" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_runbooks_draft@2018-06-30/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_runbooks_draft@2018-06-30/main.tf index 43c3cad9..7ce26161 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_runbooks_draft@2018-06-30/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_runbooks_draft@2018-06-30/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,7 +51,7 @@ resource "azapi_resource" "runbook" { parent_id = azapi_resource.automationAccount.id name = "Get-AzureVMTutorial" location = var.location - body = jsonencode({ + body = { properties = { description = "This is a test runbook for terraform acceptance test" draft = { @@ -61,7 +61,7 @@ resource "azapi_resource" "runbook" { logVerbose = true runbookType = "PowerShell" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,9 +76,9 @@ resource "azapi_resource_action" "draft" { type = "Microsoft.Automation/automationAccounts/runbooks/draft@2018-06-30" resource_id = data.azapi_resource_id.draft.id method = "PUT" - body = jsonencode({ + body = { name = "content" - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_schedules@2020-01-13-preview/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_schedules@2020-01-13-preview/main.tf index 3a9ae97e..acf99051 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_schedules@2020-01-13-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_schedules@2020-01-13-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,14 +50,14 @@ resource "azapi_resource" "schedule" { type = "Microsoft.Automation/automationAccounts/schedules@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" frequency = "OneTime" startTime = "2024-07-05T08:51:00+00:00" timeZone = "Etc/UTC" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_softwareUpdateConfigurations@2019-06-01/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_softwareUpdateConfigurations@2019-06-01/main.tf index 8d933ee9..6fc71161 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_softwareUpdateConfigurations@2019-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_softwareUpdateConfigurations@2019-06-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,7 +50,7 @@ resource "azapi_resource" "softwareUpdateConfiguration" { type = "Microsoft.Automation/automationAccounts/softwareUpdateConfigurations@2019-06-01" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { scheduleInfo = { description = "" @@ -87,7 +87,7 @@ resource "azapi_resource" "softwareUpdateConfiguration" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_variables@2020-01-13-preview/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_variables@2020-01-13-preview/main.tf index e7feb5ce..4ccd9b8f 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_variables@2020-01-13-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_variables@2020-01-13-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,13 +50,13 @@ resource "azapi_resource" "variable" { type = "Microsoft.Automation/automationAccounts/variables@2020-01-13-preview" parent_id = azapi_resource.automationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" isEncrypted = false value = "\"Hello, Terraform Basic Test.\"" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_webHooks@2015-10-31/main.tf b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_webHooks@2015-10-31/main.tf index 35f6a379..071cc564 100644 --- a/dependency/azapi_examples/Microsoft.Automation_automationAccounts_webHooks@2015-10-31/main.tf +++ b/dependency/azapi_examples/Microsoft.Automation_automationAccounts_webHooks@2015-10-31/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -41,7 +41,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,7 +51,7 @@ resource "azapi_resource" "runbook" { parent_id = azapi_resource.automationAccount.id name = "Get-AzureVMTutorial" location = var.location - body = jsonencode({ + body = { properties = { description = "This is a test runbook for terraform acceptance test" draft = { @@ -61,7 +61,7 @@ resource "azapi_resource" "runbook" { logVerbose = true runbookType = "PowerShell" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,7 +76,7 @@ resource "azapi_resource" "webHook" { type = "Microsoft.Automation/automationAccounts/webHooks@2015-10-31" parent_id = azapi_resource.automationAccount.id name = "TestRunbook_webhook" - body = jsonencode({ + body = { properties = { expiryTime = "2025-06-30T04:27:24Z" isEnabled = true @@ -87,10 +87,12 @@ resource "azapi_resource" "webHook" { name = azapi_resource.runbook.name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.expiryTime"] depends_on = [azapi_resource_action.publish_runbook] + lifecycle { + ignore_changes = [body.properties.expiryTime] + } } diff --git a/dependency/azapi_examples/Microsoft.AzureActiveDirectory_b2cDirectories@2021-04-01-preview/main.tf b/dependency/azapi_examples/Microsoft.AzureActiveDirectory_b2cDirectories@2021-04-01-preview/main.tf index 353a2a68..7121bbbf 100644 --- a/dependency/azapi_examples/Microsoft.AzureActiveDirectory_b2cDirectories@2021-04-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.AzureActiveDirectory_b2cDirectories@2021-04-01-preview/main.tf @@ -36,7 +36,7 @@ resource "azapi_resource_action" "b2cDirectory" { type = "Microsoft.AzureActiveDirectory/b2cDirectories@2021-04-01-preview" resource_id = data.azapi_resource_id.b2cDirectory.id method = "PUT" - body = jsonencode({ + body = { location = "United States" properties = { createTenantProperties = { @@ -49,5 +49,5 @@ resource "azapi_resource_action" "b2cDirectory" { tier = "A0" } - }) + } } diff --git a/dependency/azapi_examples/Microsoft.Batch_batchAccounts@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.Batch_batchAccounts@2022-10-01/main.tf index 3c13cb8e..ed30419a 100644 --- a/dependency/azapi_examples/Microsoft.Batch_batchAccounts@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Batch_batchAccounts@2022-10-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "batchAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { encryption = { keySource = "Microsoft.Batch" @@ -43,7 +39,7 @@ resource "azapi_resource" "batchAccount" { poolAllocationMode = "BatchService" publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Batch_batchAccounts_applications@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.Batch_batchAccounts_applications@2022-10-01/main.tf index 8686ea85..eb811e3e 100644 --- a/dependency/azapi_examples/Microsoft.Batch_batchAccounts_applications@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Batch_batchAccounts_applications@2022-10-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,11 +73,7 @@ resource "azapi_resource" "batchAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { autoStorage = { authenticationMode = "StorageKeys" @@ -92,7 +85,7 @@ resource "azapi_resource" "batchAccount" { poolAllocationMode = "BatchService" publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -101,13 +94,13 @@ resource "azapi_resource" "application" { type = "Microsoft.Batch/batchAccounts/applications@2022-10-01" parent_id = azapi_resource.batchAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { allowUpdates = true defaultVersion = "" displayName = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Batch_batchAccounts_certificates@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.Batch_batchAccounts_certificates@2022-10-01/main.tf index bebcd078..9f5291d8 100644 --- a/dependency/azapi_examples/Microsoft.Batch_batchAccounts_certificates@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Batch_batchAccounts_certificates@2022-10-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "batchAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { encryption = { keySource = "Microsoft.Batch" @@ -43,7 +39,7 @@ resource "azapi_resource" "batchAccount" { poolAllocationMode = "BatchService" publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -52,14 +48,14 @@ resource "azapi_resource" "certificate" { type = "Microsoft.Batch/batchAccounts/certificates@2022-10-01" parent_id = azapi_resource.batchAccount.id name = "SHA1-312d31a79fa0cef49c00f769afc2b73e9f4edf34" - body = jsonencode({ + body = { properties = { data = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tDQpNSUlEYnpDQ0FsZWdBd0lCQWdJSkFJempSRDM2c0liYk1BMEdDU3FHU0liM0RRRUJDd1VBTUUweEN6QUpCZ05WDQpCQVlUQWxWVE1STXdFUVlEVlFRSURBcFRiMjFsTFZOMFlYUmxNUkl3RUFZRFZRUUtEQWwwWlhKeVlXWnZjbTB4DQpGVEFUQmdOVkJBTU1ESFJsY25KaFptOXliUzVwYnpBZ0Z3MHhOekEwTWpFeU1EQTFNamRhR0E4eU1URTNNRE15DQpPREl3TURVeU4xb3dUVEVMTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnTUNsTnZiV1V0VTNSaGRHVXhFakFRDQpCZ05WQkFvTUNYUmxjbkpoWm05eWJURVZNQk1HQTFVRUF3d01kR1Z5Y21GbWIzSnRMbWx2TUlJQklqQU5CZ2txDQpoa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTNMOUw1c3pUNCtGTHlrVEZOeXlQankvazNCUVRZQWZSDQpRelAyZGhuc3VVS20zY2RQQzBOeVord0VYSVVHaG9ETzJZRzZFWUNoT2w4ZnNEcURPamxvU1VHS3FZdysrbmxwDQpISXVVZ0p4OEl4eEcyWGtBTENqRlU3RW1GK3c3a243NmQwZXpwRUlZeG5MUCtLRzJEVm9ybm9FdDFhTGh2MU1MDQptcGdFWlpQaERiTVNMaFNZV2VUVlJNYXlYTHdxdGZnbkR1bVFTQis4ZC8xSnVKcXJTSTRwRDEySm96VlRoemI2DQpoc2pmYjZSTVg0ZXBQbXJHbjBQYlRQRUVBNmF3bXN4QkNYQjBzMTNuTlF0L08waExNMmFnd3ZBeW96aWxRVitzDQo2MTZDa2drNkRKb1VrcVpoRHk3dlBZTUlSU3I5OGZCd3M2emtyVjZ0VExqbUQ4eEF2b2JlUFFJREFRQUJvMUF3DQpUakFkQmdOVkhRNEVGZ1FVWElxTzQyMXpNTW1iY1JSWDl3Y3RaRkNRdVBJd0h3WURWUjBqQkJnd0ZvQVVYSXFPDQo0MjF6TU1tYmNSUlg5d2N0WkZDUXVQSXdEQVlEVlIwVEJBVXdBd0VCL3pBTkJna3Foa2lHOXcwQkFRc0ZBQU9DDQpBUUVBcjgyTmVUM0JZSk9LTGxVTDZPbTVMalVGNjZld2NKakc5bHRkdnlRd1ZuZU1jcTd0NVVBUHhnQ2h6cU5SDQpWazRkYThQemtYcGpCSnlXZXpIdXBkSk5YM1hxZVVrMmtTeHFRNi9nbWhxdmZJM3k3ZGpyd29PNmp2TUVZMjZXDQpxdGtUTk9SV0RQM1RISkpWaW1DM3pWK0tNVTVVQlZyRXpoT1ZoSFNVNzA5bEJQNzVvMEJCbjN4R3NQcVNxOWs4DQpJb3RJRmZ5QWM2YStYUDMrWk1wdmg3d3FBVW1sN3ZXYTV3bGNYRXhDeDM5aDFiYWxmRFNMR05DNHN3V1BDcDlBDQpNblFSMHArdk1heTloTlAxRWgrOVFZVWFpMTRkNUtTM2NGVitLeEUxY0pSNUhEL2lMbHRubk9FYnBNc0IwZVZPDQpaV2tGdkU3WTVsVzBvVlNBZmluNVR3VEpNUT09DQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0t" format = "Cer" thumbprint = "312d31a79fa0cef49c00f769afc2b73e9f4edf34" thumbprintAlgorithm = "sha1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Batch_batchAccounts_pools@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.Batch_batchAccounts_pools@2022-10-01/main.tf index c6b7af13..187a10e3 100644 --- a/dependency/azapi_examples/Microsoft.Batch_batchAccounts_pools@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Batch_batchAccounts_pools@2022-10-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "batchAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { encryption = { keySource = "Microsoft.Batch" @@ -43,7 +39,7 @@ resource "azapi_resource" "batchAccount" { poolAllocationMode = "BatchService" publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -52,11 +48,7 @@ resource "azapi_resource" "pool" { type = "Microsoft.Batch/batchAccounts/pools@2022-10-01" parent_id = azapi_resource.batchAccount.id name = var.resource_name - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { certificates = null deploymentConfiguration = { @@ -90,7 +82,7 @@ resource "azapi_resource" "pool" { taskSlotsPerNode = 1 vmSize = "STANDARD_A1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.BotService_botServices@2021-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.BotService_botServices@2021-05-01-preview/main.tf index 70f2f2a0..a5c6be60 100644 --- a/dependency/azapi_examples/Microsoft.BotService_botServices@2021-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.BotService_botServices@2021-05-01-preview/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "botService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { kind = "sdk" properties = { developerAppInsightKey = "" @@ -61,7 +61,7 @@ resource "azapi_resource" "botService" { tags = { environment = "production" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.BotService_botServices_connections@2021-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.BotService_botServices_connections@2021-05-01-preview/main.tf index fcb854a5..a736e97a 100644 --- a/dependency/azapi_examples/Microsoft.BotService_botServices_connections@2021-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.BotService_botServices_connections@2021-05-01-preview/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "botService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { kind = "bot" properties = { displayName = var.resource_name @@ -53,7 +53,7 @@ resource "azapi_resource" "botService" { sku = { name = "F0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -70,15 +70,15 @@ resource "azapi_resource" "connection" { parent_id = azapi_resource.botService.id name = var.resource_name location = "global" - body = jsonencode({ + body = { kind = "bot" properties = { - clientId = jsondecode(azapi_resource.botService.output).properties.msaAppId + clientId = azapi_resource.botService.output.properties.msaAppId clientSecret = "86546868-e7ed-429f-b0e5-3a1caea7db64" scopes = "" - serviceProviderId = jsondecode(data.azapi_resource_action.listAuthServiceProviders.output).value[36].properties.id + serviceProviderId = data.azapi_resource_action.listAuthServiceProviders.output.value[36].properties.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cache_redis@2023-04-01/main.tf b/dependency/azapi_examples/Microsoft.Cache_redis@2023-04-01/main.tf index 3dc90348..47f36f1a 100644 --- a/dependency/azapi_examples/Microsoft.Cache_redis@2023-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cache_redis@2023-04-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "redis" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { sku = { capacity = 2 @@ -41,7 +41,7 @@ resource "azapi_resource" "redis" { enableNonSslPort = true minimumTlsVersion = "1.2" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cache_redisEnterprise@2022-01-01/main.tf b/dependency/azapi_examples/Microsoft.Cache_redisEnterprise@2022-01-01/main.tf index 927af45c..5ab53b92 100644 --- a/dependency/azapi_examples/Microsoft.Cache_redisEnterprise@2022-01-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cache_redisEnterprise@2022-01-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "redisEnterprise" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { minimumTlsVersion = "1.2" } @@ -39,7 +39,7 @@ resource "azapi_resource" "redisEnterprise" { capacity = 2 name = "Enterprise_E100" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cdn_profiles@2020-09-01/main.tf b/dependency/azapi_examples/Microsoft.Cdn_profiles@2020-09-01/main.tf index 391206db..b5b0a925 100644 --- a/dependency/azapi_examples/Microsoft.Cdn_profiles@2020-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cdn_profiles@2020-09-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "profile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { sku = { name = "Standard_Verizon" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cdn_profiles@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Cdn_profiles@2021-06-01/main.tf index 597acf47..12c16809 100644 --- a/dependency/azapi_examples/Microsoft.Cdn_profiles@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cdn_profiles@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "profile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { originResponseTimeoutSeconds = 120 } sku = { name = "Premium_AzureFrontDoor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cdn_profiles_afdEndpoints@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Cdn_profiles_afdEndpoints@2021-06-01/main.tf index 528613ff..bddb40f3 100644 --- a/dependency/azapi_examples/Microsoft.Cdn_profiles_afdEndpoints@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cdn_profiles_afdEndpoints@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "profile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { originResponseTimeoutSeconds = 120 } sku = { name = "Standard_AzureFrontDoor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,11 +48,11 @@ resource "azapi_resource" "afdEndpoint" { parent_id = azapi_resource.profile.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { enabledState = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cdn_profiles_afdEndpoints_routes@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Cdn_profiles_afdEndpoints_routes@2021-06-01/main.tf index a4e7d38b..e3047b42 100644 --- a/dependency/azapi_examples/Microsoft.Cdn_profiles_afdEndpoints_routes@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cdn_profiles_afdEndpoints_routes@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "profile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { originResponseTimeoutSeconds = 120 } sku = { name = "Standard_AzureFrontDoor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,11 +48,11 @@ resource "azapi_resource" "afdEndpoint" { parent_id = azapi_resource.profile.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { enabledState = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -61,7 +61,7 @@ resource "azapi_resource" "originGroup" { type = "Microsoft.Cdn/profiles/originGroups@2021-06-01" parent_id = azapi_resource.profile.id name = var.resource_name - body = jsonencode({ + body = { properties = { loadBalancingSettings = { additionalLatencyInMilliseconds = 0 @@ -71,7 +71,7 @@ resource "azapi_resource" "originGroup" { sessionAffinityState = "Enabled" trafficRestorationTimeToHealedOrNewEndpointsInMinutes = 10 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -80,7 +80,7 @@ resource "azapi_resource" "origin" { type = "Microsoft.Cdn/profiles/originGroups/origins@2021-06-01" parent_id = azapi_resource.originGroup.id name = var.resource_name - body = jsonencode({ + body = { properties = { enabledState = "Enabled" enforceCertificateNameCheck = false @@ -91,7 +91,7 @@ resource "azapi_resource" "origin" { priority = 1 weight = 1 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,7 +100,7 @@ resource "azapi_resource" "route" { type = "Microsoft.Cdn/profiles/afdEndpoints/routes@2021-06-01" parent_id = azapi_resource.afdEndpoint.id name = var.resource_name - body = jsonencode({ + body = { properties = { enabledState = "Enabled" forwardingProtocol = "MatchRequest" @@ -117,7 +117,7 @@ resource "azapi_resource" "route" { "Http", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cdn_profiles_customDomains@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Cdn_profiles_customDomains@2021-06-01/main.tf index a9c3a2d6..7945cc36 100644 --- a/dependency/azapi_examples/Microsoft.Cdn_profiles_customDomains@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cdn_profiles_customDomains@2021-06-01/main.tf @@ -40,14 +40,14 @@ resource "azapi_resource" "profile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { originResponseTimeoutSeconds = 120 } sku = { name = "Premium_AzureFrontDoor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,7 +56,7 @@ resource "azapi_resource" "customDomain" { type = "Microsoft.Cdn/profiles/customDomains@2021-06-01" parent_id = azapi_resource.profile.id name = var.resource_name - body = jsonencode({ + body = { properties = { azureDnsZone = { id = azapi_resource.dnsZone.id @@ -67,7 +67,7 @@ resource "azapi_resource" "customDomain" { minimumTlsVersion = "TLS12" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cdn_profiles_endpoints@2020-09-01/main.tf b/dependency/azapi_examples/Microsoft.Cdn_profiles_endpoints@2020-09-01/main.tf index 12797318..a2ad57d4 100644 --- a/dependency/azapi_examples/Microsoft.Cdn_profiles_endpoints@2020-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cdn_profiles_endpoints@2020-09-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "profile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { sku = { name = "Standard_Verizon" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -45,7 +45,7 @@ resource "azapi_resource" "endpoint" { parent_id = azapi_resource.profile.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { isHttpAllowed = true isHttpsAllowed = true @@ -61,7 +61,7 @@ resource "azapi_resource" "endpoint" { ] queryStringCachingBehavior = "IgnoreQueryString" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cdn_profiles_originGroups@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Cdn_profiles_originGroups@2021-06-01/main.tf index 9904d23a..04acce03 100644 --- a/dependency/azapi_examples/Microsoft.Cdn_profiles_originGroups@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cdn_profiles_originGroups@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "profile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { originResponseTimeoutSeconds = 120 } sku = { name = "Standard_AzureFrontDoor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "originGroup" { type = "Microsoft.Cdn/profiles/originGroups@2021-06-01" parent_id = azapi_resource.profile.id name = var.resource_name - body = jsonencode({ + body = { properties = { loadBalancingSettings = { additionalLatencyInMilliseconds = 0 @@ -57,7 +57,7 @@ resource "azapi_resource" "originGroup" { sessionAffinityState = "Enabled" trafficRestorationTimeToHealedOrNewEndpointsInMinutes = 10 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cdn_profiles_originGroups_origins@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Cdn_profiles_originGroups_origins@2021-06-01/main.tf index e190b11b..2a846e9c 100644 --- a/dependency/azapi_examples/Microsoft.Cdn_profiles_originGroups_origins@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cdn_profiles_originGroups_origins@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "profile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { originResponseTimeoutSeconds = 120 } sku = { name = "Standard_AzureFrontDoor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "originGroup" { type = "Microsoft.Cdn/profiles/originGroups@2021-06-01" parent_id = azapi_resource.profile.id name = var.resource_name - body = jsonencode({ + body = { properties = { loadBalancingSettings = { additionalLatencyInMilliseconds = 0 @@ -57,7 +57,7 @@ resource "azapi_resource" "originGroup" { sessionAffinityState = "Enabled" trafficRestorationTimeToHealedOrNewEndpointsInMinutes = 10 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -66,7 +66,7 @@ resource "azapi_resource" "origin" { type = "Microsoft.Cdn/profiles/originGroups/origins@2021-06-01" parent_id = azapi_resource.originGroup.id name = var.resource_name - body = jsonencode({ + body = { properties = { enabledState = "Enabled" enforceCertificateNameCheck = false @@ -77,7 +77,7 @@ resource "azapi_resource" "origin" { priority = 1 weight = 1 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cdn_profiles_ruleSets@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Cdn_profiles_ruleSets@2021-06-01/main.tf index 5ee4dfc8..f15f550a 100644 --- a/dependency/azapi_examples/Microsoft.Cdn_profiles_ruleSets@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cdn_profiles_ruleSets@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "profile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { originResponseTimeoutSeconds = 120 } sku = { name = "Standard_AzureFrontDoor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Cdn_profiles_securityPolicies@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Cdn_profiles_securityPolicies@2021-06-01/main.tf index 709b32f1..bb528422 100644 --- a/dependency/azapi_examples/Microsoft.Cdn_profiles_securityPolicies@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Cdn_profiles_securityPolicies@2021-06-01/main.tf @@ -40,14 +40,14 @@ resource "azapi_resource" "profile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { originResponseTimeoutSeconds = 120 } sku = { name = "Premium_AzureFrontDoor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,7 +57,7 @@ resource "azapi_resource" "FrontDoorWebApplicationFirewallPolicy" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { customRules = { rules = [ @@ -120,7 +120,7 @@ resource "azapi_resource" "FrontDoorWebApplicationFirewallPolicy" { sku = { name = "Premium_AzureFrontDoor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -129,7 +129,7 @@ resource "azapi_resource" "customDomain" { type = "Microsoft.Cdn/profiles/customDomains@2021-06-01" parent_id = azapi_resource.profile.id name = var.resource_name - body = jsonencode({ + body = { properties = { azureDnsZone = { id = azapi_resource.dnsZone.id @@ -140,7 +140,7 @@ resource "azapi_resource" "customDomain" { minimumTlsVersion = "TLS12" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -149,7 +149,7 @@ resource "azapi_resource" "securityPolicy" { type = "Microsoft.Cdn/profiles/securityPolicies@2021-06-01" parent_id = azapi_resource.profile.id name = var.resource_name - body = jsonencode({ + body = { properties = { parameters = { associations = [ @@ -170,7 +170,7 @@ resource "azapi_resource" "securityPolicy" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.CertificateRegistration_certificateOrders@2021-02-01/main.tf b/dependency/azapi_examples/Microsoft.CertificateRegistration_certificateOrders@2021-02-01/main.tf index 51d4cfb5..1a45553f 100644 --- a/dependency/azapi_examples/Microsoft.CertificateRegistration_certificateOrders@2021-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.CertificateRegistration_certificateOrders@2021-02-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "certificateOrder" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { autoRenew = true distinguishedName = "CN=example.com" @@ -39,7 +39,7 @@ resource "azapi_resource" "certificateOrder" { productType = "StandardDomainValidatedSsl" validityInYears = 1 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.CognitiveServices_accounts@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.CognitiveServices_accounts@2022-10-01/main.tf index 12ba9ed7..8e86faa4 100644 --- a/dependency/azapi_examples/Microsoft.CognitiveServices_accounts@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.CognitiveServices_accounts@2022-10-01/main.tf @@ -40,14 +40,12 @@ resource "azapi_resource" "account" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned, UserAssigned" - userAssignedIdentities = { - (azapi_resource.userAssignedIdentity.id) = { - } - } - } + identity { + type = "SystemAssigned, UserAssigned" + identity_ids = [azapi_resource.userAssignedIdentity.id] + } + + body = { kind = "SpeechServices" properties = { allowedFqdnList = [ @@ -64,7 +62,7 @@ resource "azapi_resource" "account" { name = "S0" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Communication_communicationServices@2023-03-31/main.tf b/dependency/azapi_examples/Microsoft.Communication_communicationServices@2023-03-31/main.tf index 49547d45..a7797d94 100644 --- a/dependency/azapi_examples/Microsoft.Communication_communicationServices@2023-03-31/main.tf +++ b/dependency/azapi_examples/Microsoft.Communication_communicationServices@2023-03-31/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "communicationService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { dataLocation = "United States" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Communication_emailServices@2023-03-31/main.tf b/dependency/azapi_examples/Microsoft.Communication_emailServices@2023-03-31/main.tf index a55cd419..3913efeb 100644 --- a/dependency/azapi_examples/Microsoft.Communication_emailServices@2023-03-31/main.tf +++ b/dependency/azapi_examples/Microsoft.Communication_emailServices@2023-03-31/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "emailService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { dataLocation = "United States" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_availabilitySets@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.Compute_availabilitySets@2021-11-01/main.tf index e0570f41..87eb0d0d 100644 --- a/dependency/azapi_examples/Microsoft.Compute_availabilitySets@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_availabilitySets@2021-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "availabilitySet" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { platformFaultDomainCount = 3 platformUpdateDomainCount = 5 @@ -39,7 +39,7 @@ resource "azapi_resource" "availabilitySet" { sku = { name = "Aligned" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_diskAccesses@2022-03-02/main.tf b/dependency/azapi_examples/Microsoft.Compute_diskAccesses@2022-03-02/main.tf index 41652341..e08bc354 100644 --- a/dependency/azapi_examples/Microsoft.Compute_diskAccesses@2022-03-02/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_diskAccesses@2022-03-02/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "diskAccess" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { tags = { cost-center = "ops" environment = "acctest" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_diskEncryptionSets@2022-03-02/main.tf b/dependency/azapi_examples/Microsoft.Compute_diskEncryptionSets@2022-03-02/main.tf index dbe3b106..0b91dd47 100644 --- a/dependency/azapi_examples/Microsoft.Compute_diskEncryptionSets@2022-03-02/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_diskEncryptionSets@2022-03-02/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { sku = { family = "A" @@ -52,10 +52,12 @@ resource "azapi_resource" "vault" { enableSoftDelete = true tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.accessPolicies"] + lifecycle { + ignore_changes = [body.properties.accessPolicies] + } } data "azapi_resource_id" "key" { @@ -68,13 +70,13 @@ resource "azapi_resource_action" "key" { type = "Microsoft.KeyVault/vaults/keys@2023-02-01" resource_id = data.azapi_resource_id.key.id method = "PUT" - body = jsonencode({ + body = { properties = { keySize = 2048 kty = "RSA" keyOps = ["encrypt", "decrypt", "sign", "verify", "wrapKey", "unwrapKey"] } - }) + } response_export_values = ["*"] } @@ -83,14 +85,14 @@ resource "azapi_resource" "diskEncryptionSet" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { activeKey = { - keyUrl = jsondecode(azapi_resource_action.key.output).properties.keyUriWithVersion + keyUrl = azapi_resource_action.key.output.properties.keyUriWithVersion sourceVault = { id = azapi_resource.vault.id } @@ -98,7 +100,7 @@ resource "azapi_resource" "diskEncryptionSet" { encryptionType = "EncryptionAtRestWithCustomerKey" rotationToLatestKeyVersionEnabled = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_disks@2022-03-02/main.tf b/dependency/azapi_examples/Microsoft.Compute_disks@2022-03-02/main.tf index 3e936fde..a0cb5fe5 100644 --- a/dependency/azapi_examples/Microsoft.Compute_disks@2022-03-02/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_disks@2022-03-02/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "disk" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { creationData = { createOption = "Empty" @@ -47,7 +47,7 @@ resource "azapi_resource" "disk" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_galleries@2022-03-03/main.tf b/dependency/azapi_examples/Microsoft.Compute_galleries@2022-03-03/main.tf index 6b393fca..4ec538ab 100644 --- a/dependency/azapi_examples/Microsoft.Compute_galleries@2022-03-03/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_galleries@2022-03-03/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "gallery" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_galleries_applications@2022-03-03/main.tf b/dependency/azapi_examples/Microsoft.Compute_galleries_applications@2022-03-03/main.tf index b79730fb..11908d6c 100644 --- a/dependency/azapi_examples/Microsoft.Compute_galleries_applications@2022-03-03/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_galleries_applications@2022-03-03/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "gallery" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -45,12 +45,12 @@ resource "azapi_resource" "application" { parent_id = azapi_resource.gallery.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { supportedOSType = "Linux" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_galleries_images@2022-03-03/main.tf b/dependency/azapi_examples/Microsoft.Compute_galleries_images@2022-03-03/main.tf index 57395743..80e915e5 100644 --- a/dependency/azapi_examples/Microsoft.Compute_galleries_images@2022-03-03/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_galleries_images@2022-03-03/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "gallery" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -45,7 +45,7 @@ resource "azapi_resource" "image" { parent_id = azapi_resource.gallery.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { architecture = "x64" description = "" @@ -71,7 +71,7 @@ resource "azapi_resource" "image" { } releaseNoteUri = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_hostGroups@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.Compute_hostGroups@2021-11-01/main.tf index 3debfc38..9a5526a2 100644 --- a/dependency/azapi_examples/Microsoft.Compute_hostGroups@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_hostGroups@2021-11-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "hostGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { platformFaultDomainCount = 2 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_hostGroups_hosts@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.Compute_hostGroups_hosts@2021-11-01/main.tf index 92af0ccd..d1c454bb 100644 --- a/dependency/azapi_examples/Microsoft.Compute_hostGroups_hosts@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_hostGroups_hosts@2021-11-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "hostGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { platformFaultDomainCount = 2 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -45,7 +45,7 @@ resource "azapi_resource" "host" { parent_id = azapi_resource.hostGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoReplaceOnFailure = true licenseType = "None" @@ -54,7 +54,7 @@ resource "azapi_resource" "host" { sku = { name = "DSv3-Type1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_proximityPlacementGroups@2022-03-01/main.tf b/dependency/azapi_examples/Microsoft.Compute_proximityPlacementGroups@2022-03-01/main.tf index 29387f50..bc468c06 100644 --- a/dependency/azapi_examples/Microsoft.Compute_proximityPlacementGroups@2022-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_proximityPlacementGroups@2022-03-01/main.tf @@ -31,10 +31,10 @@ resource "azapi_resource" "proximityPlacementGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_sshPublicKeys@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.Compute_sshPublicKeys@2021-11-01/main.tf index d2183272..b14329e7 100644 --- a/dependency/azapi_examples/Microsoft.Compute_sshPublicKeys@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_sshPublicKeys@2021-11-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "sshPublicKey" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+wWK73dCr+jgQOAxNsHAnNNNMEMWOHYEccp6wJm2gotpr9katuF/ZAdou5AaW1C61slRkHRkpRRX9FA9CYBiitZgvCCz+3nWNN7l/Up54Zps/pHWGZLHNJZRYyAB6j5yVLMVHIHriY49d/GZTZVNB8GoJv9Gakwc/fuEZYYl4YDFiGMBP///TzlI4jhiJzjKnEvqPFki5p2ZRJqcbCiF4pJrxUQR/RXqVFQdbRLZgYfJ8xGB878RENq3yQ39d8dVOkq4edbkzwcUmwwwkYVPIoDGsYLaRHnG+To7FvMeyO7xDVQkMKzopTQV8AuKpyvpqu0a9pWOMaiCyDytO7GGN you@me.com" } tags = { test-tag = "test-value-230630032848837073" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_virtualMachineScaleSets@2023-03-01/main.tf b/dependency/azapi_examples/Microsoft.Compute_virtualMachineScaleSets@2023-03-01/main.tf index f4f4798d..a84bfc25 100644 --- a/dependency/azapi_examples/Microsoft.Compute_virtualMachineScaleSets@2023-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_virtualMachineScaleSets@2023-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "internal" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,10 +79,7 @@ resource "azapi_resource" "virtualMachineScaleSet" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { additionalCapabilities = { } @@ -188,7 +187,7 @@ resource "azapi_resource" "virtualMachineScaleSet" { name = "Standard_F2" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_virtualMachineScaleSets_extensions@2023-03-01/main.tf b/dependency/azapi_examples/Microsoft.Compute_virtualMachineScaleSets_extensions@2023-03-01/main.tf index 2b45c5f3..81180ac9 100644 --- a/dependency/azapi_examples/Microsoft.Compute_virtualMachineScaleSets_extensions@2023-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_virtualMachineScaleSets_extensions@2023-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "internal" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,10 +79,7 @@ resource "azapi_resource" "virtualMachineScaleSet" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { additionalCapabilities = { } @@ -188,7 +187,7 @@ resource "azapi_resource" "virtualMachineScaleSet" { name = "Standard_F2" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -197,7 +196,7 @@ resource "azapi_resource" "extension" { type = "Microsoft.Compute/virtualMachineScaleSets/extensions@2023-03-01" parent_id = azapi_resource.virtualMachineScaleSet.id name = var.resource_name - body = jsonencode({ + body = { properties = { autoUpgradeMinorVersion = true enableAutomaticUpgrade = false @@ -211,7 +210,7 @@ resource "azapi_resource" "extension" { type = "CustomScript" typeHandlerVersion = "2.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/attach_data_disk/main.tf b/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/attach_data_disk/main.tf new file mode 100644 index 00000000..d1c7b400 --- /dev/null +++ b/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/attach_data_disk/main.tf @@ -0,0 +1,204 @@ +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" +} + +locals { + os_disk_name = "myosdisk1" + data_disk_name = "mydatadisk1" + attached_data_disk_name = "myattacheddatadisk1" +} + +resource "azapi_resource" "resourceGroup" { + type = "Microsoft.Resources/resourceGroups@2020-06-01" + name = var.resource_name + location = var.location +} + +resource "azapi_resource" "virtualNetwork" { + type = "Microsoft.Network/virtualNetworks@2022-07-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + addressSpace = { + addressPrefixes = [ + "10.0.0.0/16", + ] + } + dhcpOptions = { + dnsServers = [ + ] + } + subnets = [ + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] + lifecycle { + ignore_changes = [body.properties.subnets] + } +} + +resource "azapi_resource" "subnet" { + type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" + parent_id = azapi_resource.virtualNetwork.id + name = var.resource_name + body = { + properties = { + addressPrefix = "10.0.2.0/24" + delegations = [ + ] + privateEndpointNetworkPolicies = "Enabled" + privateLinkServiceNetworkPolicies = "Enabled" + serviceEndpointPolicies = [ + ] + serviceEndpoints = [ + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "networkInterface" { + type = "Microsoft.Network/networkInterfaces@2022-07-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + enableAcceleratedNetworking = false + enableIPForwarding = false + ipConfigurations = [ + { + name = "testconfiguration1" + properties = { + primary = true + privateIPAddressVersion = "IPv4" + privateIPAllocationMethod = "Dynamic" + subnet = { + id = azapi_resource.subnet.id + } + } + }, + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "attachedDisk" { + type = "Microsoft.Compute/disks@2022-03-02" + parent_id = azapi_resource.resourceGroup.id + name = local.attached_data_disk_name + location = var.location + body = { + properties = { + creationData = { + createOption = "Empty" + } + diskSizeGB = 1 + encryption = { + type = "EncryptionAtRestWithPlatformKey" + } + networkAccessPolicy = "AllowAll" + osType = "Linux" + publicNetworkAccess = "Enabled" + } + sku = { + name = "Standard_LRS" + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "virtualMachine" { + type = "Microsoft.Compute/virtualMachines@2023-03-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + hardwareProfile = { + vmSize = "Standard_F2" + } + networkProfile = { + networkInterfaces = [ + { + id = azapi_resource.networkInterface.id + properties = { + primary = false + } + }, + ] + } + osProfile = { + adminPassword = "Password1234!" + adminUsername = "testadmin" + computerName = "hostname230630032848831819" + linuxConfiguration = { + disablePasswordAuthentication = false + } + } + storageProfile = { + imageReference = { + offer = "UbuntuServer" + publisher = "Canonical" + sku = "16.04-LTS" + version = "latest" + } + osDisk = { + caching = "ReadWrite" + createOption = "FromImage" + name = local.os_disk_name + writeAcceleratorEnabled = false + } + dataDisks = [ + { + caching = "ReadWrite" + createOption = "Empty" + name = local.data_disk_name + diskSizeGB = 1 + lun = 1 + managedDisk = { + storageAccountType = "Standard_LRS" + } + }, + { + caching = "ReadWrite" + createOption = "Attach" + name = azapi_resource.attachedDisk.name + lun = 2 + managedDisk = { + id = azapi_resource.attachedDisk.id + } + } + ] + } + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} diff --git a/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/attach_os_disk/main.tf b/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/attach_os_disk/main.tf new file mode 100644 index 00000000..416bcb9d --- /dev/null +++ b/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/attach_os_disk/main.tf @@ -0,0 +1,305 @@ +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" +} + +variable "attached_resource_name" { + type = string + default = "acctest0002" +} + +locals { + os_disk_name = "myosdisk1" + attached_os_disk_name = "myosdisk2" +} + +resource "azapi_resource" "resourceGroup" { + type = "Microsoft.Resources/resourceGroups@2020-06-01" + name = var.resource_name + location = var.location +} + +resource "azapi_resource" "virtualNetwork" { + type = "Microsoft.Network/virtualNetworks@2022-07-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + addressSpace = { + addressPrefixes = [ + "10.0.0.0/16", + ] + } + dhcpOptions = { + dnsServers = [ + ] + } + subnets = [ + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] + lifecycle { + ignore_changes = [body.properties.subnets] + } +} + +resource "azapi_resource" "subnet" { + type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" + parent_id = azapi_resource.virtualNetwork.id + name = var.resource_name + body = { + properties = { + addressPrefix = "10.0.2.0/24" + delegations = [ + ] + privateEndpointNetworkPolicies = "Enabled" + privateLinkServiceNetworkPolicies = "Enabled" + serviceEndpointPolicies = [ + ] + serviceEndpoints = [ + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "networkInterface" { + type = "Microsoft.Network/networkInterfaces@2022-07-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + enableAcceleratedNetworking = false + enableIPForwarding = false + ipConfigurations = [ + { + name = "testconfiguration1" + properties = { + primary = true + privateIPAddressVersion = "IPv4" + privateIPAllocationMethod = "Dynamic" + subnet = { + id = azapi_resource.subnet.id + } + } + }, + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + + +resource "azapi_resource" "virtualMachine" { + type = "Microsoft.Compute/virtualMachines@2023-03-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + hardwareProfile = { + vmSize = "Standard_F2" + } + networkProfile = { + networkInterfaces = [ + { + id = azapi_resource.networkInterface.id + properties = { + primary = false + } + }, + ] + } + osProfile = { + adminPassword = "Password1234!" + adminUsername = "testadmin" + computerName = "hostname230630032848831819" + linuxConfiguration = { + disablePasswordAuthentication = false + } + } + storageProfile = { + imageReference = { + offer = "UbuntuServer" + publisher = "Canonical" + sku = "16.04-LTS" + version = "latest" + } + osDisk = { + caching = "ReadWrite" + createOption = "FromImage" + name = local.os_disk_name + writeAcceleratorEnabled = false + } + } + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +data "azapi_resource" "managedDisk" { + type = "Microsoft.Compute/disks@2023-10-02" + parent_id = azapi_resource.resourceGroup.id + name = local.os_disk_name + + depends_on = [azapi_resource.virtualMachine] +} + +resource "azapi_resource" "snapshot" { + type = "Microsoft.Compute/snapshots@2023-10-02" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + sku = { + name = "Standard_ZRS" + } + properties = { + creationData = { + createOption = "Copy" + sourceResourceId = data.azapi_resource.managedDisk.id + } + diskSizeGB = 30 + encryption = { + type = "EncryptionAtRestWithPlatformKey" + } + networkAccessPolicy = "AllowAll" + osType = "Linux" + hyperVGeneration = "V1" + incremental = true + publicNetworkAccess = "Enabled" + supportedCapabilities = { + architecture = "x64" + } + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "attachedManagedDisk" { + type = "Microsoft.Compute/disks@2023-10-02" + parent_id = azapi_resource.resourceGroup.id + name = local.attached_os_disk_name + location = var.location + body = { + properties = { + creationData = { + createOption = "Copy", + sourceResourceId = azapi_resource.snapshot.id + } + + diskSizeGB = 30 + encryption = { + type = "EncryptionAtRestWithPlatformKey" + } + networkAccessPolicy = "AllowAll" + osType = "Linux" + hyperVGeneration = "V1" + publicNetworkAccess = "Enabled" + supportedCapabilities = { + architecture = "x64" + } + } + sku = { + name = "Standard_LRS" + } + zones = [ + "1" + ] + } + + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "attachedNetworkInterface" { + type = "Microsoft.Network/networkInterfaces@2022-07-01" + parent_id = azapi_resource.resourceGroup.id + name = var.attached_resource_name + location = var.location + body = { + properties = { + enableAcceleratedNetworking = false + enableIPForwarding = false + ipConfigurations = [ + { + name = "testconfiguration2" + properties = { + primary = true + privateIPAddressVersion = "IPv4" + privateIPAllocationMethod = "Dynamic" + subnet = { + id = azapi_resource.subnet.id + } + } + } + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "attachedVirtualMachine" { + type = "Microsoft.Compute/virtualMachines@2023-03-01" + parent_id = azapi_resource.resourceGroup.id + name = var.attached_resource_name + location = var.location + body = { + properties = { + hardwareProfile = { + vmSize = "Standard_F2" + } + networkProfile = { + networkInterfaces = [ + { + id = azapi_resource.attachedNetworkInterface.id + properties = { + primary = false + } + }, + ] + } + storageProfile = { + osDisk = { + caching = "ReadWrite" + createOption = "Attach" + name = local.attached_os_disk_name + osType = "Linux", + writeAcceleratorEnabled = false + managedDisk = { + id = azapi_resource.attachedManagedDisk.id + } + } + } + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + diff --git a/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/main.tf b/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/basic/main.tf similarity index 90% rename from dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/main.tf rename to dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/basic/main.tf index 16469bf2..089682db 100644 --- a/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/basic/main.tf @@ -21,9 +21,9 @@ variable "location" { } resource "azapi_resource" "resourceGroup" { - type = "Microsoft.Resources/resourceGroups@2020-06-01" - name = var.resource_name - location = var.location + type = "Microsoft.Resources/resourceGroups@2020-06-01" + name = var.resource_name + location = var.location } resource "azapi_resource" "virtualNetwork" { @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,7 +79,7 @@ resource "azapi_resource" "networkInterface" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enableAcceleratedNetworking = false enableIPForwarding = false @@ -95,7 +97,7 @@ resource "azapi_resource" "networkInterface" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -105,7 +107,7 @@ resource "azapi_resource" "virtualMachine" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { hardwareProfile = { vmSize = "Standard_F2" @@ -143,7 +145,7 @@ resource "azapi_resource" "virtualMachine" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/tag_os_disk/main.tf b/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/tag_os_disk/main.tf new file mode 100644 index 00000000..a03061f8 --- /dev/null +++ b/dependency/azapi_examples/Microsoft.Compute_virtualMachines@2023-03-01/tag_os_disk/main.tf @@ -0,0 +1,181 @@ +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" +} + +locals { + os_disk_name = "myosdisk1" + + tags = { + environment = "accTest0001" + } +} + +resource "azapi_resource" "resourceGroup" { + type = "Microsoft.Resources/resourceGroups@2020-06-01" + name = var.resource_name + location = var.location +} + +resource "azapi_resource" "virtualNetwork" { + type = "Microsoft.Network/virtualNetworks@2022-07-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + addressSpace = { + addressPrefixes = [ + "10.0.0.0/16", + ] + } + dhcpOptions = { + dnsServers = [ + ] + } + subnets = [ + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] + lifecycle { + ignore_changes = [body.properties.subnets] + } +} + +resource "azapi_resource" "subnet" { + type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" + parent_id = azapi_resource.virtualNetwork.id + name = var.resource_name + body = { + properties = { + addressPrefix = "10.0.2.0/24" + delegations = [ + ] + privateEndpointNetworkPolicies = "Enabled" + privateLinkServiceNetworkPolicies = "Enabled" + serviceEndpointPolicies = [ + ] + serviceEndpoints = [ + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "networkInterface" { + type = "Microsoft.Network/networkInterfaces@2022-07-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + enableAcceleratedNetworking = false + enableIPForwarding = false + ipConfigurations = [ + { + name = "testconfiguration1" + properties = { + primary = true + privateIPAddressVersion = "IPv4" + privateIPAllocationMethod = "Dynamic" + subnet = { + id = azapi_resource.subnet.id + } + } + }, + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + + +resource "azapi_resource" "virtualMachine" { + type = "Microsoft.Compute/virtualMachines@2023-03-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + properties = { + hardwareProfile = { + vmSize = "Standard_F2" + } + networkProfile = { + networkInterfaces = [ + { + id = azapi_resource.networkInterface.id + properties = { + primary = false + } + }, + ] + } + osProfile = { + adminPassword = "Password1234!" + adminUsername = "testadmin" + computerName = "hostname230630032848831819" + linuxConfiguration = { + disablePasswordAuthentication = false + } + } + storageProfile = { + imageReference = { + offer = "UbuntuServer" + publisher = "Canonical" + sku = "16.04-LTS" + version = "latest" + } + osDisk = { + caching = "ReadWrite" + createOption = "FromImage" + name = local.os_disk_name + writeAcceleratorEnabled = false + } + } + } + tags = local.tags + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +data "azapi_resource" "managedDisk" { + type = "Microsoft.Compute/disks@2022-03-02" + parent_id = azapi_resource.resourceGroup.id + name = local.os_disk_name + + depends_on = [azapi_resource.virtualMachine] +} + +resource "azapi_resource_action" "updateTags" { + type = "Microsoft.Compute/disks@2022-03-02" + resource_id = data.azapi_resource.managedDisk.id + method = "PATCH" + + body = { + tags = local.tags + } + + depends_on = [azapi_resource.virtualMachine] +} \ No newline at end of file diff --git a/dependency/azapi_examples/Microsoft.Compute_virtualMachines_extensions@2023-03-01/main.tf b/dependency/azapi_examples/Microsoft.Compute_virtualMachines_extensions@2023-03-01/main.tf index 6f6bde17..f83426af 100644 --- a/dependency/azapi_examples/Microsoft.Compute_virtualMachines_extensions@2023-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Compute_virtualMachines_extensions@2023-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,7 +79,7 @@ resource "azapi_resource" "networkInterface" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enableAcceleratedNetworking = false enableIPForwarding = false @@ -95,7 +97,7 @@ resource "azapi_resource" "networkInterface" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -105,7 +107,7 @@ resource "azapi_resource" "virtualMachine" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { hardwareProfile = { vmSize = "Standard_F2" @@ -143,7 +145,7 @@ resource "azapi_resource" "virtualMachine" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -153,7 +155,7 @@ resource "azapi_resource" "extension" { parent_id = azapi_resource.virtualMachine.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoUpgradeMinorVersion = false enableAutomaticUpgrade = false @@ -168,7 +170,7 @@ resource "azapi_resource" "extension" { tags = { environment = "Production" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ConfidentialLedger_ledgers@2022-05-13/main.tf b/dependency/azapi_examples/Microsoft.ConfidentialLedger_ledgers@2022-05-13/main.tf index 391b124c..71f8f3a1 100644 --- a/dependency/azapi_examples/Microsoft.ConfidentialLedger_ledgers@2022-05-13/main.tf +++ b/dependency/azapi_examples/Microsoft.ConfidentialLedger_ledgers@2022-05-13/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "ledger" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { aadBasedSecurityPrincipals = [ { @@ -59,7 +59,7 @@ resource "azapi_resource" "ledger" { ] ledgerType = "Private" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ContainerInstance_containerGroups@2023-05-01/main.tf b/dependency/azapi_examples/Microsoft.ContainerInstance_containerGroups@2023-05-01/main.tf index bde006a5..17c15833 100644 --- a/dependency/azapi_examples/Microsoft.ContainerInstance_containerGroups@2023-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ContainerInstance_containerGroups@2023-05-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "containerGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { containers = [ { @@ -83,7 +79,7 @@ resource "azapi_resource" "containerGroup" { } zones = [ ] - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries@2021-08-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries@2021-08-01-preview/main.tf index e1b376c9..09e5ae7e 100644 --- a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries@2021-08-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries@2021-08-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "registry" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { adminUserEnabled = false anonymousPullEnabled = false @@ -65,7 +61,7 @@ resource "azapi_resource" "registry" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_agentPools@2019-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_agentPools@2019-06-01-preview/main.tf index 4b84bb07..874ab209 100644 --- a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_agentPools@2019-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_agentPools@2019-06-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "registry" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { adminUserEnabled = false anonymousPullEnabled = false @@ -65,7 +61,7 @@ resource "azapi_resource" "registry" { name = "Premium" tier = "Premium" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -75,13 +71,13 @@ resource "azapi_resource" "agentPool" { parent_id = azapi_resource.registry.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { count = 1 os = "Linux" tier = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_scopeMaps@2021-08-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_scopeMaps@2021-08-01-preview/main.tf index 84e852d4..65a65d38 100644 --- a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_scopeMaps@2021-08-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_scopeMaps@2021-08-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "registry" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { adminUserEnabled = false anonymousPullEnabled = false @@ -65,7 +61,7 @@ resource "azapi_resource" "registry" { name = "Premium" tier = "Premium" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -74,14 +70,14 @@ resource "azapi_resource" "scopeMap" { type = "Microsoft.ContainerRegistry/registries/scopeMaps@2021-08-01-preview" parent_id = azapi_resource.registry.id name = var.resource_name - body = jsonencode({ + body = { properties = { actions = [ "repositories/testrepo/content/read", ] description = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_tasks@2019-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_tasks@2019-06-01-preview/main.tf index 0df742e6..187d3424 100644 --- a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_tasks@2019-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_tasks@2019-06-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "registry" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { adminUserEnabled = false anonymousPullEnabled = false @@ -65,7 +61,7 @@ resource "azapi_resource" "registry" { name = "Basic" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -75,11 +71,7 @@ resource "azapi_resource" "task" { parent_id = azapi_resource.registry.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { isSystemTask = true status = "Enabled" @@ -87,7 +79,7 @@ resource "azapi_resource" "task" { timeout = 3600 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_tokens@2021-08-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_tokens@2021-08-01-preview/main.tf index d2e0147b..68413e64 100644 --- a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_tokens@2021-08-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_tokens@2021-08-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "registry" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { adminUserEnabled = true anonymousPullEnabled = false @@ -65,7 +61,7 @@ resource "azapi_resource" "registry" { name = "Premium" tier = "Premium" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -80,12 +76,12 @@ resource "azapi_resource" "token" { type = "Microsoft.ContainerRegistry/registries/tokens@2021-08-01-preview" parent_id = azapi_resource.registry.id name = var.resource_name - body = jsonencode({ + body = { properties = { scopeMapId = data.azapi_resource_id.scopeMap.id status = "enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_webHooks@2021-08-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_webHooks@2021-08-01-preview/main.tf index ef7acd1d..b58955d2 100644 --- a/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_webHooks@2021-08-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ContainerRegistry_registries_webHooks@2021-08-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "registry" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { adminUserEnabled = false anonymousPullEnabled = false @@ -65,7 +61,7 @@ resource "azapi_resource" "registry" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -75,7 +71,7 @@ resource "azapi_resource" "webHook" { parent_id = azapi_resource.registry.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { actions = [ "push", @@ -86,7 +82,7 @@ resource "azapi_resource" "webHook" { serviceUri = "https://mywebhookreceiver.example/mytag" status = "enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ContainerService_managedClusters@2023-04-02-preview/main.tf b/dependency/azapi_examples/Microsoft.ContainerService_managedClusters@2023-04-02-preview/main.tf index f838b499..de922246 100644 --- a/dependency/azapi_examples/Microsoft.ContainerService_managedClusters@2023-04-02-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ContainerService_managedClusters@2023-04-02-preview/main.tf @@ -33,11 +33,11 @@ resource "azapi_resource" "managedCluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { agentPoolProfiles = [ { @@ -49,7 +49,7 @@ resource "azapi_resource" "managedCluster" { ] dnsPrefix = var.resource_name } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ContainerService_managedClusters_agentPools@2023-04-02-preview/main.tf b/dependency/azapi_examples/Microsoft.ContainerService_managedClusters_agentPools@2023-04-02-preview/main.tf index 1bd24228..22b67b53 100644 --- a/dependency/azapi_examples/Microsoft.ContainerService_managedClusters_agentPools@2023-04-02-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ContainerService_managedClusters_agentPools@2023-04-02-preview/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "managedCluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { agentPoolProfiles = [ { @@ -47,23 +47,25 @@ resource "azapi_resource" "managedCluster" { ] dnsPrefix = var.resource_name } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.agentPoolProfiles"] + lifecycle { + ignore_changes = [body.properties.agentPoolProfiles] + } } resource "azapi_resource" "agentPool" { type = "Microsoft.ContainerService/managedClusters/agentPools@2023-04-02-preview" parent_id = azapi_resource.managedCluster.id name = "internal" - body = jsonencode({ + body = { properties = { count = 1 mode = "User" vmSize = "Standard_DS2_v2" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.CostManagement_scheduledActions@2022-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.CostManagement_scheduledActions@2022-06-01-preview/main.tf index dd5134e3..50685657 100644 --- a/dependency/azapi_examples/Microsoft.CostManagement_scheduledActions@2022-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.CostManagement_scheduledActions@2022-06-01-preview/main.tf @@ -35,7 +35,7 @@ resource "azapi_resource" "view" { type = "Microsoft.CostManagement/views@2022-10-01" parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" name = var.resource_name - body = jsonencode({ + body = { properties = { accumulated = "False" chart = "StackedColumn" @@ -90,7 +90,7 @@ resource "azapi_resource" "view" { type = "Usage" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,7 +99,7 @@ resource "azapi_resource" "scheduledAction" { type = "Microsoft.CostManagement/scheduledActions@2022-06-01-preview" parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" name = var.resource_name - body = jsonencode({ + body = { kind = "InsightAlert" properties = { displayName = "acctest 230630032939736168" @@ -123,7 +123,7 @@ resource "azapi_resource" "scheduledAction" { status = "Enabled" viewId = azapi_resource.view.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.CostManagement_scheduledActions@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.CostManagement_scheduledActions@2022-10-01/main.tf index 31529f89..d117fac4 100644 --- a/dependency/azapi_examples/Microsoft.CostManagement_scheduledActions@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.CostManagement_scheduledActions@2022-10-01/main.tf @@ -47,7 +47,7 @@ resource "azapi_resource" "scheduledAction" { type = "Microsoft.CostManagement/scheduledActions@2022-10-01" parent_id = data.azapi_resource.subscription.id name = var.resource_name - body = jsonencode({ + body = { kind = "Email" properties = { displayName = "CostByServiceViewerz3k" @@ -76,7 +76,7 @@ resource "azapi_resource" "scheduledAction" { status = "Enabled" viewId = data.azapi_resource_id.view.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.CostManagement_views@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.CostManagement_views@2022-10-01/main.tf index 2a8e7d0f..8bee068e 100644 --- a/dependency/azapi_examples/Microsoft.CostManagement_views@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.CostManagement_views@2022-10-01/main.tf @@ -35,7 +35,7 @@ resource "azapi_resource" "view" { type = "Microsoft.CostManagement/views@2022-10-01" parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" name = var.resource_name - body = jsonencode({ + body = { properties = { accumulated = "False" chart = "StackedColumn" @@ -90,7 +90,7 @@ resource "azapi_resource" "view" { type = "Usage" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.CustomProviders_resourceProviders@2018-09-01-preview/main.tf b/dependency/azapi_examples/Microsoft.CustomProviders_resourceProviders@2018-09-01-preview/main.tf index 2dd6074f..9b0d45c8 100644 --- a/dependency/azapi_examples/Microsoft.CustomProviders_resourceProviders@2018-09-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.CustomProviders_resourceProviders@2018-09-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "resourceProvider" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { resourceTypes = [ { @@ -41,7 +41,7 @@ resource "azapi_resource" "resourceProvider" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMariaDB_servers@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMariaDB_servers@2018-06-01/main.tf index 12861521..678c21ec 100644 --- a/dependency/azapi_examples/Microsoft.DBforMariaDB_servers@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMariaDB_servers@2018-06-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -52,7 +52,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_configurations@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_configurations@2018-06-01/main.tf index f72d2688..3da1797e 100644 --- a/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_configurations@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_configurations@2018-06-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -52,7 +52,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -61,11 +61,11 @@ resource "azapi_update_resource" "configuration" { type = "Microsoft.DBforMariaDB/servers/configurations@2018-06-01" parent_id = azapi_resource.server.id name = "character_set_server" - body = jsonencode({ + body = { properties = { value = "LATIN1" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_databases@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_databases@2018-06-01/main.tf index 3528147d..8227918f 100644 --- a/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_databases@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_databases@2018-06-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -52,7 +52,7 @@ resource "azapi_resource" "server" { name = "B_Gen5_2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -61,12 +61,12 @@ resource "azapi_resource" "database" { type = "Microsoft.DBforMariaDB/servers/databases@2018-06-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { charset = "utf8" collation = "utf8_general_ci" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_firewallRules@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_firewallRules@2018-06-01/main.tf index 979f7265..6083e3a9 100644 --- a/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_firewallRules@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_firewallRules@2018-06-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -52,7 +52,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -61,12 +61,12 @@ resource "azapi_resource" "firewallRule" { type = "Microsoft.DBforMariaDB/servers/firewallRules@2018-06-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { endIpAddress = "255.255.255.255" startIpAddress = "0.0.0.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_virtualNetworkRules@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_virtualNetworkRules@2018-06-01/main.tf index 4e3be51c..988352f3 100644 --- a/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_virtualNetworkRules@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMariaDB_servers_virtualNetworkRules@2018-06-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "server" { @@ -56,7 +58,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -77,7 +79,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -86,7 +88,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.7.29.0/29" delegations = [ @@ -101,7 +103,7 @@ resource "azapi_resource" "subnet" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -110,12 +112,12 @@ resource "azapi_resource" "virtualNetworkRule" { type = "Microsoft.DBforMariaDB/servers/virtualNetworkRules@2018-06-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { ignoreMissingVnetServiceEndpoint = false virtualNetworkSubnetId = azapi_resource.subnet.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers@2021-05-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers@2021-05-01/main.tf index 821e7534..c6563c4c 100644 --- a/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers@2021-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers@2021-05-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "flexibleServer" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { administratorLogin = "adminTerraform" administratorLoginPassword = "QAZwsx123" @@ -56,7 +53,7 @@ resource "azapi_resource" "flexibleServer" { name = "Standard_B1s" tier = "Burstable" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers_databases@2021-05-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers_databases@2021-05-01/main.tf index 82f8ddb5..7e085b63 100644 --- a/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers_databases@2021-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers_databases@2021-05-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "flexibleServer" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { administratorLogin = "adminTerraform" administratorLoginPassword = "QAZwsx123" @@ -57,7 +54,7 @@ resource "azapi_resource" "flexibleServer" { name = "Standard_B1s" tier = "Burstable" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -66,12 +63,12 @@ resource "azapi_resource" "database" { type = "Microsoft.DBforMySQL/flexibleServers/databases@2021-05-01" parent_id = azapi_resource.flexibleServer.id name = var.resource_name - body = jsonencode({ + body = { properties = { charset = "utf8" collation = "utf8_unicode_ci" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers_firewallRules@2021-05-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers_firewallRules@2021-05-01/main.tf index 1b2f8201..363d926f 100644 --- a/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers_firewallRules@2021-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMySQL_flexibleServers_firewallRules@2021-05-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "flexibleServer" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { administratorLogin = "adminTerraform" administratorLoginPassword = "QAZwsx123" @@ -57,7 +54,7 @@ resource "azapi_resource" "flexibleServer" { name = "Standard_B1s" tier = "Burstable" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -66,12 +63,12 @@ resource "azapi_resource" "firewallRule" { type = "Microsoft.DBforMySQL/flexibleServers/firewallRules@2021-05-01" parent_id = azapi_resource.flexibleServer.id name = var.resource_name - body = jsonencode({ + body = { properties = { endIpAddress = "255.255.255.255" startIpAddress = "0.0.0.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMySQL_servers@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMySQL_servers@2017-12-01/main.tf index 81549436..06567816 100644 --- a/dependency/azapi_examples/Microsoft.DBforMySQL_servers@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMySQL_servers@2017-12-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -52,7 +52,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMySQL_servers_administrators@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMySQL_servers_administrators@2017-12-01/main.tf index e0163645..7961a4a4 100644 --- a/dependency/azapi_examples/Microsoft.DBforMySQL_servers_administrators@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMySQL_servers_administrators@2017-12-01/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -64,7 +64,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -73,14 +73,14 @@ resource "azapi_resource" "administrator" { type = "Microsoft.DBforMySQL/servers/administrators@2017-12-01" parent_id = azapi_resource.server.id name = "activeDirectory" - body = jsonencode({ + body = { properties = { administratorType = "ActiveDirectory" login = "sqladmin" sid = data.azurerm_client_config.current.client_id tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMySQL_servers_configurations@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMySQL_servers_configurations@2017-12-01/main.tf index 10f82439..404b6632 100644 --- a/dependency/azapi_examples/Microsoft.DBforMySQL_servers_configurations@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMySQL_servers_configurations@2017-12-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -53,7 +53,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -62,11 +62,11 @@ resource "azapi_update_resource" "configuration" { type = "Microsoft.DBforMySQL/servers/configurations@2017-12-01" parent_id = azapi_resource.server.id name = "character_set_server" - body = jsonencode({ + body = { properties = { value = "latin1" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMySQL_servers_databases@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMySQL_servers_databases@2017-12-01/main.tf index f1997949..ae106658 100644 --- a/dependency/azapi_examples/Microsoft.DBforMySQL_servers_databases@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMySQL_servers_databases@2017-12-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -52,7 +52,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -61,12 +61,12 @@ resource "azapi_resource" "database" { type = "Microsoft.DBforMySQL/servers/databases@2017-12-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { charset = "utf8" collation = "utf8_unicode_ci" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMySQL_servers_firewallRules@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMySQL_servers_firewallRules@2017-12-01/main.tf index 4aca5c3c..bf8c6ca0 100644 --- a/dependency/azapi_examples/Microsoft.DBforMySQL_servers_firewallRules@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMySQL_servers_firewallRules@2017-12-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -53,7 +53,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -62,12 +62,12 @@ resource "azapi_resource" "firewallRule" { type = "Microsoft.DBforMySQL/servers/firewallRules@2017-12-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { endIpAddress = "255.255.255.255" startIpAddress = "0.0.0.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforMySQL_servers_virtualNetworkRules@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforMySQL_servers_virtualNetworkRules@2017-12-01/main.tf index 8737e738..a9776c75 100644 --- a/dependency/azapi_examples/Microsoft.DBforMySQL_servers_virtualNetworkRules@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforMySQL_servers_virtualNetworkRules@2017-12-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "server" { @@ -56,7 +58,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -78,7 +80,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -87,7 +89,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.7.29.0/29" delegations = [ @@ -102,7 +104,7 @@ resource "azapi_resource" "subnet" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -111,12 +113,12 @@ resource "azapi_resource" "virtualNetworkRule" { type = "Microsoft.DBforMySQL/servers/virtualNetworkRules@2017-12-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { ignoreMissingVnetServiceEndpoint = false virtualNetworkSubnetId = azapi_resource.subnet.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_administrators@2022-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_administrators@2022-12-01/main.tf index b449b1c0..cb7a6a1e 100644 --- a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_administrators@2022-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_administrators@2022-12-01/main.tf @@ -42,11 +42,7 @@ resource "azapi_resource" "flexibleServer" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { administratorLogin = "adminTerraform" administratorLoginPassword = "QAZwsx123" @@ -73,7 +69,7 @@ resource "azapi_resource" "flexibleServer" { name = "Standard_D2s_v3" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -82,12 +78,12 @@ resource "azapi_resource" "administrator" { type = "Microsoft.DBforPostgreSQL/flexibleServers/administrators@2022-12-01" parent_id = azapi_resource.flexibleServer.id name = data.azurerm_client_config.current.object_id - body = jsonencode({ + body = { properties = { principalType = "ServicePrincipal" tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_databases@2022-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_databases@2022-12-01/main.tf index 87b708ce..bb4913a9 100644 --- a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_databases@2022-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_databases@2022-12-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "flexibleServer" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { administratorLogin = "adminTerraform" administratorLoginPassword = "QAZwsx123" @@ -57,7 +53,7 @@ resource "azapi_resource" "flexibleServer" { name = "Standard_D2s_v3" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -66,12 +62,12 @@ resource "azapi_resource" "database" { type = "Microsoft.DBforPostgreSQL/flexibleServers/databases@2022-12-01" parent_id = azapi_resource.flexibleServer.id name = var.resource_name - body = jsonencode({ + body = { properties = { charset = "UTF8" collation = "en_US.UTF8" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_firewallRules@2022-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_firewallRules@2022-12-01/main.tf index cc715565..5b09625a 100644 --- a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_firewallRules@2022-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_flexibleServers_firewallRules@2022-12-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "flexibleServer" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { administratorLogin = "adminTerraform" administratorLoginPassword = "QAZwsx123" @@ -57,7 +53,7 @@ resource "azapi_resource" "flexibleServer" { name = "Standard_D2s_v3" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -66,12 +62,12 @@ resource "azapi_resource" "firewallRule" { type = "Microsoft.DBforPostgreSQL/flexibleServers/firewallRules@2022-12-01" parent_id = azapi_resource.flexibleServer.id name = var.resource_name - body = jsonencode({ + body = { properties = { endIpAddress = "122.122.0.0" startIpAddress = "122.122.0.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_serverGroupsv2@2022-11-08/main.tf b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_serverGroupsv2@2022-11-08/main.tf index 4683cb9b..20f72f77 100644 --- a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_serverGroupsv2@2022-11-08/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_serverGroupsv2@2022-11-08/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "serverGroupsv2" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLoginPassword = "H@Sh1CoR3!" coordinatorEnablePublicIpAccess = true @@ -43,7 +43,7 @@ resource "azapi_resource" "serverGroupsv2" { nodeEnablePublicIpAccess = false nodeServerEdition = "MemoryOptimized" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers@2017-12-01/main.tf index 8bed7d3c..ca164504 100644 --- a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers@2017-12-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -56,7 +53,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_administrators@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_administrators@2017-12-01/main.tf index 7554edae..5f410eef 100644 --- a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_administrators@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_administrators@2017-12-01/main.tf @@ -42,10 +42,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -67,7 +64,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,14 +73,14 @@ resource "azapi_resource" "administrator" { type = "Microsoft.DBforPostgreSQL/servers/administrators@2017-12-01" parent_id = azapi_resource.server.id name = "activeDirectory" - body = jsonencode({ + body = { properties = { administratorType = "ActiveDirectory" login = "sqladmin" sid = data.azurerm_client_config.current.client_id tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_configurations@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_configurations@2017-12-01/main.tf index b52f17e2..b2c57956 100644 --- a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_configurations@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_configurations@2017-12-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -56,7 +53,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -65,12 +62,14 @@ resource "azapi_update_resource" "configuration" { type = "Microsoft.DBforPostgreSQL/servers/configurations@2017-12-01" parent_id = azapi_resource.server.id name = "backslash_quote" - body = jsonencode({ + body = { properties = { value = "on" } - }) - ignore_body_changes = ["properties.value"] + } response_export_values = ["*"] + lifecycle { + ignore_changes = [body.properties.value] + } } diff --git a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_databases@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_databases@2017-12-01/main.tf index 2f54e990..a2822cd9 100644 --- a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_databases@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_databases@2017-12-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -56,7 +53,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -65,12 +62,12 @@ resource "azapi_resource" "database" { type = "Microsoft.DBforPostgreSQL/servers/databases@2017-12-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { charset = "UTF8" collation = "English_United States.1252" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_firewallRules@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_firewallRules@2017-12-01/main.tf index 950d8fe0..ae124cd3 100644 --- a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_firewallRules@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_firewallRules@2017-12-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -56,7 +53,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -65,12 +62,12 @@ resource "azapi_resource" "firewallRule" { type = "Microsoft.DBforPostgreSQL/servers/firewallRules@2017-12-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { endIpAddress = "255.255.255.255" startIpAddress = "0.0.0.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_virtualNetworkRules@2017-12-01/main.tf b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_virtualNetworkRules@2017-12-01/main.tf index e7789fa6..b8fcc352 100644 --- a/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_virtualNetworkRules@2017-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DBforPostgreSQL_servers_virtualNetworkRules@2017-12-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "server" { @@ -56,10 +58,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { administratorLogin = "acctestun" administratorLoginPassword = "H@Sh1CoR3!" @@ -81,7 +80,7 @@ resource "azapi_resource" "server" { name = "GP_Gen5_2" tier = "GeneralPurpose" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -90,7 +89,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.7.29.0/29" delegations = [ @@ -105,7 +104,7 @@ resource "azapi_resource" "subnet" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -114,12 +113,12 @@ resource "azapi_resource" "virtualNetworkRule" { type = "Microsoft.DBforPostgreSQL/servers/virtualNetworkRules@2017-12-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { ignoreMissingVnetServiceEndpoint = false virtualNetworkSubnetId = azapi_resource.subnet.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Dashboard_grafana@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.Dashboard_grafana@2022-08-01/main.tf index b95c2886..e5ffc8ed 100644 --- a/dependency/azapi_examples/Microsoft.Dashboard_grafana@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Dashboard_grafana@2022-08-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "grafana" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { apiKey = "Disabled" autoGeneratedDomainNameLabelScope = "TenantReuse" @@ -46,7 +42,7 @@ resource "azapi_resource" "grafana" { sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataBoxEdge_dataBoxEdgeDevices@2022-03-01/main.tf b/dependency/azapi_examples/Microsoft.DataBoxEdge_dataBoxEdgeDevices@2022-03-01/main.tf index 969decfb..13a9acde 100644 --- a/dependency/azapi_examples/Microsoft.DataBoxEdge_dataBoxEdgeDevices@2022-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataBoxEdge_dataBoxEdgeDevices@2022-03-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "dataBoxEdgeDevice" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { sku = { name = "EdgeP_Base" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataFactory_factories@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DataFactory_factories@2018-06-01/main.tf index c50c460e..f7e5d22c 100644 --- a/dependency/azapi_examples/Microsoft.DataFactory_factories@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataFactory_factories@2018-06-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "factory" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" repoConfiguration = null } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataFactory_factories_credentials@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DataFactory_factories_credentials@2018-06-01/main.tf new file mode 100644 index 00000000..7b4ae7f7 --- /dev/null +++ b/dependency/azapi_examples/Microsoft.DataFactory_factories_credentials@2018-06-01/main.tf @@ -0,0 +1,71 @@ +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" +} + +resource "azapi_resource" "resourceGroup" { + type = "Microsoft.Resources/resourceGroups@2020-06-01" + name = var.resource_name + location = var.location +} + +resource "azapi_resource" "factory" { + type = "Microsoft.DataFactory/factories@2018-06-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + + identity { + type = "UserAssigned" + identity_ids = [azapi_resource.userAssignedIdentity.id] + } + body = { + properties = { + publicNetworkAccess = "Enabled" + repoConfiguration = null + } + } +} + +resource "azapi_resource" "userAssignedIdentity" { + type = "Microsoft.ManagedIdentity/userAssignedIdentities@2023-01-31" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = azapi_resource.resourceGroup.location +} + +resource "azapi_resource" "credential" { + type = "Microsoft.DataFactory/factories/credentials@2018-06-01" + parent_id = azapi_resource.factory.id + name = var.resource_name + body = { + properties = { + type = "ManagedIdentity" + annotations = ["test"] + description = "this is a test" + typeProperties = { + resourceId = azapi_resource.userAssignedIdentity.id + } + } + + } + ignore_casing = false + ignore_missing_property = false +} diff --git a/dependency/azapi_examples/Microsoft.DataFactory_factories_dataflows@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DataFactory_factories_dataflows@2018-06-01/main.tf index 91a3a833..1ddf1ceb 100644 --- a/dependency/azapi_examples/Microsoft.DataFactory_factories_dataflows@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataFactory_factories_dataflows@2018-06-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "factory" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" repoConfiguration = null } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,7 +46,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -78,7 +78,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -87,15 +87,15 @@ resource "azapi_resource" "linkedservice" { type = "Microsoft.DataFactory/factories/linkedservices@2018-06-01" parent_id = azapi_resource.factory.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" type = "AzureBlobStorage" typeProperties = { - serviceEndpoint = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.blob + serviceEndpoint = azapi_resource.storageAccount.output.properties.primaryEndpoints.blob } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -104,7 +104,7 @@ resource "azapi_resource" "dataflow" { type = "Microsoft.DataFactory/factories/dataflows@2018-06-01" parent_id = azapi_resource.factory.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" type = "Flowlet" @@ -136,7 +136,7 @@ resource "azapi_resource" "dataflow" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataFactory_factories_datasets@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DataFactory_factories_datasets@2018-06-01/main.tf index 81cf79e7..2c8eb359 100644 --- a/dependency/azapi_examples/Microsoft.DataFactory_factories_datasets@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataFactory_factories_datasets@2018-06-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "factory" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" repoConfiguration = null } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,7 +46,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -78,7 +78,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -87,15 +87,15 @@ resource "azapi_resource" "linkedservice" { type = "Microsoft.DataFactory/factories/linkedservices@2018-06-01" parent_id = azapi_resource.factory.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" type = "AzureBlobStorage" typeProperties = { - serviceEndpoint = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.blob + serviceEndpoint = azapi_resource.storageAccount.output.properties.primaryEndpoints.blob } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -104,7 +104,7 @@ resource "azapi_resource" "dataset" { type = "Microsoft.DataFactory/factories/datasets@2018-06-01" parent_id = azapi_resource.factory.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" linkedServiceName = { @@ -122,7 +122,7 @@ resource "azapi_resource" "dataset" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataFactory_factories_integrationRuntimes@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DataFactory_factories_integrationRuntimes@2018-06-01/main.tf index dd6ac10f..383e6299 100644 --- a/dependency/azapi_examples/Microsoft.DataFactory_factories_integrationRuntimes@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataFactory_factories_integrationRuntimes@2018-06-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "factory" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" repoConfiguration = null } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -45,12 +45,12 @@ resource "azapi_resource" "integrationRuntime" { type = "Microsoft.DataFactory/factories/integrationRuntimes@2018-06-01" parent_id = azapi_resource.factory.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" type = "SelfHosted" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataFactory_factories_linkedservices@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DataFactory_factories_linkedservices@2018-06-01/main.tf index aa08179c..0f58a590 100644 --- a/dependency/azapi_examples/Microsoft.DataFactory_factories_linkedservices@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataFactory_factories_linkedservices@2018-06-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "factory" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" repoConfiguration = null } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,7 +46,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -78,7 +78,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -87,15 +87,15 @@ resource "azapi_resource" "linkedservice" { type = "Microsoft.DataFactory/factories/linkedservices@2018-06-01" parent_id = azapi_resource.factory.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" type = "AzureBlobStorage" typeProperties = { - serviceEndpoint = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.blob + serviceEndpoint = azapi_resource.storageAccount.output.properties.primaryEndpoints.blob } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataFactory_factories_managedVirtualNetworks@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DataFactory_factories_managedVirtualNetworks@2018-06-01/main.tf index d2992710..b09838da 100644 --- a/dependency/azapi_examples/Microsoft.DataFactory_factories_managedVirtualNetworks@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataFactory_factories_managedVirtualNetworks@2018-06-01/main.tf @@ -31,18 +31,14 @@ resource "azapi_resource" "factory" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { globalParameters = { } publicNetworkAccess = "Enabled" repoConfiguration = null } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,10 +47,10 @@ resource "azapi_resource" "managedVirtualNetwork" { type = "Microsoft.DataFactory/factories/managedVirtualNetworks@2018-06-01" parent_id = azapi_resource.factory.id name = "default" - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataFactory_factories_managedVirtualNetworks_managedPrivateEndpoints@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DataFactory_factories_managedVirtualNetworks_managedPrivateEndpoints@2018-06-01/main.tf index e628e9b6..50668cd7 100644 --- a/dependency/azapi_examples/Microsoft.DataFactory_factories_managedVirtualNetworks_managedPrivateEndpoints@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataFactory_factories_managedVirtualNetworks_managedPrivateEndpoints@2018-06-01/main.tf @@ -31,18 +31,14 @@ resource "azapi_resource" "factory" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { globalParameters = { } publicNetworkAccess = "Enabled" repoConfiguration = null } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -52,10 +48,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "BlobStorage" properties = { accessTier = "Hot" @@ -87,7 +80,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -96,10 +89,10 @@ resource "azapi_resource" "managedVirtualNetwork" { type = "Microsoft.DataFactory/factories/managedVirtualNetworks@2018-06-01" parent_id = azapi_resource.factory.id name = "default" - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -114,11 +107,11 @@ resource "azapi_resource_action" "managedPrivateEndpoint" { type = "Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints@2018-06-01" resource_id = data.azapi_resource_id.managedPrivateEndpoint.id method = "PUT" - body = jsonencode({ + body = { properties = { groupId = "blob" privateLinkResourceId = azapi_resource.storageAccount.id } - }) + } } diff --git a/dependency/azapi_examples/Microsoft.DataFactory_factories_pipelines@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DataFactory_factories_pipelines@2018-06-01/main.tf index 2d768c39..89ef3242 100644 --- a/dependency/azapi_examples/Microsoft.DataFactory_factories_pipelines@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataFactory_factories_pipelines@2018-06-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "factory" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" repoConfiguration = null } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -45,7 +45,7 @@ resource "azapi_resource" "pipeline" { type = "Microsoft.DataFactory/factories/pipelines@2018-06-01" parent_id = azapi_resource.factory.id name = var.resource_name - body = jsonencode({ + body = { properties = { annotations = [ ] @@ -59,7 +59,7 @@ resource "azapi_resource" "pipeline" { variables = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataFactory_factories_triggers@2018-06-01/main.tf b/dependency/azapi_examples/Microsoft.DataFactory_factories_triggers@2018-06-01/main.tf index 3224e391..958955c5 100644 --- a/dependency/azapi_examples/Microsoft.DataFactory_factories_triggers@2018-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataFactory_factories_triggers@2018-06-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "factory" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" repoConfiguration = null } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -45,7 +45,7 @@ resource "azapi_resource" "pipeline" { type = "Microsoft.DataFactory/factories/pipelines@2018-06-01" parent_id = azapi_resource.factory.id name = var.resource_name - body = jsonencode({ + body = { properties = { annotations = [ ] @@ -59,7 +59,7 @@ resource "azapi_resource" "pipeline" { variables = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -68,7 +68,7 @@ resource "azapi_resource" "trigger" { type = "Microsoft.DataFactory/factories/triggers@2018-06-01" parent_id = azapi_resource.factory.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" pipeline = { @@ -87,7 +87,7 @@ resource "azapi_resource" "trigger" { startTime = "2022-09-21T00:00:00Z" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataMigration_services@2018-04-19/main.tf b/dependency/azapi_examples/Microsoft.DataMigration_services@2018-04-19/main.tf index 329830a8..9f578f33 100644 --- a/dependency/azapi_examples/Microsoft.DataMigration_services@2018-04-19/main.tf +++ b/dependency/azapi_examples/Microsoft.DataMigration_services@2018-04-19/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.1.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,7 +79,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "Cloud" properties = { virtualSubnetId = azapi_resource.subnet.id @@ -85,7 +87,7 @@ resource "azapi_resource" "service" { sku = { name = "Standard_1vCores" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataMigration_services_projects@2018-04-19/main.tf b/dependency/azapi_examples/Microsoft.DataMigration_services_projects@2018-04-19/main.tf index 9759d771..9c25285a 100644 --- a/dependency/azapi_examples/Microsoft.DataMigration_services_projects@2018-04-19/main.tf +++ b/dependency/azapi_examples/Microsoft.DataMigration_services_projects@2018-04-19/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.1.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,7 +79,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "Cloud" properties = { virtualSubnetId = azapi_resource.subnet.id @@ -85,7 +87,7 @@ resource "azapi_resource" "service" { sku = { name = "Standard_1vCores" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -95,12 +97,12 @@ resource "azapi_resource" "project" { parent_id = azapi_resource.service.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { sourcePlatform = "SQL" targetPlatform = "SQLDB" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataProtection_backupVaults@2022-04-01/main.tf b/dependency/azapi_examples/Microsoft.DataProtection_backupVaults@2022-04-01/main.tf index 17f4c288..70954ae4 100644 --- a/dependency/azapi_examples/Microsoft.DataProtection_backupVaults@2022-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataProtection_backupVaults@2022-04-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "backupVault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { storageSettings = [ { @@ -43,7 +40,7 @@ resource "azapi_resource" "backupVault" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataProtection_backupVaults_backupInstances@2022-04-01/main.tf b/dependency/azapi_examples/Microsoft.DataProtection_backupVaults_backupInstances@2022-04-01/main.tf index 5004ca6f..c725e2d0 100644 --- a/dependency/azapi_examples/Microsoft.DataProtection_backupVaults_backupInstances@2022-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataProtection_backupVaults_backupInstances@2022-04-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { administratorLogin = "psqladmin" administratorLoginPassword = "H@Sh1CoR3!" @@ -56,7 +53,7 @@ resource "azapi_resource" "server" { name = "B_Gen5_2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -66,10 +63,11 @@ resource "azapi_resource" "backupVault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { storageSettings = [ { @@ -78,7 +76,7 @@ resource "azapi_resource" "backupVault" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -87,7 +85,7 @@ resource "azapi_resource" "backupPolicy" { type = "Microsoft.DataProtection/backupVaults/backupPolicies@2022-04-01" parent_id = azapi_resource.backupVault.id name = var.resource_name - body = jsonencode({ + body = { properties = { datasourceTypes = [ "Microsoft.DBforPostgreSQL/servers/databases", @@ -145,7 +143,7 @@ resource "azapi_resource" "backupPolicy" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -154,12 +152,12 @@ resource "azapi_resource" "database" { type = "Microsoft.DBforPostgreSQL/servers/databases@2017-12-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { charset = "UTF8" collation = "English_United States.1252" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -168,7 +166,7 @@ resource "azapi_resource" "backupInstance" { type = "Microsoft.DataProtection/backupVaults/backupInstances@2022-04-01" parent_id = azapi_resource.backupVault.id name = var.resource_name - body = jsonencode({ + body = { properties = { dataSourceInfo = { datasourceType = "Microsoft.DBforPostgreSQL/servers/databases" @@ -195,7 +193,7 @@ resource "azapi_resource" "backupInstance" { policyId = azapi_resource.backupPolicy.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataProtection_backupVaults_backupPolicies@2022-04-01/main.tf b/dependency/azapi_examples/Microsoft.DataProtection_backupVaults_backupPolicies@2022-04-01/main.tf index dc350c0a..bc8672e9 100644 --- a/dependency/azapi_examples/Microsoft.DataProtection_backupVaults_backupPolicies@2022-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataProtection_backupVaults_backupPolicies@2022-04-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "backupVault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { storageSettings = [ { @@ -43,7 +40,7 @@ resource "azapi_resource" "backupVault" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -52,7 +49,7 @@ resource "azapi_resource" "backupPolicy" { type = "Microsoft.DataProtection/backupVaults/backupPolicies@2022-04-01" parent_id = azapi_resource.backupVault.id name = var.resource_name - body = jsonencode({ + body = { properties = { datasourceTypes = [ "Microsoft.DBforPostgreSQL/servers/databases", @@ -110,7 +107,7 @@ resource "azapi_resource" "backupPolicy" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataProtection_resourceGuards@2022-04-01/main.tf b/dependency/azapi_examples/Microsoft.DataProtection_resourceGuards@2022-04-01/main.tf index 43be4f07..b521856c 100644 --- a/dependency/azapi_examples/Microsoft.DataProtection_resourceGuards@2022-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataProtection_resourceGuards@2022-04-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "resourceGuard" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { vaultCriticalOperationExclusionList = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataShare_accounts@2019-11-01/main.tf b/dependency/azapi_examples/Microsoft.DataShare_accounts@2019-11-01/main.tf index 4caf2570..3f59a068 100644 --- a/dependency/azapi_examples/Microsoft.DataShare_accounts@2019-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataShare_accounts@2019-11-01/main.tf @@ -31,14 +31,15 @@ resource "azapi_resource" "account" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { tags = { env = "Test" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DataShare_accounts_shares@2019-11-01/main.tf b/dependency/azapi_examples/Microsoft.DataShare_accounts_shares@2019-11-01/main.tf index 83252ac6..c8a31ec9 100644 --- a/dependency/azapi_examples/Microsoft.DataShare_accounts_shares@2019-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DataShare_accounts_shares@2019-11-01/main.tf @@ -31,14 +31,15 @@ resource "azapi_resource" "account" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { tags = { env = "Test" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,13 +48,13 @@ resource "azapi_resource" "share" { type = "Microsoft.DataShare/accounts/shares@2019-11-01" parent_id = azapi_resource.account.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" shareKind = "CopyBased" terms = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Databricks_accessConnectors@2022-10-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Databricks_accessConnectors@2022-10-01-preview/main.tf index 45c82c1f..a08103a9 100644 --- a/dependency/azapi_examples/Microsoft.Databricks_accessConnectors@2022-10-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Databricks_accessConnectors@2022-10-01-preview/main.tf @@ -31,13 +31,9 @@ resource "azapi_resource" "accessConnector" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Databricks_workspaces@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.Databricks_workspaces@2023-02-01/main.tf index 6e7c1fe2..9e5cba0c 100644 --- a/dependency/azapi_examples/Microsoft.Databricks_workspaces@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Databricks_workspaces@2023-02-01/main.tf @@ -37,7 +37,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { managedResourceGroupId = data.azapi_resource_id.workspace_resource_group.id parameters = { @@ -53,7 +53,7 @@ resource "azapi_resource" "workspace" { sku = { name = "premium" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Databricks_workspaces_virtualNetworkPeerings@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.Databricks_workspaces_virtualNetworkPeerings@2023-02-01/main.tf index b68ca27a..41f8cafd 100644 --- a/dependency/azapi_examples/Microsoft.Databricks_workspaces_virtualNetworkPeerings@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Databricks_workspaces_virtualNetworkPeerings@2023-02-01/main.tf @@ -37,7 +37,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { managedResourceGroupId = data.azapi_resource_id.workspace_resource_group.id publicNetworkAccess = "Enabled" @@ -45,7 +45,7 @@ resource "azapi_resource" "workspace" { sku = { name = "standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -55,7 +55,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -69,17 +69,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "virtualNetworkPeering" { type = "Microsoft.Databricks/workspaces/virtualNetworkPeerings@2023-02-01" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { properties = { allowForwardedTraffic = false allowGatewayTransit = false @@ -99,7 +101,7 @@ resource "azapi_resource" "virtualNetworkPeering" { } useRemoteGateways = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DevTestLab_labs@2018-09-15/main.tf b/dependency/azapi_examples/Microsoft.DevTestLab_labs@2018-09-15/main.tf index a1aae741..6faae9a9 100644 --- a/dependency/azapi_examples/Microsoft.DevTestLab_labs@2018-09-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DevTestLab_labs@2018-09-15/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "lab" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { labStorageType = "Premium" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DevTestLab_labs_schedules@2018-09-15/main.tf b/dependency/azapi_examples/Microsoft.DevTestLab_labs_schedules@2018-09-15/main.tf index b43f552d..6419d8ad 100644 --- a/dependency/azapi_examples/Microsoft.DevTestLab_labs_schedules@2018-09-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DevTestLab_labs_schedules@2018-09-15/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "lab" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { labStorageType = "Premium" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -45,7 +45,7 @@ resource "azapi_resource" "schedule" { parent_id = azapi_resource.lab.id name = "LabVmsShutdown" location = var.location - body = jsonencode({ + body = { properties = { dailyRecurrence = { time = "0100" @@ -62,7 +62,7 @@ resource "azapi_resource" "schedule" { tags = { environment = "Production" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DevTestLab_labs_virtualMachines@2018-09-15/main.tf b/dependency/azapi_examples/Microsoft.DevTestLab_labs_virtualMachines@2018-09-15/main.tf index 98468c27..c98e6080 100644 --- a/dependency/azapi_examples/Microsoft.DevTestLab_labs_virtualMachines@2018-09-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DevTestLab_labs_virtualMachines@2018-09-15/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "lab" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { labStorageType = "Premium" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,7 +56,7 @@ resource "azapi_resource" "virtualNetwork" { type = "Microsoft.DevTestLab/labs/virtualNetworks@2018-09-15" parent_id = azapi_resource.lab.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" subnetOverrides = [ @@ -68,7 +68,7 @@ resource "azapi_resource" "virtualNetwork" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +78,7 @@ resource "azapi_resource" "virtualMachine" { parent_id = azapi_resource.lab.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowClaim = true disallowPublicIpAddress = false @@ -101,7 +101,7 @@ resource "azapi_resource" "virtualMachine" { storageType = "Standard" userName = "acct5stU5er" } - }) + } ignore_casing = true schema_validation_enabled = false response_export_values = ["*"] diff --git a/dependency/azapi_examples/Microsoft.DevTestLab_labs_virtualNetworks@2018-09-15/main.tf b/dependency/azapi_examples/Microsoft.DevTestLab_labs_virtualNetworks@2018-09-15/main.tf index 2455f6e3..9f486dd4 100644 --- a/dependency/azapi_examples/Microsoft.DevTestLab_labs_virtualNetworks@2018-09-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DevTestLab_labs_virtualNetworks@2018-09-15/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "lab" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { labStorageType = "Premium" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,7 +56,7 @@ resource "azapi_resource" "virtualNetwork" { type = "Microsoft.DevTestLab/labs/virtualNetworks@2018-09-15" parent_id = azapi_resource.lab.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" subnetOverrides = [ @@ -68,7 +68,7 @@ resource "azapi_resource" "virtualNetwork" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DevTestLab_schedules@2018-09-15/main.tf b/dependency/azapi_examples/Microsoft.DevTestLab_schedules@2018-09-15/main.tf index 25b5763c..410b37ca 100644 --- a/dependency/azapi_examples/Microsoft.DevTestLab_schedules@2018-09-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DevTestLab_schedules@2018-09-15/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,7 +79,7 @@ resource "azapi_resource" "networkInterface" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enableAcceleratedNetworking = false enableIPForwarding = false @@ -95,7 +97,7 @@ resource "azapi_resource" "networkInterface" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -105,7 +107,7 @@ resource "azapi_resource" "virtualMachine" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { additionalCapabilities = { } @@ -175,7 +177,7 @@ resource "azapi_resource" "virtualMachine" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -185,7 +187,7 @@ resource "azapi_resource" "schedule" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { dailyRecurrence = { time = "0100" @@ -204,7 +206,7 @@ resource "azapi_resource" "schedule" { tags = { environment = "Production" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DeviceUpdate_accounts@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.DeviceUpdate_accounts@2022-10-01/main.tf index fdf18bba..4de392dc 100644 --- a/dependency/azapi_examples/Microsoft.DeviceUpdate_accounts@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DeviceUpdate_accounts@2022-10-01/main.tf @@ -31,17 +31,13 @@ resource "azapi_resource" "account" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { publicNetworkAccess = "Enabled" sku = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DeviceUpdate_accounts_instances@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.DeviceUpdate_accounts_instances@2022-10-01/main.tf index 5d425c87..2f37cb05 100644 --- a/dependency/azapi_examples/Microsoft.DeviceUpdate_accounts_instances@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DeviceUpdate_accounts_instances@2022-10-01/main.tf @@ -31,17 +31,13 @@ resource "azapi_resource" "account" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { publicNetworkAccess = "Enabled" sku = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,10 +47,7 @@ resource "azapi_resource" "IotHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { cloudToDevice = { } @@ -78,7 +71,7 @@ resource "azapi_resource" "IotHub" { capacity = 1 name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -88,7 +81,7 @@ resource "azapi_resource" "instance" { parent_id = azapi_resource.account.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { accountName = azapi_resource.account.name enableDiagnostics = false @@ -99,7 +92,7 @@ resource "azapi_resource" "instance" { ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Devices_IotHubs@2022-04-30-preview/main.tf b/dependency/azapi_examples/Microsoft.Devices_IotHubs@2022-04-30-preview/main.tf index 4fb96d89..4dd203d0 100644 --- a/dependency/azapi_examples/Microsoft.Devices_IotHubs@2022-04-30-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Devices_IotHubs@2022-04-30-preview/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "IotHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { cloudToDevice = { } @@ -58,7 +55,7 @@ resource "azapi_resource" "IotHub" { capacity = 1 name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Devices_IotHubs_certificates@2022-04-30-preview/main.tf b/dependency/azapi_examples/Microsoft.Devices_IotHubs_certificates@2022-04-30-preview/main.tf index 68f3c72b..038ffe9b 100644 --- a/dependency/azapi_examples/Microsoft.Devices_IotHubs_certificates@2022-04-30-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Devices_IotHubs_certificates@2022-04-30-preview/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "IotHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { cloudToDevice = { } @@ -58,7 +55,7 @@ resource "azapi_resource" "IotHub" { capacity = 1 name = "B1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,12 +64,12 @@ resource "azapi_resource" "certificate" { type = "Microsoft.Devices/IotHubs/certificates@2022-04-30-preview" parent_id = azapi_resource.IotHub.id name = var.resource_name - body = jsonencode({ + body = { properties = { certificate = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tDQpNSUlEYnpDQ0FsZWdBd0lCQWdJSkFJempSRDM2c0liYk1BMEdDU3FHU0liM0RRRUJDd1VBTUUweEN6QUpCZ05WDQpCQVlUQWxWVE1STXdFUVlEVlFRSURBcFRiMjFsTFZOMFlYUmxNUkl3RUFZRFZRUUtEQWwwWlhKeVlXWnZjbTB4DQpGVEFUQmdOVkJBTU1ESFJsY25KaFptOXliUzVwYnpBZ0Z3MHhOekEwTWpFeU1EQTFNamRhR0E4eU1URTNNRE15DQpPREl3TURVeU4xb3dUVEVMTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnTUNsTnZiV1V0VTNSaGRHVXhFakFRDQpCZ05WQkFvTUNYUmxjbkpoWm05eWJURVZNQk1HQTFVRUF3d01kR1Z5Y21GbWIzSnRMbWx2TUlJQklqQU5CZ2txDQpoa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTNMOUw1c3pUNCtGTHlrVEZOeXlQankvazNCUVRZQWZSDQpRelAyZGhuc3VVS20zY2RQQzBOeVord0VYSVVHaG9ETzJZRzZFWUNoT2w4ZnNEcURPamxvU1VHS3FZdysrbmxwDQpISXVVZ0p4OEl4eEcyWGtBTENqRlU3RW1GK3c3a243NmQwZXpwRUlZeG5MUCtLRzJEVm9ybm9FdDFhTGh2MU1MDQptcGdFWlpQaERiTVNMaFNZV2VUVlJNYXlYTHdxdGZnbkR1bVFTQis4ZC8xSnVKcXJTSTRwRDEySm96VlRoemI2DQpoc2pmYjZSTVg0ZXBQbXJHbjBQYlRQRUVBNmF3bXN4QkNYQjBzMTNuTlF0L08waExNMmFnd3ZBeW96aWxRVitzDQo2MTZDa2drNkRKb1VrcVpoRHk3dlBZTUlSU3I5OGZCd3M2emtyVjZ0VExqbUQ4eEF2b2JlUFFJREFRQUJvMUF3DQpUakFkQmdOVkhRNEVGZ1FVWElxTzQyMXpNTW1iY1JSWDl3Y3RaRkNRdVBJd0h3WURWUjBqQkJnd0ZvQVVYSXFPDQo0MjF6TU1tYmNSUlg5d2N0WkZDUXVQSXdEQVlEVlIwVEJBVXdBd0VCL3pBTkJna3Foa2lHOXcwQkFRc0ZBQU9DDQpBUUVBcjgyTmVUM0JZSk9LTGxVTDZPbTVMalVGNjZld2NKakc5bHRkdnlRd1ZuZU1jcTd0NVVBUHhnQ2h6cU5SDQpWazRkYThQemtYcGpCSnlXZXpIdXBkSk5YM1hxZVVrMmtTeHFRNi9nbWhxdmZJM3k3ZGpyd29PNmp2TUVZMjZXDQpxdGtUTk9SV0RQM1RISkpWaW1DM3pWK0tNVTVVQlZyRXpoT1ZoSFNVNzA5bEJQNzVvMEJCbjN4R3NQcVNxOWs4DQpJb3RJRmZ5QWM2YStYUDMrWk1wdmg3d3FBVW1sN3ZXYTV3bGNYRXhDeDM5aDFiYWxmRFNMR05DNHN3V1BDcDlBDQpNblFSMHArdk1heTloTlAxRWgrOVFZVWFpMTRkNUtTM2NGVitLeEUxY0pSNUhEL2lMbHRubk9FYnBNc0IwZVZPDQpaV2tGdkU3WTVsVzBvVlNBZmluNVR3VEpNUT09DQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0t" isVerified = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Devices_provisioningServices@2022-02-05/main.tf b/dependency/azapi_examples/Microsoft.Devices_provisioningServices@2022-02-05/main.tf index 73bb1176..5b0c8c0c 100644 --- a/dependency/azapi_examples/Microsoft.Devices_provisioningServices@2022-02-05/main.tf +++ b/dependency/azapi_examples/Microsoft.Devices_provisioningServices@2022-02-05/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "provisioningService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allocationPolicy = "Hashed" enableDataResidency = false @@ -43,7 +43,7 @@ resource "azapi_resource" "provisioningService" { capacity = 1 name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Devices_provisioningServices_certificates@2022-02-05/main.tf b/dependency/azapi_examples/Microsoft.Devices_provisioningServices_certificates@2022-02-05/main.tf index 3a3b7596..560e5981 100644 --- a/dependency/azapi_examples/Microsoft.Devices_provisioningServices_certificates@2022-02-05/main.tf +++ b/dependency/azapi_examples/Microsoft.Devices_provisioningServices_certificates@2022-02-05/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "provisioningService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allocationPolicy = "Hashed" enableDataResidency = false @@ -43,7 +43,7 @@ resource "azapi_resource" "provisioningService" { capacity = 1 name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -52,11 +52,11 @@ resource "azapi_resource" "certificate" { type = "Microsoft.Devices/provisioningServices/certificates@2022-02-05" parent_id = azapi_resource.provisioningService.id name = var.resource_name - body = jsonencode({ + body = { properties = { certificate = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tDQpNSUlEYnpDQ0FsZWdBd0lCQWdJSkFJempSRDM2c0liYk1BMEdDU3FHU0liM0RRRUJDd1VBTUUweEN6QUpCZ05WDQpCQVlUQWxWVE1STXdFUVlEVlFRSURBcFRiMjFsTFZOMFlYUmxNUkl3RUFZRFZRUUtEQWwwWlhKeVlXWnZjbTB4DQpGVEFUQmdOVkJBTU1ESFJsY25KaFptOXliUzVwYnpBZ0Z3MHhOekEwTWpFeU1EQTFNamRhR0E4eU1URTNNRE15DQpPREl3TURVeU4xb3dUVEVMTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnTUNsTnZiV1V0VTNSaGRHVXhFakFRDQpCZ05WQkFvTUNYUmxjbkpoWm05eWJURVZNQk1HQTFVRUF3d01kR1Z5Y21GbWIzSnRMbWx2TUlJQklqQU5CZ2txDQpoa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQTNMOUw1c3pUNCtGTHlrVEZOeXlQankvazNCUVRZQWZSDQpRelAyZGhuc3VVS20zY2RQQzBOeVord0VYSVVHaG9ETzJZRzZFWUNoT2w4ZnNEcURPamxvU1VHS3FZdysrbmxwDQpISXVVZ0p4OEl4eEcyWGtBTENqRlU3RW1GK3c3a243NmQwZXpwRUlZeG5MUCtLRzJEVm9ybm9FdDFhTGh2MU1MDQptcGdFWlpQaERiTVNMaFNZV2VUVlJNYXlYTHdxdGZnbkR1bVFTQis4ZC8xSnVKcXJTSTRwRDEySm96VlRoemI2DQpoc2pmYjZSTVg0ZXBQbXJHbjBQYlRQRUVBNmF3bXN4QkNYQjBzMTNuTlF0L08waExNMmFnd3ZBeW96aWxRVitzDQo2MTZDa2drNkRKb1VrcVpoRHk3dlBZTUlSU3I5OGZCd3M2emtyVjZ0VExqbUQ4eEF2b2JlUFFJREFRQUJvMUF3DQpUakFkQmdOVkhRNEVGZ1FVWElxTzQyMXpNTW1iY1JSWDl3Y3RaRkNRdVBJd0h3WURWUjBqQkJnd0ZvQVVYSXFPDQo0MjF6TU1tYmNSUlg5d2N0WkZDUXVQSXdEQVlEVlIwVEJBVXdBd0VCL3pBTkJna3Foa2lHOXcwQkFRc0ZBQU9DDQpBUUVBcjgyTmVUM0JZSk9LTGxVTDZPbTVMalVGNjZld2NKakc5bHRkdnlRd1ZuZU1jcTd0NVVBUHhnQ2h6cU5SDQpWazRkYThQemtYcGpCSnlXZXpIdXBkSk5YM1hxZVVrMmtTeHFRNi9nbWhxdmZJM3k3ZGpyd29PNmp2TUVZMjZXDQpxdGtUTk9SV0RQM1RISkpWaW1DM3pWK0tNVTVVQlZyRXpoT1ZoSFNVNzA5bEJQNzVvMEJCbjN4R3NQcVNxOWs4DQpJb3RJRmZ5QWM2YStYUDMrWk1wdmg3d3FBVW1sN3ZXYTV3bGNYRXhDeDM5aDFiYWxmRFNMR05DNHN3V1BDcDlBDQpNblFSMHArdk1heTloTlAxRWgrOVFZVWFpMTRkNUtTM2NGVitLeEUxY0pSNUhEL2lMbHRubk9FYnBNc0IwZVZPDQpaV2tGdkU3WTVsVzBvVlNBZmluNVR3VEpNUT09DQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0t" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DigitalTwins_digitalTwinsInstances@2020-12-01/main.tf b/dependency/azapi_examples/Microsoft.DigitalTwins_digitalTwinsInstances@2020-12-01/main.tf index e8f47a53..2a0f692c 100644 --- a/dependency/azapi_examples/Microsoft.DigitalTwins_digitalTwinsInstances@2020-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DigitalTwins_digitalTwinsInstances@2020-12-01/main.tf @@ -31,11 +31,12 @@ resource "azapi_resource" "digitalTwinsInstance" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } - }) + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DigitalTwins_digitalTwinsInstances_endpoints@2020-12-01/main.tf b/dependency/azapi_examples/Microsoft.DigitalTwins_digitalTwinsInstances_endpoints@2020-12-01/main.tf index 8975a06f..6cfb5b82 100644 --- a/dependency/azapi_examples/Microsoft.DigitalTwins_digitalTwinsInstances_endpoints@2020-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.DigitalTwins_digitalTwinsInstances_endpoints@2020-12-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false publicNetworkAccess = "Enabled" @@ -46,7 +42,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,11 +52,8 @@ resource "azapi_resource" "digitalTwinsInstance" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } - }) + body = { + } schema_validation_enabled = false response_export_values = ["*"] } @@ -69,7 +62,7 @@ resource "azapi_resource" "topic" { type = "Microsoft.ServiceBus/namespaces/topics@2021-06-01-preview" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { enableBatchedOperations = false enableExpress = false @@ -79,7 +72,7 @@ resource "azapi_resource" "topic" { status = "Active" supportOrdering = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -88,13 +81,13 @@ resource "azapi_resource" "authorizationRule" { type = "Microsoft.ServiceBus/namespaces/topics/authorizationRules@2021-06-01-preview" parent_id = azapi_resource.topic.id name = var.resource_name - body = jsonencode({ + body = { properties = { rights = [ "Send", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -110,17 +103,19 @@ resource "azapi_resource" "endpoint" { type = "Microsoft.DigitalTwins/digitalTwinsInstances/endpoints@2020-12-01" parent_id = azapi_resource.digitalTwinsInstance.id name = var.resource_name - body = jsonencode({ + body = { properties = { authenticationType = "KeyBased" deadLetterSecret = "" endpointType = "ServiceBus" - primaryConnectionString = jsondecode(data.azapi_resource_action.listKeys.output).primaryConnectionString - secondaryConnectionString = jsondecode(data.azapi_resource_action.listKeys.output).secondaryConnectionString + primaryConnectionString = data.azapi_resource_action.listKeys.output.primaryConnectionString + secondaryConnectionString = data.azapi_resource_action.listKeys.output.secondaryConnectionString } - }) + } schema_validation_enabled = false - ignore_body_changes = ["properties.primaryConnectionString", "properties.secondaryConnectionString"] response_export_values = ["*"] + lifecycle { + ignore_changes = [body.properties.primaryConnectionString, body.properties.secondaryConnectionString] + } } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts@2021-10-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts@2021-10-15/main.tf index 8681b8ea..f2b0880f 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts@2021-10-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts@2021-10-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -69,7 +66,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_cassandraKeyspaces@2021-10-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_cassandraKeyspaces@2021-10-15/main.tf index 8c792af6..447c6b4c 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_cassandraKeyspaces@2021-10-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_cassandraKeyspaces@2021-10-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -72,7 +69,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -81,7 +78,7 @@ resource "azapi_resource" "cassandraKeyspace" { type = "Microsoft.DocumentDB/databaseAccounts/cassandraKeyspaces@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -89,7 +86,7 @@ resource "azapi_resource" "cassandraKeyspace" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_gremlinDatabases@2023-04-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_gremlinDatabases@2023-04-15/main.tf index f1ef8d16..16c3e69f 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_gremlinDatabases@2023-04-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_gremlinDatabases@2023-04-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -72,7 +69,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -81,7 +78,7 @@ resource "azapi_resource" "gremlinDatabase" { type = "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases@2023-04-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -89,7 +86,7 @@ resource "azapi_resource" "gremlinDatabase" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_gremlinDatabases_graphs@2023-04-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_gremlinDatabases_graphs@2023-04-15/main.tf index a11e31e5..0f4a168b 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_gremlinDatabases_graphs@2023-04-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_gremlinDatabases_graphs@2023-04-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -72,7 +69,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -81,7 +78,7 @@ resource "azapi_resource" "gremlinDatabase" { type = "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases@2023-04-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -89,7 +86,7 @@ resource "azapi_resource" "gremlinDatabase" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,7 +95,7 @@ resource "azapi_resource" "graph" { type = "Microsoft.DocumentDB/databaseAccounts/gremlinDatabases/graphs@2023-04-15" parent_id = azapi_resource.gremlinDatabase.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { throughput = 400 @@ -113,7 +110,7 @@ resource "azapi_resource" "graph" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_mongodbDatabases@2021-10-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_mongodbDatabases@2021-10-15/main.tf index 9b62a76b..fb625573 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_mongodbDatabases@2021-10-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_mongodbDatabases@2021-10-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "MongoDB" properties = { capabilities = [ @@ -72,7 +69,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -81,7 +78,7 @@ resource "azapi_resource" "mongodbDatabase" { type = "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -89,7 +86,7 @@ resource "azapi_resource" "mongodbDatabase" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_services@2022-05-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_services@2022-05-15/main.tf index b2d168f9..32c68c8b 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_services@2022-05-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_services@2022-05-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -69,7 +66,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,13 +75,13 @@ resource "azapi_resource" "service" { type = "Microsoft.DocumentDB/databaseAccounts/services@2022-05-15" parent_id = azapi_resource.databaseAccount.id name = "SqlDedicatedGateway" - body = jsonencode({ + body = { properties = { instanceCount = 1 instanceSize = "Cosmos.D4s" serviceType = "SqlDedicatedGateway" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases@2021-10-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases@2021-10-15/main.tf index dc8f0283..a0b802e5 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases@2021-10-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases@2021-10-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -69,7 +66,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +75,7 @@ resource "azapi_resource" "sqlDatabase" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { throughput = 400 @@ -87,7 +84,7 @@ resource "azapi_resource" "sqlDatabase" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers@2023-04-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers@2023-04-15/main.tf index ab1656aa..4e3ffbb1 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers@2023-04-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers@2023-04-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -69,7 +66,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +75,7 @@ resource "azapi_resource" "sqlDatabase" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { throughput = 400 @@ -87,7 +84,7 @@ resource "azapi_resource" "sqlDatabase" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -96,7 +93,7 @@ resource "azapi_resource" "container" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers@2023-04-15" parent_id = azapi_resource.sqlDatabase.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -110,7 +107,7 @@ resource "azapi_resource" "container" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_storedProcedures@2021-10-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_storedProcedures@2021-10-15/main.tf index d26863ef..9689913f 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_storedProcedures@2021-10-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_storedProcedures@2021-10-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -69,7 +66,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +75,7 @@ resource "azapi_resource" "sqlDatabase" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -86,7 +83,7 @@ resource "azapi_resource" "sqlDatabase" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -95,7 +92,7 @@ resource "azapi_resource" "container" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers@2023-04-15" parent_id = azapi_resource.sqlDatabase.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -109,7 +106,7 @@ resource "azapi_resource" "container" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -118,7 +115,7 @@ resource "azapi_resource" "storedProcedure" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/storedProcedures@2021-10-15" parent_id = azapi_resource.container.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -127,7 +124,7 @@ resource "azapi_resource" "storedProcedure" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_triggers@2021-10-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_triggers@2021-10-15/main.tf index 47de6065..fe1cfc13 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_triggers@2021-10-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_triggers@2021-10-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -69,7 +66,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +75,7 @@ resource "azapi_resource" "sqlDatabase" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -86,7 +83,7 @@ resource "azapi_resource" "sqlDatabase" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -95,7 +92,7 @@ resource "azapi_resource" "container" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers@2023-04-15" parent_id = azapi_resource.sqlDatabase.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -109,7 +106,7 @@ resource "azapi_resource" "container" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -118,7 +115,7 @@ resource "azapi_resource" "trigger" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/triggers@2021-10-15" parent_id = azapi_resource.container.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -129,7 +126,7 @@ resource "azapi_resource" "trigger" { triggerType = "Pre" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_userDefinedFunctions@2021-10-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_userDefinedFunctions@2021-10-15/main.tf index a3236306..2348180d 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_userDefinedFunctions@2021-10-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlDatabases_containers_userDefinedFunctions@2021-10-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -69,7 +66,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +75,7 @@ resource "azapi_resource" "sqlDatabase" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -86,7 +83,7 @@ resource "azapi_resource" "sqlDatabase" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -95,7 +92,7 @@ resource "azapi_resource" "container" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers@2023-04-15" parent_id = azapi_resource.sqlDatabase.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -109,7 +106,7 @@ resource "azapi_resource" "container" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -118,7 +115,7 @@ resource "azapi_resource" "userDefinedFunction" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/userDefinedFunctions@2021-10-15" parent_id = azapi_resource.container.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -127,7 +124,7 @@ resource "azapi_resource" "userDefinedFunction" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlRoleAssignments@2021-10-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlRoleAssignments@2021-10-15/main.tf index 04819c5a..a4f77331 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlRoleAssignments@2021-10-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlRoleAssignments@2021-10-15/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { enableAutoStop = true enableDiskEncryption = false @@ -54,7 +54,7 @@ resource "azapi_resource" "cluster" { name = "Dev(No SLA)_Standard_D11_v2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,10 +64,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -102,7 +99,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -119,11 +116,11 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.cluster.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "ReadWrite" properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -132,13 +129,13 @@ resource "azapi_resource" "sqlRoleAssignment" { type = "Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = "ff419bf7-f8ca-ef51-00d2-3576700c341b" - body = jsonencode({ + body = { properties = { - principalId = jsondecode(azapi_resource.cluster.output).identity.principalId + principalId = azapi_resource.cluster.output.identity.principalId roleDefinitionId = data.azapi_resource.sqlRoleDefinition.id scope = azapi_resource.databaseAccount.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlRoleDefinitions@2021-10-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlRoleDefinitions@2021-10-15/main.tf index 5ae5040a..ee995c69 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlRoleDefinitions@2021-10-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_sqlRoleDefinitions@2021-10-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -69,7 +66,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +75,7 @@ resource "azapi_resource" "sqlRoleDefinition" { type = "Microsoft.DocumentDB/databaseAccounts/sqlRoleDefinitions@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = "c3ce1661-d0b9-3476-0a7c-2654ce2f3055" - body = jsonencode({ + body = { properties = { assignableScopes = [ azapi_resource.databaseAccount.id, @@ -93,7 +90,7 @@ resource "azapi_resource" "sqlRoleDefinition" { roleName = var.resource_name type = "CustomRole" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_tables@2021-10-15/main.tf b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_tables@2021-10-15/main.tf index b16ec548..1f278277 100644 --- a/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_tables@2021-10-15/main.tf +++ b/dependency/azapi_examples/Microsoft.DocumentDB_databaseAccounts_tables@2021-10-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -72,7 +69,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -81,7 +78,7 @@ resource "azapi_resource" "table" { type = "Microsoft.DocumentDB/databaseAccounts/tables@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { } @@ -89,7 +86,7 @@ resource "azapi_resource" "table" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventGrid_domains@2021-12-01/main.tf b/dependency/azapi_examples/Microsoft.EventGrid_domains@2021-12-01/main.tf index 461df3fe..d81d5012 100644 --- a/dependency/azapi_examples/Microsoft.EventGrid_domains@2021-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventGrid_domains@2021-12-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "domain" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoCreateTopicWithFirstSubscription = true autoDeleteTopicWithLastSubscription = true @@ -40,7 +40,7 @@ resource "azapi_resource" "domain" { inputSchemaMapping = null publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventGrid_domains_topics@2021-12-01/main.tf b/dependency/azapi_examples/Microsoft.EventGrid_domains_topics@2021-12-01/main.tf index f61f1a79..94e78ac2 100644 --- a/dependency/azapi_examples/Microsoft.EventGrid_domains_topics@2021-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventGrid_domains_topics@2021-12-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "domain" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoCreateTopicWithFirstSubscription = true autoDeleteTopicWithLastSubscription = true @@ -40,7 +40,7 @@ resource "azapi_resource" "domain" { inputSchemaMapping = null publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventGrid_eventSubscriptions@2021-12-01/main.tf b/dependency/azapi_examples/Microsoft.EventGrid_eventSubscriptions@2021-12-01/main.tf index 2e717933..f1c7edcd 100644 --- a/dependency/azapi_examples/Microsoft.EventGrid_eventSubscriptions@2021-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventGrid_eventSubscriptions@2021-12-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -47,7 +43,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,10 +53,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -92,7 +85,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -101,13 +94,13 @@ resource "azapi_resource" "eventhub" { type = "Microsoft.EventHub/namespaces/eventhubs@2021-11-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { messageRetentionInDays = 1 partitionCount = 1 status = "Active" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -116,7 +109,7 @@ resource "azapi_resource" "eventSubscription" { type = "Microsoft.EventGrid/eventSubscriptions@2021-12-01" parent_id = azapi_resource.storageAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { deadLetterDestination = null destination = { @@ -140,7 +133,7 @@ resource "azapi_resource" "eventSubscription" { maxDeliveryAttempts = 10 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventGrid_systemTopics@2021-12-01/main.tf b/dependency/azapi_examples/Microsoft.EventGrid_systemTopics@2021-12-01/main.tf index a5c8e365..bb491774 100644 --- a/dependency/azapi_examples/Microsoft.EventGrid_systemTopics@2021-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventGrid_systemTopics@2021-12-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "systemTopic" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { source = azapi_resource.resourceGroup.id topicType = "Microsoft.Resources.ResourceGroups" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventGrid_topics@2021-12-01/main.tf b/dependency/azapi_examples/Microsoft.EventGrid_topics@2021-12-01/main.tf index baa29874..89728505 100644 --- a/dependency/azapi_examples/Microsoft.EventGrid_topics@2021-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventGrid_topics@2021-12-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "topic" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { disableLocalAuth = false inputSchema = "EventGridSchema" inputSchemaMapping = null publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventHub_clusters@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.EventHub_clusters@2021-11-01/main.tf index 80be53ef..c2d7b503 100644 --- a/dependency/azapi_examples/Microsoft.EventHub_clusters@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventHub_clusters@2021-11-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { sku = { capacity = 1 name = "Dedicated" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventHub_namespaces@2022-01-01-preview/main.tf b/dependency/azapi_examples/Microsoft.EventHub_namespaces@2022-01-01-preview/main.tf index 4bb3b577..b489f3ec 100644 --- a/dependency/azapi_examples/Microsoft.EventHub_namespaces@2022-01-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.EventHub_namespaces@2022-01-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -47,7 +43,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventHub_namespaces_authorizationRules@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.EventHub_namespaces_authorizationRules@2021-11-01/main.tf index 0f5a69e7..bc5cc631 100644 --- a/dependency/azapi_examples/Microsoft.EventHub_namespaces_authorizationRules@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventHub_namespaces_authorizationRules@2021-11-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -47,7 +43,7 @@ resource "azapi_resource" "namespace" { name = "Basic" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,7 +52,7 @@ resource "azapi_resource" "authorizationRule" { type = "Microsoft.EventHub/namespaces/authorizationRules@2021-11-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { rights = [ "Listen", @@ -64,7 +60,7 @@ resource "azapi_resource" "authorizationRule" { "Manage", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventHub_namespaces_disasterRecoveryConfigs@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.EventHub_namespaces_disasterRecoveryConfigs@2021-11-01/main.tf index 3b22005c..5fa3c561 100644 --- a/dependency/azapi_examples/Microsoft.EventHub_namespaces_disasterRecoveryConfigs@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventHub_namespaces_disasterRecoveryConfigs@2021-11-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -47,7 +43,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,11 +53,7 @@ resource "azapi_resource" "namespace2" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "westus2" - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -73,7 +65,7 @@ resource "azapi_resource" "namespace2" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -82,11 +74,11 @@ resource "azapi_resource" "disasterRecoveryConfig" { type = "Microsoft.EventHub/namespaces/disasterRecoveryConfigs@2021-11-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { partnerNamespace = azapi_resource.namespace2.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs@2021-11-01/main.tf index f0b46fe5..91e94117 100644 --- a/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs@2021-11-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -47,7 +43,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,13 +52,13 @@ resource "azapi_resource" "eventhub" { type = "Microsoft.EventHub/namespaces/eventhubs@2021-11-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { messageRetentionInDays = 1 partitionCount = 2 status = "Active" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs_authorizationRules@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs_authorizationRules@2021-11-01/main.tf index a18cafba..c53e3e35 100644 --- a/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs_authorizationRules@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs_authorizationRules@2021-11-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -47,7 +43,7 @@ resource "azapi_resource" "namespace" { name = "Basic" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,13 +52,13 @@ resource "azapi_resource" "eventhub" { type = "Microsoft.EventHub/namespaces/eventhubs@2021-11-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { messageRetentionInDays = 1 partitionCount = 2 status = "Active" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,13 +67,13 @@ resource "azapi_resource" "authorizationRule" { type = "Microsoft.EventHub/namespaces/eventhubs/authorizationRules@2021-11-01" parent_id = azapi_resource.eventhub.id name = var.resource_name - body = jsonencode({ + body = { properties = { rights = [ "Send", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs_consumerGroups@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs_consumerGroups@2021-11-01/main.tf index 5668362c..e5147d0a 100644 --- a/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs_consumerGroups@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventHub_namespaces_eventhubs_consumerGroups@2021-11-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -47,7 +43,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,13 +52,13 @@ resource "azapi_resource" "eventhub" { type = "Microsoft.EventHub/namespaces/eventhubs@2021-11-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { messageRetentionInDays = 1 partitionCount = 2 status = "Active" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,11 +67,11 @@ resource "azapi_resource" "consumerGroup" { type = "Microsoft.EventHub/namespaces/eventhubs/consumerGroups@2021-11-01" parent_id = azapi_resource.eventhub.id name = var.resource_name - body = jsonencode({ + body = { properties = { userMetadata = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.EventHub_namespaces_schemaGroups@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.EventHub_namespaces_schemaGroups@2021-11-01/main.tf index fae65b3b..acf10c8b 100644 --- a/dependency/azapi_examples/Microsoft.EventHub_namespaces_schemaGroups@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.EventHub_namespaces_schemaGroups@2021-11-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -47,7 +43,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,12 +52,12 @@ resource "azapi_resource" "schemaGroup" { type = "Microsoft.EventHub/namespaces/schemaGroups@2021-11-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { schemaCompatibility = "Forward" schemaType = "Avro" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.FluidRelay_fluidRelayServers@2022-05-26/main.tf b/dependency/azapi_examples/Microsoft.FluidRelay_fluidRelayServers@2022-05-26/main.tf index 7e4ef565..d5382d4a 100644 --- a/dependency/azapi_examples/Microsoft.FluidRelay_fluidRelayServers@2022-05-26/main.tf +++ b/dependency/azapi_examples/Microsoft.FluidRelay_fluidRelayServers@2022-05-26/main.tf @@ -31,17 +31,13 @@ resource "azapi_resource" "fluidRelayServer" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { } tags = { foo = "bar" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.GuestConfiguration_guestConfigurationAssignments@2020-06-25/main.tf b/dependency/azapi_examples/Microsoft.GuestConfiguration_guestConfigurationAssignments@2020-06-25/main.tf index f3566acf..c92b53b0 100644 --- a/dependency/azapi_examples/Microsoft.GuestConfiguration_guestConfigurationAssignments@2020-06-25/main.tf +++ b/dependency/azapi_examples/Microsoft.GuestConfiguration_guestConfigurationAssignments@2020-06-25/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "internal" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,7 +79,7 @@ resource "azapi_resource" "networkInterface" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enableAcceleratedNetworking = false enableIPForwarding = false @@ -95,7 +97,7 @@ resource "azapi_resource" "networkInterface" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -105,7 +107,7 @@ resource "azapi_resource" "virtualMachine" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { additionalCapabilities = { } @@ -175,7 +177,7 @@ resource "azapi_resource" "virtualMachine" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -185,7 +187,7 @@ resource "azapi_resource" "guestConfigurationAssignment" { parent_id = azapi_resource.virtualMachine.id name = "WhitelistedApplication" location = var.location - body = jsonencode({ + body = { properties = { guestConfiguration = { assignmentType = "" @@ -201,7 +203,7 @@ resource "azapi_resource" "guestConfigurationAssignment" { version = "1.*" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.HDInsight_clusters@2018-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.HDInsight_clusters@2018-06-01-preview/main.tf index a20578da..3fc9ae09 100644 --- a/dependency/azapi_examples/Microsoft.HDInsight_clusters@2018-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.HDInsight_clusters@2018-06-01-preview/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -88,13 +85,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -103,7 +100,7 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { clusterDefinition = { componentVersion = { @@ -172,7 +169,7 @@ resource "azapi_resource" "cluster" { { container = azapi_resource.container.name isDefault = true - key = jsondecode(data.azapi_resource_action.listKeys.output).keys[0].value + key = data.azapi_resource_action.listKeys.output.keys[0].value name = "${azapi_resource.storageAccount.name}.blob.core.windows.net" resourceId = azapi_resource.storageAccount.id }, @@ -180,7 +177,7 @@ resource "azapi_resource" "cluster" { } tier = "standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { diff --git a/dependency/azapi_examples/Microsoft.HealthBot_healthBots@2022-08-08/main.tf b/dependency/azapi_examples/Microsoft.HealthBot_healthBots@2022-08-08/main.tf index 01206ab0..8a553819 100644 --- a/dependency/azapi_examples/Microsoft.HealthBot_healthBots@2022-08-08/main.tf +++ b/dependency/azapi_examples/Microsoft.HealthBot_healthBots@2022-08-08/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "healthBot" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { sku = { name = "F0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.HealthcareApis_services@2022-12-01/main.tf b/dependency/azapi_examples/Microsoft.HealthcareApis_services@2022-12-01/main.tf index fe49d366..2ee82587 100644 --- a/dependency/azapi_examples/Microsoft.HealthcareApis_services@2022-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.HealthcareApis_services@2022-12-01/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "fhir" properties = { accessPolicies = [ @@ -59,7 +59,7 @@ resource "azapi_resource" "service" { } publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_dicomServices@2022-12-01/main.tf b/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_dicomServices@2022-12-01/main.tf index 2806274e..a0a25f0d 100644 --- a/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_dicomServices@2022-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_dicomServices@2022-12-01/main.tf @@ -40,15 +40,11 @@ resource "azapi_resource" "dicomService" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_fhirServices@2022-12-01/main.tf b/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_fhirServices@2022-12-01/main.tf index 1b6054e2..e5942206 100644 --- a/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_fhirServices@2022-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_fhirServices@2022-12-01/main.tf @@ -51,11 +51,7 @@ resource "azapi_resource" "fhirService" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { kind = "fhir-R4" properties = { acrConfiguration = { @@ -75,7 +71,7 @@ resource "azapi_resource" "fhirService" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -85,18 +81,14 @@ resource "azapi_resource" "fhirService2" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { kind = "fhir-R4" properties = { acrConfiguration = { } authenticationConfiguration = { - audience = jsondecode(azapi_resource.fhirService.output).properties.authenticationConfiguration.audience - authority = jsondecode(azapi_resource.fhirService.output).properties.authenticationConfiguration.authority + audience = azapi_resource.fhirService.output.properties.authenticationConfiguration.audience + authority = azapi_resource.fhirService.output.properties.authenticationConfiguration.authority smartProxyEnabled = false } corsConfiguration = { @@ -109,7 +101,7 @@ resource "azapi_resource" "fhirService2" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_iotConnectors@2022-12-01/main.tf b/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_iotConnectors@2022-12-01/main.tf index f9695d3e..d2314b50 100644 --- a/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_iotConnectors@2022-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_iotConnectors@2022-12-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -47,7 +43,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,13 +52,13 @@ resource "azapi_resource" "eventhub" { type = "Microsoft.EventHub/namespaces/eventhubs@2021-11-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { messageRetentionInDays = 1 partitionCount = 2 status = "Active" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,11 +67,11 @@ resource "azapi_resource" "consumerGroup" { type = "Microsoft.EventHub/namespaces/eventhubs/consumerGroups@2021-11-01" parent_id = azapi_resource.eventhub.id name = var.resource_name - body = jsonencode({ + body = { properties = { userMetadata = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -94,11 +90,7 @@ resource "azapi_resource" "iotConnector" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { deviceMapping = { content = { @@ -113,7 +105,7 @@ resource "azapi_resource" "iotConnector" { fullyQualifiedEventHubNamespace = "${azapi_resource.namespace.name}.servicebus.windows.net" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_iotConnectors_fhirDestinations@2022-12-01/main.tf b/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_iotConnectors_fhirDestinations@2022-12-01/main.tf index 097cda67..34d77008 100644 --- a/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_iotConnectors_fhirDestinations@2022-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.HealthcareApis_workspaces_iotConnectors_fhirDestinations@2022-12-01/main.tf @@ -42,11 +42,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -58,7 +54,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,13 +63,13 @@ resource "azapi_resource" "eventhub" { type = "Microsoft.EventHub/namespaces/eventhubs@2021-11-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { messageRetentionInDays = 1 partitionCount = 2 status = "Active" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -82,11 +78,11 @@ resource "azapi_resource" "consumerGroup" { type = "Microsoft.EventHub/namespaces/eventhubs/consumerGroups@2021-11-01" parent_id = azapi_resource.eventhub.id name = var.resource_name - body = jsonencode({ + body = { properties = { userMetadata = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -105,11 +101,7 @@ resource "azapi_resource" "fhirService" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { kind = "fhir-R4" properties = { acrConfiguration = { @@ -129,7 +121,7 @@ resource "azapi_resource" "fhirService" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -139,11 +131,7 @@ resource "azapi_resource" "iotConnector" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { deviceMapping = { content = { @@ -158,7 +146,7 @@ resource "azapi_resource" "iotConnector" { fullyQualifiedEventHubNamespace = "${azapi_resource.namespace.name}.servicebus.windows.net" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -168,7 +156,7 @@ resource "azapi_resource" "fhirDestination" { parent_id = azapi_resource.iotConnector.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { fhirMapping = { content = { @@ -180,7 +168,7 @@ resource "azapi_resource" "fhirDestination" { fhirServiceResourceId = azapi_resource.fhirService.id resourceIdentityResolutionType = "Create" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.HybridCompute_privateLinkScopes@2022-11-10/main.tf b/dependency/azapi_examples/Microsoft.HybridCompute_privateLinkScopes@2022-11-10/main.tf index 8b51b09f..39248244 100644 --- a/dependency/azapi_examples/Microsoft.HybridCompute_privateLinkScopes@2022-11-10/main.tf +++ b/dependency/azapi_examples/Microsoft.HybridCompute_privateLinkScopes@2022-11-10/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "privateLinkScope" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Disabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_actionGroups@2023-01-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_actionGroups@2023-01-01/main.tf index 5390abb0..fee66a31 100644 --- a/dependency/azapi_examples/Microsoft.Insights_actionGroups@2023-01-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_actionGroups@2023-01-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "actionGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { armRoleReceivers = [ ] @@ -58,7 +58,7 @@ resource "azapi_resource" "actionGroup" { webhookReceivers = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_activityLogAlerts@2020-10-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_activityLogAlerts@2020-10-01/main.tf index 3e6b0fdd..5a7e8d6f 100644 --- a/dependency/azapi_examples/Microsoft.Insights_activityLogAlerts@2020-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_activityLogAlerts@2020-10-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,7 +73,7 @@ resource "azapi_resource" "actionGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { armRoleReceivers = [ ] @@ -103,7 +100,7 @@ resource "azapi_resource" "actionGroup" { webhookReceivers = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -113,7 +110,7 @@ resource "azapi_resource" "actionGroup2" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { armRoleReceivers = [ ] @@ -140,7 +137,7 @@ resource "azapi_resource" "actionGroup2" { webhookReceivers = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -150,7 +147,7 @@ resource "azapi_resource" "activityLogAlert" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { actions = { actionGroups = [ @@ -219,7 +216,7 @@ resource "azapi_resource" "activityLogAlert" { azapi_resource.storageAccount.id, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_autoScaleSettings@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_autoScaleSettings@2022-10-01/main.tf index 94b79302..58022563 100644 --- a/dependency/azapi_examples/Microsoft.Insights_autoScaleSettings@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_autoScaleSettings@2022-10-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "internal" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,10 +79,7 @@ resource "azapi_resource" "virtualMachineScaleSet" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { additionalCapabilities = { } @@ -189,7 +188,7 @@ resource "azapi_resource" "virtualMachineScaleSet" { name = "Standard_F2" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -199,7 +198,7 @@ resource "azapi_resource" "autoScaleSetting" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enabled = true notifications = [ @@ -240,7 +239,7 @@ resource "azapi_resource" "autoScaleSetting" { ] targetResourceUri = azapi_resource.virtualMachineScaleSet.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_components@2020-02-02/main.tf b/dependency/azapi_examples/Microsoft.Insights_components@2020-02-02/main.tf index 20a2053f..7c257ae2 100644 --- a/dependency/azapi_examples/Microsoft.Insights_components@2020-02-02/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_components@2020-02-02/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -43,7 +43,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_components_ProactiveDetectionConfigs@2015-05-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_components_ProactiveDetectionConfigs@2015-05-01/main.tf index d7290bc8..2dce6297 100644 --- a/dependency/azapi_examples/Microsoft.Insights_components_ProactiveDetectionConfigs@2015-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_components_ProactiveDetectionConfigs@2015-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -43,7 +43,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -58,13 +58,13 @@ resource "azapi_resource_action" "ProactiveDetectionConfig" { type = "Microsoft.Insights/components/ProactiveDetectionConfigs@2015-05-01" resource_id = data.azapi_resource_id.ProactiveDetectionConfig.id method = "PUT" - body = jsonencode({ + body = { CustomEmails = [ ] Enabled = false Name = "slowpageloadtime" SendEmailsToSubscriptionOwners = true - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_dataCollectionEndpoints@2022-06-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_dataCollectionEndpoints@2022-06-01/main.tf index 476b867b..39f5695a 100644 --- a/dependency/azapi_examples/Microsoft.Insights_dataCollectionEndpoints@2022-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_dataCollectionEndpoints@2022-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "dataCollectionEndpoint" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" networkAcls = { publicNetworkAccess = "Enabled" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_dataCollectionRuleAssociations@2022-06-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_dataCollectionRuleAssociations@2022-06-01/main.tf index d09cd77c..b7fa4715 100644 --- a/dependency/azapi_examples/Microsoft.Insights_dataCollectionRuleAssociations@2022-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_dataCollectionRuleAssociations@2022-06-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = "network-230630033559397415" location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "dataCollectionRule" { @@ -56,11 +58,7 @@ resource "azapi_resource" "dataCollectionRule" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { dataFlows = [ { @@ -79,7 +77,7 @@ resource "azapi_resource" "dataCollectionRule" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -88,7 +86,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "subnet-230630033559397415" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -100,7 +98,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -110,7 +108,7 @@ resource "azapi_resource" "networkInterface" { parent_id = azapi_resource.resourceGroup.id name = "nic-230630033559397415" location = var.location - body = jsonencode({ + body = { properties = { enableAcceleratedNetworking = false enableIPForwarding = false @@ -128,7 +126,7 @@ resource "azapi_resource" "networkInterface" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -138,7 +136,7 @@ resource "azapi_resource" "virtualMachine" { parent_id = azapi_resource.resourceGroup.id name = "machine-230630033559397415" location = var.location - body = jsonencode({ + body = { properties = { additionalCapabilities = { } @@ -207,7 +205,7 @@ resource "azapi_resource" "virtualMachine" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -216,12 +214,12 @@ resource "azapi_resource" "dataCollectionRuleAssociation" { type = "Microsoft.Insights/dataCollectionRuleAssociations@2022-06-01" parent_id = azapi_resource.virtualMachine.id name = var.resource_name - body = jsonencode({ + body = { properties = { dataCollectionRuleId = azapi_resource.dataCollectionRule.id description = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_dataCollectionRules@2022-06-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_dataCollectionRules@2022-06-01/main.tf index 2de0503a..315d3931 100644 --- a/dependency/azapi_examples/Microsoft.Insights_dataCollectionRules@2022-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_dataCollectionRules@2022-06-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "dataCollectionRule" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { dataFlows = [ { @@ -54,7 +50,7 @@ resource "azapi_resource" "dataCollectionRule" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_diagnosticSettings@2021-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Insights_diagnosticSettings@2021-05-01-preview/main.tf index 7b854325..5f7fd847 100644 --- a/dependency/azapi_examples/Microsoft.Insights_diagnosticSettings@2021-05-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_diagnosticSettings@2021-05-01-preview/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { accessPolicies = [ ] @@ -59,7 +59,7 @@ resource "azapi_resource" "vault" { } tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -69,11 +69,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false isAutoInflateEnabled = false @@ -85,7 +81,7 @@ resource "azapi_resource" "namespace" { name = "Basic" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -94,7 +90,7 @@ resource "azapi_resource" "authorizationRule" { type = "Microsoft.EventHub/namespaces/authorizationRules@2021-11-01" parent_id = azapi_resource.namespace.id name = "example" - body = jsonencode({ + body = { properties = { rights = [ "Listen", @@ -102,7 +98,7 @@ resource "azapi_resource" "authorizationRule" { "Manage", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -111,7 +107,7 @@ resource "azapi_resource" "diagnosticSetting" { type = "Microsoft.Insights/diagnosticSettings@2021-05-01-preview" parent_id = azapi_resource.vault.id name = var.resource_name - body = jsonencode({ + body = { properties = { eventHubAuthorizationRuleId = azapi_resource.authorizationRule.id eventHubName = azapi_resource.namespace.name @@ -136,7 +132,7 @@ resource "azapi_resource" "diagnosticSetting" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_logProfiles@2016-03-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_logProfiles@2016-03-01/main.tf index 5e7c8a0f..a74ef9ab 100644 --- a/dependency/azapi_examples/Microsoft.Insights_logProfiles@2016-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_logProfiles@2016-03-01/main.tf @@ -42,10 +42,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -77,7 +74,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -87,7 +84,7 @@ resource "azapi_resource" "logProfile" { parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" name = var.resource_name location = "" - body = jsonencode({ + body = { properties = { categories = [ "Action", @@ -102,7 +99,7 @@ resource "azapi_resource" "logProfile" { } storageAccountId = azapi_resource.storageAccount.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_metricAlerts@2018-03-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_metricAlerts@2018-03-01/main.tf index d48390dd..1e967503 100644 --- a/dependency/azapi_examples/Microsoft.Insights_metricAlerts@2018-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_metricAlerts@2018-03-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,7 +73,7 @@ resource "azapi_resource" "metricAlert" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { actions = [ ] @@ -115,7 +112,7 @@ resource "azapi_resource" "metricAlert" { terraform = "Coolllll" test = "123" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_privateLinkScopes@2019-10-17-preview/main.tf b/dependency/azapi_examples/Microsoft.Insights_privateLinkScopes@2019-10-17-preview/main.tf index 6d4020fb..5525790a 100644 --- a/dependency/azapi_examples/Microsoft.Insights_privateLinkScopes@2019-10-17-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_privateLinkScopes@2019-10-17-preview/main.tf @@ -31,10 +31,10 @@ resource "azapi_resource" "privateLinkScope" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "Global" - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_privateLinkScopes_scopedResources@2019-10-17-preview/main.tf b/dependency/azapi_examples/Microsoft.Insights_privateLinkScopes_scopedResources@2019-10-17-preview/main.tf index 7cce2f85..4b4526b6 100644 --- a/dependency/azapi_examples/Microsoft.Insights_privateLinkScopes_scopedResources@2019-10-17-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_privateLinkScopes_scopedResources@2019-10-17-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -43,7 +43,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,10 +53,10 @@ resource "azapi_resource" "privateLinkScope" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "Global" - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -65,11 +65,11 @@ resource "azapi_resource" "scopedResource" { type = "Microsoft.Insights/privateLinkScopes/scopedResources@2019-10-17-preview" parent_id = azapi_resource.privateLinkScope.id name = var.resource_name - body = jsonencode({ + body = { properties = { linkedResourceId = azapi_resource.component.id } - }) + } schema_validation_enabled = false ignore_casing = true response_export_values = ["*"] diff --git a/dependency/azapi_examples/Microsoft.Insights_scheduledQueryRules@2018-04-16/main.tf b/dependency/azapi_examples/Microsoft.Insights_scheduledQueryRules@2018-04-16/main.tf index 2fb3a133..512419f7 100644 --- a/dependency/azapi_examples/Microsoft.Insights_scheduledQueryRules@2018-04-16/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_scheduledQueryRules@2018-04-16/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,7 +57,7 @@ resource "azapi_resource" "scheduledQueryRule" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { action = { criteria = [ @@ -84,7 +84,7 @@ resource "azapi_resource" "scheduledQueryRule" { dataSourceId = azapi_resource.workspace.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_scheduledQueryRules@2021-08-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_scheduledQueryRules@2021-08-01/main.tf index 5c34f7dd..70c40622 100644 --- a/dependency/azapi_examples/Microsoft.Insights_scheduledQueryRules@2021-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_scheduledQueryRules@2021-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -43,7 +43,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,7 +53,7 @@ resource "azapi_resource" "scheduledQueryRule" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "LogAlert" properties = { autoMitigate = false @@ -80,7 +80,7 @@ resource "azapi_resource" "scheduledQueryRule" { windowSize = "PT5M" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_webTests@2022-06-15/main.tf b/dependency/azapi_examples/Microsoft.Insights_webTests@2022-06-15/main.tf index be2cd97f..285c41b7 100644 --- a/dependency/azapi_examples/Microsoft.Insights_webTests@2022-06-15/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_webTests@2022-06-15/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -43,7 +43,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,7 +53,7 @@ resource "azapi_resource" "webTest" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "standard" properties = { Description = "" @@ -93,7 +93,7 @@ resource "azapi_resource" "webTest" { tags = { "hidden-link:${azapi_resource.component.id}" = "Resource" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_webtests@2015-05-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_webtests@2015-05-01/main.tf index 21966c5a..8af23237 100644 --- a/dependency/azapi_examples/Microsoft.Insights_webtests@2015-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_webtests@2015-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -43,7 +43,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -63,7 +63,7 @@ resource "azapi_resource" "webtest" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "ping" properties = { Configuration = { @@ -86,7 +86,7 @@ resource "azapi_resource" "webtest" { tags = { "hidden-link:${azapi_resource.component.id}" = "Resource" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_workbookTemplates@2020-11-20/main.tf b/dependency/azapi_examples/Microsoft.Insights_workbookTemplates@2020-11-20/main.tf index 0e45f25d..deae62fb 100644 --- a/dependency/azapi_examples/Microsoft.Insights_workbookTemplates@2020-11-20/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_workbookTemplates@2020-11-20/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workbookTemplate" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { galleries = [ { @@ -60,7 +60,7 @@ resource "azapi_resource" "workbookTemplate" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Insights_workbooks@2022-04-01/main.tf b/dependency/azapi_examples/Microsoft.Insights_workbooks@2022-04-01/main.tf index 97c7761e..a0658b78 100644 --- a/dependency/azapi_examples/Microsoft.Insights_workbooks@2022-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Insights_workbooks@2022-04-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "workbook" { parent_id = azapi_resource.resourceGroup.id name = "be1ad266-d329-4454-b693-8287e4d3b35d" location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { kind = "shared" properties = { category = "workbook" @@ -43,7 +39,7 @@ resource "azapi_resource" "workbook" { serializedData = "{\"fallbackResourceIds\":[\"Azure Monitor\"],\"isLocked\":false,\"items\":[{\"content\":{\"json\":\"Test2022\"},\"name\":\"text - 0\",\"type\":1}],\"version\":\"Notebook/1.0\"}" sourceId = "azure monitor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.IoTCentral_iotApps@2021-11-01-preview/main.tf b/dependency/azapi_examples/Microsoft.IoTCentral_iotApps@2021-11-01-preview/main.tf index dbb2ca9c..da52fb9e 100644 --- a/dependency/azapi_examples/Microsoft.IoTCentral_iotApps@2021-11-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.IoTCentral_iotApps@2021-11-01-preview/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "iotApp" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { displayName = var.resource_name publicNetworkAccess = "Enabled" @@ -44,7 +41,7 @@ resource "azapi_resource" "iotApp" { sku = { name = "ST1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.KeyVault_managedHSMs@2021-10-01/main.tf b/dependency/azapi_examples/Microsoft.KeyVault_managedHSMs@2021-10-01/main.tf index 0ee9068b..d7546bb5 100644 --- a/dependency/azapi_examples/Microsoft.KeyVault_managedHSMs@2021-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.KeyVault_managedHSMs@2021-10-01/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "managedHSM" { parent_id = azapi_resource.resourceGroup.id name = "kvHsm230630033342437496" location = var.location - body = jsonencode({ + body = { properties = { createMode = "default" enablePurgeProtection = false @@ -58,7 +58,7 @@ resource "azapi_resource" "managedHSM" { family = "B" name = "Standard_B1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.KeyVault_vaults@2021-10-01/main.tf b/dependency/azapi_examples/Microsoft.KeyVault_vaults@2021-10-01/main.tf index a401a4f0..37f6f1e1 100644 --- a/dependency/azapi_examples/Microsoft.KeyVault_vaults@2021-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.KeyVault_vaults@2021-10-01/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { accessPolicies = [ { @@ -77,7 +77,7 @@ resource "azapi_resource" "vault" { softDeleteRetentionInDays = 7 tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.KeyVault_vaults_accessPolicies@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.KeyVault_vaults_accessPolicies@2023-02-01/main.tf index fc89ba91..2f0caa5d 100644 --- a/dependency/azapi_examples/Microsoft.KeyVault_vaults_accessPolicies@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.KeyVault_vaults_accessPolicies@2023-02-01/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { sku = { family = "A" @@ -52,17 +52,19 @@ resource "azapi_resource" "vault" { enableSoftDelete = true tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.accessPolicies"] + lifecycle { + ignore_changes = [body.properties.accessPolicies] + } } resource "azapi_resource_action" "put_accessPolicy" { type = "Microsoft.KeyVault/vaults/accessPolicies@2023-02-01" resource_id = "${azapi_resource.vault.id}/accessPolicies/add" method = "PUT" - body = jsonencode({ + body = { properties = { accessPolicies = [ { @@ -84,7 +86,7 @@ resource "azapi_resource_action" "put_accessPolicy" { }, ] } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.KeyVault_vaults_keys@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.KeyVault_vaults_keys@2023-02-01/main.tf index 2b140d16..a3e92a30 100644 --- a/dependency/azapi_examples/Microsoft.KeyVault_vaults_keys@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.KeyVault_vaults_keys@2023-02-01/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { sku = { family = "A" @@ -53,17 +53,19 @@ resource "azapi_resource" "vault" { enablePurgeProtection = true tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.accessPolicies"] + lifecycle { + ignore_changes = [body.properties.accessPolicies] + } } resource "azapi_resource_action" "put_accessPolicy" { type = "Microsoft.KeyVault/vaults/accessPolicies@2023-02-01" resource_id = "${azapi_resource.vault.id}/accessPolicies/add" method = "PUT" - body = jsonencode({ + body = { properties = { accessPolicies = [ { @@ -85,7 +87,7 @@ resource "azapi_resource_action" "put_accessPolicy" { }, ] } - }) + } response_export_values = ["*"] } @@ -99,13 +101,13 @@ resource "azapi_resource_action" "put_key" { type = "Microsoft.KeyVault/vaults/keys@2023-02-01" resource_id = data.azapi_resource_id.key.id method = "PUT" - body = jsonencode({ + body = { properties = { keySize = 2048 kty = "RSA" keyOps = ["encrypt", "decrypt", "sign", "verify", "wrapKey", "unwrapKey"] } - }) + } response_export_values = ["*"] depends_on = [azapi_resource_action.put_accessPolicy] } diff --git a/dependency/azapi_examples/Microsoft.KeyVault_vaults_secrets@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.KeyVault_vaults_secrets@2023-02-01/main.tf index 6d019257..25e97bbf 100644 --- a/dependency/azapi_examples/Microsoft.KeyVault_vaults_secrets@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.KeyVault_vaults_secrets@2023-02-01/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { sku = { family = "A" @@ -52,10 +52,12 @@ resource "azapi_resource" "vault" { enableSoftDelete = true tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.accessPolicies"] + lifecycle { + ignore_changes = [body.properties.accessPolicies] + } } data "azapi_resource_id" "secret" { @@ -68,10 +70,10 @@ resource "azapi_resource_action" "put_secret" { type = "Microsoft.KeyVault/vaults/secrets@2023-02-01" resource_id = data.azapi_resource_id.secret.id method = "PUT" - body = jsonencode({ + body = { properties = { value = "szechuan" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.KubernetesConfiguration_extensions@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.KubernetesConfiguration_extensions@2022-11-01/main.tf index ca672dd5..9afa7a3b 100644 --- a/dependency/azapi_examples/Microsoft.KubernetesConfiguration_extensions@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.KubernetesConfiguration_extensions@2022-11-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "managedCluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { agentPoolProfiles = [ { @@ -47,7 +47,7 @@ resource "azapi_resource" "managedCluster" { ] dnsPrefix = var.resource_name } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,12 +56,12 @@ resource "azapi_resource" "extension" { type = "Microsoft.KubernetesConfiguration/extensions@2022-11-01" parent_id = azapi_resource.managedCluster.id name = var.resource_name - body = jsonencode({ + body = { properties = { autoUpgradeMinorVersion = true extensionType = "microsoft.flux" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Kusto_clusters@2022-12-29/main.tf b/dependency/azapi_examples/Microsoft.Kusto_clusters@2022-12-29/main.tf index 3abdaef9..3f8571d5 100644 --- a/dependency/azapi_examples/Microsoft.Kusto_clusters@2022-12-29/main.tf +++ b/dependency/azapi_examples/Microsoft.Kusto_clusters@2022-12-29/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { enableAutoStop = true enableDiskEncryption = false @@ -54,7 +50,7 @@ resource "azapi_resource" "cluster" { name = "Dev(No SLA)_Standard_D11_v2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Kusto_clusters@2023-05-02/main.tf b/dependency/azapi_examples/Microsoft.Kusto_clusters@2023-05-02/main.tf index 59e6f635..367a0faf 100644 --- a/dependency/azapi_examples/Microsoft.Kusto_clusters@2023-05-02/main.tf +++ b/dependency/azapi_examples/Microsoft.Kusto_clusters@2023-05-02/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { enableAutoStop = true enableDiskEncryption = false @@ -54,7 +50,7 @@ resource "azapi_resource" "cluster" { name = "Dev(No SLA)_Standard_D11_v2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Kusto_clusters_databases@2022-12-29/main.tf b/dependency/azapi_examples/Microsoft.Kusto_clusters_databases@2022-12-29/main.tf index f0865ce4..f00aeeb9 100644 --- a/dependency/azapi_examples/Microsoft.Kusto_clusters_databases@2022-12-29/main.tf +++ b/dependency/azapi_examples/Microsoft.Kusto_clusters_databases@2022-12-29/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { enableAutoStop = true enableDiskEncryption = false @@ -54,7 +50,7 @@ resource "azapi_resource" "cluster" { name = "Dev(No SLA)_Standard_D11_v2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,11 +60,11 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.cluster.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "ReadWrite" properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Kusto_clusters_databases@2023-05-02/main.tf b/dependency/azapi_examples/Microsoft.Kusto_clusters_databases@2023-05-02/main.tf index add7cfbd..6f24bb4d 100644 --- a/dependency/azapi_examples/Microsoft.Kusto_clusters_databases@2023-05-02/main.tf +++ b/dependency/azapi_examples/Microsoft.Kusto_clusters_databases@2023-05-02/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { enableAutoStop = true enableDiskEncryption = false @@ -54,7 +50,7 @@ resource "azapi_resource" "cluster" { name = "Dev(No SLA)_Standard_D11_v2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,11 +60,11 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.cluster.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "ReadWrite" properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_principalAssignments@2023-05-02/main.tf b/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_principalAssignments@2023-05-02/main.tf index ea2fd5ac..34f26d7d 100644 --- a/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_principalAssignments@2023-05-02/main.tf +++ b/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_principalAssignments@2023-05-02/main.tf @@ -42,11 +42,7 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { enableAutoStop = true enableDiskEncryption = false @@ -65,7 +61,7 @@ resource "azapi_resource" "cluster" { name = "Dev(No SLA)_Standard_D11_v2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -75,11 +71,11 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.cluster.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "ReadWrite" properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -88,14 +84,14 @@ resource "azapi_resource" "principalAssignment" { type = "Microsoft.Kusto/clusters/databases/principalAssignments@2023-05-02" parent_id = azapi_resource.database.id name = var.resource_name - body = jsonencode({ + body = { properties = { principalId = data.azurerm_client_config.current.client_id principalType = "App" role = "Viewer" tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_scripts@2022-12-29/main.tf b/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_scripts@2022-12-29/main.tf index 56ca8fab..95aa2099 100644 --- a/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_scripts@2022-12-29/main.tf +++ b/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_scripts@2022-12-29/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { enableAutoStop = true enableDiskEncryption = false @@ -54,7 +54,7 @@ resource "azapi_resource" "cluster" { name = "Dev(No SLA)_Standard_D11_v2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,11 +64,11 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.cluster.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "ReadWrite" properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,13 +77,13 @@ resource "azapi_resource" "script" { type = "Microsoft.Kusto/clusters/databases/scripts@2022-12-29" parent_id = azapi_resource.database.id name = "create-table-script" - body = jsonencode({ + body = { properties = { continueOnErrors = false forceUpdateTag = "9e2e7874-aa37-7041-81b7-06397f03a37d" scriptContent = ".create table TestTable(Id:string, Name:string, _ts:long, _timestamp:datetime)\n.create table TestTable ingestion json mapping \"TestMapping\"\n'['\n' {\"column\":\"Id\",\"path\":\"$.id\"},'\n' {\"column\":\"Name\",\"path\":\"$.name\"},'\n' {\"column\":\"_ts\",\"path\":\"$._ts\"},'\n' {\"column\":\"_timestamp\",\"path\":\"$._ts\", \"transform\":\"DateTimeFromUnixSeconds\"}'\n']'\n.alter table TestTable policy ingestionbatching \"{'MaximumBatchingTimeSpan': '0:0:10', 'MaximumNumberOfItems': 10000}\"\n" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_scripts@2023-05-02/main.tf b/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_scripts@2023-05-02/main.tf index 7e59e5d7..06a4b012 100644 --- a/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_scripts@2023-05-02/main.tf +++ b/dependency/azapi_examples/Microsoft.Kusto_clusters_databases_scripts@2023-05-02/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { enableAutoStop = true enableDiskEncryption = false @@ -54,7 +54,7 @@ resource "azapi_resource" "cluster" { name = "Dev(No SLA)_Standard_D11_v2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,11 +64,11 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.cluster.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "ReadWrite" properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,13 +77,13 @@ resource "azapi_resource" "script" { type = "Microsoft.Kusto/clusters/databases/scripts@2023-05-02" parent_id = azapi_resource.database.id name = "create-table-script" - body = jsonencode({ + body = { properties = { continueOnErrors = false forceUpdateTag = "9e2e7874-aa37-7041-81b7-06397f03a37d" scriptContent = ".create table TestTable(Id:string, Name:string, _ts:long, _timestamp:datetime)\n.create table TestTable ingestion json mapping \"TestMapping\"\n'['\n' {\"column\":\"Id\",\"path\":\"$.id\"},'\n' {\"column\":\"Name\",\"path\":\"$.name\"},'\n' {\"column\":\"_ts\",\"path\":\"$._ts\"},'\n' {\"column\":\"_timestamp\",\"path\":\"$._ts\", \"transform\":\"DateTimeFromUnixSeconds\"}'\n']'\n.alter table TestTable policy ingestionbatching \"{'MaximumBatchingTimeSpan': '0:0:10', 'MaximumNumberOfItems': 10000}\"\n" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Kusto_clusters_managedPrivateEndpoints@2023-05-02/main.tf b/dependency/azapi_examples/Microsoft.Kusto_clusters_managedPrivateEndpoints@2023-05-02/main.tf index 193e2be9..3dc012a4 100644 --- a/dependency/azapi_examples/Microsoft.Kusto_clusters_managedPrivateEndpoints@2023-05-02/main.tf +++ b/dependency/azapi_examples/Microsoft.Kusto_clusters_managedPrivateEndpoints@2023-05-02/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,11 +73,7 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { enableAutoStop = true enableDiskEncryption = false @@ -99,7 +92,7 @@ resource "azapi_resource" "cluster" { name = "Dev(No SLA)_Standard_D11_v2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -108,12 +101,12 @@ resource "azapi_resource" "managedPrivateEndpoint" { type = "Microsoft.Kusto/clusters/managedPrivateEndpoints@2023-05-02" parent_id = azapi_resource.cluster.id name = var.resource_name - body = jsonencode({ + body = { properties = { groupId = "blob" privateLinkResourceId = azapi_resource.storageAccount.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Kusto_clusters_principalAssignments@2023-05-02/main.tf b/dependency/azapi_examples/Microsoft.Kusto_clusters_principalAssignments@2023-05-02/main.tf index df6955e7..47467cb8 100644 --- a/dependency/azapi_examples/Microsoft.Kusto_clusters_principalAssignments@2023-05-02/main.tf +++ b/dependency/azapi_examples/Microsoft.Kusto_clusters_principalAssignments@2023-05-02/main.tf @@ -42,11 +42,7 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { enableAutoStop = true enableDiskEncryption = false @@ -65,7 +61,7 @@ resource "azapi_resource" "cluster" { name = "Dev(No SLA)_Standard_D11_v2" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -74,14 +70,14 @@ resource "azapi_resource" "principalAssignment" { type = "Microsoft.Kusto/clusters/principalAssignments@2023-05-02" parent_id = azapi_resource.cluster.id name = var.resource_name - body = jsonencode({ + body = { properties = { principalId = data.azurerm_client_config.current.client_id principalType = "App" role = "AllDatabasesViewer" tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.LabServices_labPlans@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.LabServices_labPlans@2022-08-01/main.tf index bbf5be20..545e56af 100644 --- a/dependency/azapi_examples/Microsoft.LabServices_labPlans@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.LabServices_labPlans@2022-08-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "labPlan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowedRegions = [ var.location, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.LabServices_labs@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.LabServices_labs@2022-08-01/main.tf index 1918d294..1fbae8d9 100644 --- a/dependency/azapi_examples/Microsoft.LabServices_labs@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.LabServices_labs@2022-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "lab" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoShutdownProfile = { shutdownOnDisconnect = "Disabled" @@ -72,7 +72,7 @@ resource "azapi_resource" "lab" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.LabServices_labs_schedules@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.LabServices_labs_schedules@2022-08-01/main.tf index 96de30e6..f47a5dc4 100644 --- a/dependency/azapi_examples/Microsoft.LabServices_labs_schedules@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.LabServices_labs_schedules@2022-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "lab" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoShutdownProfile = { shutdownOnDisconnect = "Disabled" @@ -72,7 +72,7 @@ resource "azapi_resource" "lab" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -81,12 +81,12 @@ resource "azapi_resource" "schedule" { type = "Microsoft.LabServices/labs/schedules@2022-08-01" parent_id = azapi_resource.lab.id name = var.resource_name - body = jsonencode({ + body = { properties = { stopAt = "2023-06-30T04:33:55Z" timeZoneId = "America/Los_Angeles" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.LabServices_labs_users@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.LabServices_labs_users@2022-08-01/main.tf index e5e83d5e..d8155748 100644 --- a/dependency/azapi_examples/Microsoft.LabServices_labs_users@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.LabServices_labs_users@2022-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "lab" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoShutdownProfile = { shutdownOnDisconnect = "Disabled" @@ -72,7 +72,7 @@ resource "azapi_resource" "lab" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -81,12 +81,12 @@ resource "azapi_resource" "user" { type = "Microsoft.LabServices/labs/users@2022-08-01" parent_id = azapi_resource.lab.id name = var.resource_name - body = jsonencode({ + body = { properties = { additionalUsageQuota = "PT0S" email = "terraform-acctest@hashicorp.com" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.LoadTestService_loadTests@2022-12-01/main.tf b/dependency/azapi_examples/Microsoft.LoadTestService_loadTests@2022-12-01/main.tf index 9c0318f7..8b69f602 100644 --- a/dependency/azapi_examples/Microsoft.LoadTestService_loadTests@2022-12-01/main.tf +++ b/dependency/azapi_examples/Microsoft.LoadTestService_loadTests@2022-12-01/main.tf @@ -36,11 +36,11 @@ resource "azapi_resource" "loadTest" { identity_ids = [] } - body = jsonencode({ + body = { properties = { description = "This is new load test" } - }) + } tags = { Team = "Dev Exp" diff --git a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts@2019-05-01/main.tf b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts@2019-05-01/main.tf index cdbaf7ab..f7be028f 100644 --- a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts@2019-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts@2019-05-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "integrationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_agreements@2019-05-01/main.tf b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_agreements@2019-05-01/main.tf index da23200f..acbdb7d8 100644 --- a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_agreements@2019-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_agreements@2019-05-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "integrationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,7 +46,7 @@ resource "azapi_resource" "partner" { type = "Microsoft.Logic/integrationAccounts/partners@2019-05-01" parent_id = azapi_resource.integrationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { content = { b2b = { @@ -60,7 +60,7 @@ resource "azapi_resource" "partner" { } partnerType = "B2B" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -69,7 +69,7 @@ resource "azapi_resource" "partner2" { type = "Microsoft.Logic/integrationAccounts/partners@2019-05-01" parent_id = azapi_resource.integrationAccount.id name = "${var.resource_name}another" - body = jsonencode({ + body = { properties = { content = { b2b = { @@ -83,7 +83,7 @@ resource "azapi_resource" "partner2" { } partnerType = "B2B" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -92,7 +92,7 @@ resource "azapi_resource" "agreement" { type = "Microsoft.Logic/integrationAccounts/agreements@2019-05-01" parent_id = azapi_resource.integrationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { agreementType = "AS2" content = { @@ -240,7 +240,7 @@ resource "azapi_resource" "agreement" { } hostPartner = azapi_resource.partner.name } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_batchConfigurations@2019-05-01/main.tf b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_batchConfigurations@2019-05-01/main.tf index d694d438..edbc135f 100644 --- a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_batchConfigurations@2019-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_batchConfigurations@2019-05-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "integrationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,14 +46,14 @@ resource "azapi_resource" "batchConfiguration" { type = "Microsoft.Logic/integrationAccounts/batchConfigurations@2019-05-01" parent_id = azapi_resource.integrationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { batchGroupName = "TestBatchGroup" releaseCriteria = { messageCount = 80 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_maps@2019-05-01/main.tf b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_maps@2019-05-01/main.tf index ff4fa87a..97be14bc 100644 --- a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_maps@2019-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_maps@2019-05-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "integrationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,13 +46,13 @@ resource "azapi_resource" "map" { type = "Microsoft.Logic/integrationAccounts/maps@2019-05-01" parent_id = azapi_resource.integrationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { content = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" contentType = "application/xml" mapType = "Xslt" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_partners@2019-05-01/main.tf b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_partners@2019-05-01/main.tf index 8e8f44ae..a09c7e3e 100644 --- a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_partners@2019-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_partners@2019-05-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "integrationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,7 +46,7 @@ resource "azapi_resource" "partner" { type = "Microsoft.Logic/integrationAccounts/partners@2019-05-01" parent_id = azapi_resource.integrationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { content = { b2b = { @@ -60,7 +60,7 @@ resource "azapi_resource" "partner" { } partnerType = "B2B" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_schemas@2019-05-01/main.tf b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_schemas@2019-05-01/main.tf index f875a9b0..8963197e 100644 --- a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_schemas@2019-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_schemas@2019-05-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "integrationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,13 +46,13 @@ resource "azapi_resource" "schema" { type = "Microsoft.Logic/integrationAccounts/schemas@2019-05-01" parent_id = azapi_resource.integrationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { content = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" contentType = "application/xml" schemaType = "Xml" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_sessions@2019-05-01/main.tf b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_sessions@2019-05-01/main.tf index 87b56807..b2178169 100644 --- a/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_sessions@2019-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Logic_integrationAccounts_sessions@2019-05-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "integrationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,11 +46,11 @@ resource "azapi_resource" "session" { type = "Microsoft.Logic/integrationAccounts/sessions@2019-05-01" parent_id = azapi_resource.integrationAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { content = "\t{\n \"controlNumber\": \"1234\"\n }\n" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Logic_workflows@2019-05-01/main.tf b/dependency/azapi_examples/Microsoft.Logic_workflows@2019-05-01/main.tf index 3ae671cb..a58dde05 100644 --- a/dependency/azapi_examples/Microsoft.Logic_workflows@2019-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Logic_workflows@2019-05-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "workflow" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { definition = { "$schema" = "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#" @@ -50,6 +46,6 @@ resource "azapi_resource" "workflow" { } state = "Enabled" } - }) + } } diff --git a/dependency/azapi_examples/Microsoft.MachineLearningServices_workspaces@2022-05-01/main.tf b/dependency/azapi_examples/Microsoft.MachineLearningServices_workspaces@2022-05-01/main.tf index 36c30508..a017d161 100644 --- a/dependency/azapi_examples/Microsoft.MachineLearningServices_workspaces@2022-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MachineLearningServices_workspaces@2022-05-01/main.tf @@ -35,11 +35,11 @@ resource "azapi_resource" "resourceGroup" { type = "Microsoft.Resources/resourceGroups@2020-06-01" name = var.resource_name location = var.location - body = jsonencode({ + body = { tags = { stage = "test" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,10 +49,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -84,7 +81,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -94,7 +91,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -106,7 +103,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -116,7 +113,7 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { accessPolicies = [ { @@ -150,7 +147,7 @@ resource "azapi_resource" "vault" { } tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -160,11 +157,11 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { applicationInsights = azapi_resource.component.id keyVault = azapi_resource.vault.id @@ -176,7 +173,7 @@ resource "azapi_resource" "workspace" { name = "Basic" tier = "Basic" } - }) + } ignore_casing = true schema_validation_enabled = false response_export_values = ["*"] diff --git a/dependency/azapi_examples/Microsoft.MachineLearningServices_workspaces_computes@2022-05-01/main.tf b/dependency/azapi_examples/Microsoft.MachineLearningServices_workspaces_computes@2022-05-01/main.tf index 5f56d421..72f64338 100644 --- a/dependency/azapi_examples/Microsoft.MachineLearningServices_workspaces_computes@2022-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MachineLearningServices_workspaces_computes@2022-05-01/main.tf @@ -35,11 +35,11 @@ resource "azapi_resource" "resourceGroup" { type = "Microsoft.Resources/resourceGroups@2020-06-01" name = var.resource_name location = var.location - body = jsonencode({ + body = { tags = { stage = "test" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,12 +49,12 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +64,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -76,7 +76,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -86,7 +86,7 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { accessPolicies = [] createMode = "default" @@ -103,10 +103,12 @@ resource "azapi_resource" "vault" { } tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.accessPolicies"] + lifecycle { + ignore_changes = [body.properties.accessPolicies] + } } resource "azapi_resource" "workspace" { @@ -114,11 +116,11 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { applicationInsights = azapi_resource.component.id keyVault = azapi_resource.vault.id @@ -130,7 +132,7 @@ resource "azapi_resource" "workspace" { name = "Basic" tier = "Basic" } - }) + } schema_validation_enabled = false ignore_casing = true response_export_values = ["*"] @@ -141,11 +143,7 @@ resource "azapi_resource" "compute" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { computeLocation = "westeurope" computeType = "ComputeInstance" @@ -155,7 +153,7 @@ resource "azapi_resource" "compute" { vmSize = "STANDARD_D2_V2" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Maintenance_configurationAssignments@2022-07-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Maintenance_configurationAssignments@2022-07-01-preview/main.tf index b4231864..b3205b3f 100644 --- a/dependency/azapi_examples/Microsoft.Maintenance_configurationAssignments@2022-07-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Maintenance_configurationAssignments@2022-07-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "maintenanceConfiguration" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { extensionProperties = { } @@ -39,7 +39,7 @@ resource "azapi_resource" "maintenanceConfiguration" { namespace = "Microsoft.Maintenance" visibility = "Custom" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,7 +49,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -63,17 +63,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "internal" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -85,7 +87,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -95,7 +97,7 @@ resource "azapi_resource" "networkInterface" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enableAcceleratedNetworking = false enableIPForwarding = false @@ -113,7 +115,7 @@ resource "azapi_resource" "networkInterface" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -123,7 +125,7 @@ resource "azapi_resource" "virtualMachine" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { additionalCapabilities = { } @@ -192,7 +194,7 @@ resource "azapi_resource" "virtualMachine" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -201,13 +203,13 @@ resource "azapi_resource" "configurationAssignment" { type = "Microsoft.Maintenance/configurationAssignments@2022-07-01-preview" parent_id = azapi_resource.virtualMachine.id name = var.resource_name - body = jsonencode({ + body = { location = "westeurope" properties = { maintenanceConfigurationId = azapi_resource.maintenanceConfiguration.id resourceId = azapi_resource.virtualMachine.id } - }) + } ignore_casing = true schema_validation_enabled = false response_export_values = ["*"] diff --git a/dependency/azapi_examples/Microsoft.Maintenance_maintenanceConfigurations@2022-07-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Maintenance_maintenanceConfigurations@2022-07-01-preview/main.tf index a17022ff..d76a83ec 100644 --- a/dependency/azapi_examples/Microsoft.Maintenance_maintenanceConfigurations@2022-07-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Maintenance_maintenanceConfigurations@2022-07-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "maintenanceConfiguration" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { extensionProperties = { } @@ -39,7 +39,7 @@ resource "azapi_resource" "maintenanceConfiguration" { namespace = "Microsoft.Maintenance" visibility = "Custom" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Maps_accounts@2021-02-01/main.tf b/dependency/azapi_examples/Microsoft.Maps_accounts@2021-02-01/main.tf index f3a6785f..7f40b087 100644 --- a/dependency/azapi_examples/Microsoft.Maps_accounts@2021-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Maps_accounts@2021-02-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "account" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { sku = { name = "G2" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Maps_accounts_creators@2021-02-01/main.tf b/dependency/azapi_examples/Microsoft.Maps_accounts_creators@2021-02-01/main.tf index 4c67b18e..5c4b0eef 100644 --- a/dependency/azapi_examples/Microsoft.Maps_accounts_creators@2021-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Maps_accounts_creators@2021-02-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "account" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { sku = { name = "G2" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -45,11 +45,11 @@ resource "azapi_resource" "creator" { parent_id = azapi_resource.account.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { storageUnits = 1 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Media_mediaServices@2021-11-01/main.tf b/dependency/azapi_examples/Microsoft.Media_mediaServices@2021-11-01/main.tf index 8ca98c75..ad345b67 100644 --- a/dependency/azapi_examples/Microsoft.Media_mediaServices@2021-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Media_mediaServices@2021-11-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,10 +73,7 @@ resource "azapi_resource" "mediaService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { publicNetworkAccess = "Enabled" storageAccounts = [ @@ -89,7 +83,7 @@ resource "azapi_resource" "mediaService" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Media_mediaServices_accountFilters@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.Media_mediaServices_accountFilters@2022-08-01/main.tf index 020a2e93..a221e521 100644 --- a/dependency/azapi_examples/Microsoft.Media_mediaServices_accountFilters@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Media_mediaServices_accountFilters@2022-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,10 +73,7 @@ resource "azapi_resource" "mediaService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { publicNetworkAccess = "Enabled" storageAccounts = [ @@ -89,7 +83,7 @@ resource "azapi_resource" "mediaService" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,12 +92,12 @@ resource "azapi_resource" "accountFilter" { type = "Microsoft.Media/mediaServices/accountFilters@2022-08-01" parent_id = azapi_resource.mediaService.id name = "Filter-1" - body = jsonencode({ + body = { properties = { tracks = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Media_mediaServices_assets@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.Media_mediaServices_assets@2022-08-01/main.tf index 7963a03a..d88e8ae3 100644 --- a/dependency/azapi_examples/Microsoft.Media_mediaServices_assets@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Media_mediaServices_assets@2022-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,10 +73,7 @@ resource "azapi_resource" "mediaService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { publicNetworkAccess = "Enabled" storageAccounts = [ @@ -89,7 +83,7 @@ resource "azapi_resource" "mediaService" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,11 +92,11 @@ resource "azapi_resource" "asset" { type = "Microsoft.Media/mediaServices/assets@2022-08-01" parent_id = azapi_resource.mediaService.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Media_mediaServices_assets_assetFilters@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.Media_mediaServices_assets_assetFilters@2022-08-01/main.tf index ed3eb478..4c2c3d9e 100644 --- a/dependency/azapi_examples/Microsoft.Media_mediaServices_assets_assetFilters@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Media_mediaServices_assets_assetFilters@2022-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,10 +73,7 @@ resource "azapi_resource" "mediaService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { publicNetworkAccess = "Enabled" storageAccounts = [ @@ -89,7 +83,7 @@ resource "azapi_resource" "mediaService" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,11 +92,11 @@ resource "azapi_resource" "asset" { type = "Microsoft.Media/mediaServices/assets@2022-08-01" parent_id = azapi_resource.mediaService.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -111,13 +105,13 @@ resource "azapi_resource" "assetFilter" { type = "Microsoft.Media/mediaServices/assets/assetFilters@2022-08-01" parent_id = azapi_resource.asset.id name = var.resource_name - body = jsonencode({ + body = { properties = { firstQuality = { bitrate = 0 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Media_mediaServices_contentKeyPolicies@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.Media_mediaServices_contentKeyPolicies@2022-08-01/main.tf index 219ffc11..091522c8 100644 --- a/dependency/azapi_examples/Microsoft.Media_mediaServices_contentKeyPolicies@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Media_mediaServices_contentKeyPolicies@2022-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,10 +73,7 @@ resource "azapi_resource" "mediaService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { publicNetworkAccess = "Enabled" storageAccounts = [ @@ -89,7 +83,7 @@ resource "azapi_resource" "mediaService" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,7 +92,7 @@ resource "azapi_resource" "contentKeyPolicy" { type = "Microsoft.Media/mediaServices/contentKeyPolicies@2022-08-01" parent_id = azapi_resource.mediaService.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "My Policy Description" options = [ @@ -122,7 +116,7 @@ resource "azapi_resource" "contentKeyPolicy" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Media_mediaServices_liveEvents@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.Media_mediaServices_liveEvents@2022-08-01/main.tf index 8fc3ca4c..ce43fc65 100644 --- a/dependency/azapi_examples/Microsoft.Media_mediaServices_liveEvents@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Media_mediaServices_liveEvents@2022-08-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,7 +46,7 @@ resource "azapi_resource" "mediaService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" storageAccounts = [ @@ -56,7 +56,7 @@ resource "azapi_resource" "mediaService" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -66,7 +66,7 @@ resource "azapi_resource" "liveEvent" { parent_id = azapi_resource.mediaService.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { input = { accessControl = { @@ -84,7 +84,7 @@ resource "azapi_resource" "liveEvent" { streamingProtocol = "RTMP" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingEndpoints@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingEndpoints@2022-08-01/main.tf index 81f8c447..00bacd0a 100644 --- a/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingEndpoints@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingEndpoints@2022-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,10 +73,7 @@ resource "azapi_resource" "mediaService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { publicNetworkAccess = "Enabled" storageAccounts = [ @@ -89,7 +83,7 @@ resource "azapi_resource" "mediaService" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,14 +93,14 @@ resource "azapi_resource" "streamingEndpoint" { parent_id = azapi_resource.mediaService.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { scaleUnits = 1 } tags = { env = "test" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingLocators@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingLocators@2022-08-01/main.tf index 4eee54a4..12bc860e 100644 --- a/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingLocators@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingLocators@2022-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,10 +73,7 @@ resource "azapi_resource" "mediaService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { publicNetworkAccess = "Enabled" storageAccounts = [ @@ -89,7 +83,7 @@ resource "azapi_resource" "mediaService" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,11 +92,11 @@ resource "azapi_resource" "asset" { type = "Microsoft.Media/mediaServices/assets@2022-08-01" parent_id = azapi_resource.mediaService.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -111,12 +105,12 @@ resource "azapi_resource" "streamingLocator" { type = "Microsoft.Media/mediaServices/streamingLocators@2022-08-01" parent_id = azapi_resource.mediaService.id name = var.resource_name - body = jsonencode({ + body = { properties = { assetName = azapi_resource.asset.name streamingPolicyName = "Predefined_ClearStreamingOnly" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingPolicies@2022-08-01/main.tf b/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingPolicies@2022-08-01/main.tf index a3abff9a..87747799 100644 --- a/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingPolicies@2022-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Media_mediaServices_streamingPolicies@2022-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,10 +73,7 @@ resource "azapi_resource" "mediaService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { publicNetworkAccess = "Enabled" storageAccounts = [ @@ -89,7 +83,7 @@ resource "azapi_resource" "mediaService" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,7 +92,7 @@ resource "azapi_resource" "streamingPolicy" { type = "Microsoft.Media/mediaServices/streamingPolicies@2022-08-01" parent_id = azapi_resource.mediaService.id name = var.resource_name - body = jsonencode({ + body = { properties = { noEncryption = { enabledProtocols = { @@ -109,7 +103,7 @@ resource "azapi_resource" "streamingPolicy" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Media_mediaServices_transforms@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Media_mediaServices_transforms@2022-07-01/main.tf index 8b622da4..aabf4582 100644 --- a/dependency/azapi_examples/Microsoft.Media_mediaServices_transforms@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Media_mediaServices_transforms@2022-07-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,10 +73,7 @@ resource "azapi_resource" "mediaService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { publicNetworkAccess = "Enabled" storageAccounts = [ @@ -89,7 +83,7 @@ resource "azapi_resource" "mediaService" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,7 +92,7 @@ resource "azapi_resource" "transform" { type = "Microsoft.Media/mediaServices/transforms@2022-07-01" parent_id = azapi_resource.mediaService.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" outputs = [ @@ -112,7 +106,7 @@ resource "azapi_resource" "transform" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Migrate_migrateProjects@2018-09-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Migrate_migrateProjects@2018-09-01-preview/main.tf index 264dffcc..87b93d8e 100644 --- a/dependency/azapi_examples/Microsoft.Migrate_migrateProjects@2018-09-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Migrate_migrateProjects@2018-09-01-preview/main.tf @@ -32,10 +32,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -67,7 +64,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -79,10 +76,10 @@ resource "azapi_resource" "project" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" utilityStorageAccountId = azapi_resource.storageAccount.id } - }) + } } diff --git a/dependency/azapi_examples/Microsoft.Migrate_migrateProjects_solutions@2018-09-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Migrate_migrateProjects_solutions@2018-09-01-preview/main.tf index d4eb3e07..1b2fee52 100644 --- a/dependency/azapi_examples/Microsoft.Migrate_migrateProjects_solutions@2018-09-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Migrate_migrateProjects_solutions@2018-09-01-preview/main.tf @@ -32,10 +32,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -67,7 +64,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -79,12 +76,12 @@ resource "azapi_resource" "project" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" utilityStorageAccountId = azapi_resource.storageAccount.id } - }) + } } resource "azapi_resource" "solution" { @@ -92,13 +89,13 @@ resource "azapi_resource" "solution" { parent_id = azapi_resource.project.id name = var.resource_name - body = jsonencode({ + body = { properties = { summary = { instanceType = "Servers" migratedCount = 0 } } - }) + } } diff --git a/dependency/azapi_examples/Microsoft.Migrate_migrateProjects_solutions@2018-09-01-preview/terraform.tfstate b/dependency/azapi_examples/Microsoft.Migrate_migrateProjects_solutions@2018-09-01-preview/terraform.tfstate deleted file mode 100644 index d5c96f32..00000000 --- a/dependency/azapi_examples/Microsoft.Migrate_migrateProjects_solutions@2018-09-01-preview/terraform.tfstate +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 4, - "terraform_version": "1.5.2", - "serial": 10, - "lineage": "0cea1de1-4caf-f17d-f910-69a7e8bf987d", - "outputs": {}, - "resources": [], - "check_results": null -} diff --git a/dependency/azapi_examples/Microsoft.Migrate_migrateProjects_solutions@2018-09-01-preview/terraform.tfstate.backup b/dependency/azapi_examples/Microsoft.Migrate_migrateProjects_solutions@2018-09-01-preview/terraform.tfstate.backup deleted file mode 100644 index 6bdf7894..00000000 --- a/dependency/azapi_examples/Microsoft.Migrate_migrateProjects_solutions@2018-09-01-preview/terraform.tfstate.backup +++ /dev/null @@ -1,161 +0,0 @@ -{ - "version": 4, - "terraform_version": "1.5.2", - "serial": 5, - "lineage": "0cea1de1-4caf-f17d-f910-69a7e8bf987d", - "outputs": {}, - "resources": [ - { - "mode": "managed", - "type": "azapi_resource", - "name": "project", - "provider": "provider[\"registry.terraform.io/azure/azapi\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "body": "{\"properties\":{\"publicNetworkAccess\":\"Enabled\",\"utilityStorageAccountId\":\"/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Storage/storageAccounts/acctest0001\"}}", - "id": "/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Migrate/migrateProjects/acctest0001", - "identity": [], - "ignore_casing": false, - "ignore_changes": null, - "ignore_missing_property": true, - "location": "westeurope", - "locks": null, - "name": "acctest0001", - "output": "{}", - "parent_id": "/subscriptions/******/resourceGroups/acctest0001", - "removing_special_chars": false, - "response_export_values": null, - "schema_validation_enabled": true, - "tags": {}, - "timeouts": null, - "type": "Microsoft.Migrate/migrateProjects@2020-05-01" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", - "dependencies": [ - "azapi_resource.resourceGroup", - "azapi_resource.storageAccount" - ] - } - ] - }, - { - "mode": "managed", - "type": "azapi_resource", - "name": "resourceGroup", - "provider": "provider[\"registry.terraform.io/azure/azapi\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "body": "{}", - "id": "/subscriptions/******/resourceGroups/acctest0001", - "identity": [], - "ignore_casing": false, - "ignore_changes": null, - "ignore_missing_property": true, - "location": "westeurope", - "locks": null, - "name": "acctest0001", - "output": "{\"id\":\"/subscriptions/******/resourceGroups/acctest0001\",\"location\":\"westeurope\",\"name\":\"acctest0001\",\"properties\":{\"provisioningState\":\"Succeeded\"},\"type\":\"Microsoft.Resources/resourceGroups\"}", - "parent_id": "/subscriptions/******", - "removing_special_chars": false, - "response_export_values": [ - "*" - ], - "schema_validation_enabled": false, - "tags": {}, - "timeouts": null, - "type": "Microsoft.Resources/resourceGroups@2020-06-01" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=" - } - ] - }, - { - "mode": "managed", - "type": "azapi_resource", - "name": "solution", - "provider": "provider[\"registry.terraform.io/azure/azapi\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "body": "{\"properties\":{\"summary\":{\"instanceType\":\"Servers\",\"migratedCount\":0}}}", - "id": "/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Migrate/migrateProjects/acctest0001/solutions/acctest0001", - "identity": [], - "ignore_casing": false, - "ignore_changes": null, - "ignore_missing_property": true, - "location": "", - "locks": null, - "name": "acctest0001", - "output": "{}", - "parent_id": "/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Migrate/migrateProjects/acctest0001", - "removing_special_chars": false, - "response_export_values": null, - "schema_validation_enabled": true, - "tags": {}, - "timeouts": null, - "type": "Microsoft.Migrate/migrateProjects/solutions@2018-09-01-preview" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", - "dependencies": [ - "azapi_resource.project", - "azapi_resource.resourceGroup", - "azapi_resource.storageAccount" - ] - } - ] - }, - { - "mode": "managed", - "type": "azapi_resource", - "name": "storageAccount", - "provider": "provider[\"registry.terraform.io/azure/azapi\"]", - "instances": [ - { - "schema_version": 0, - "attributes": { - "body": "{\"identity\":{\"type\":\"None\"},\"kind\":\"StorageV2\",\"properties\":{\"accessTier\":\"Hot\",\"allowBlobPublicAccess\":true,\"allowCrossTenantReplication\":true,\"allowSharedKeyAccess\":true,\"defaultToOAuthAuthentication\":false,\"encryption\":{\"keySource\":\"Microsoft.Storage\",\"services\":{\"queue\":{\"keyType\":\"Service\"},\"table\":{\"keyType\":\"Service\"}}},\"isHnsEnabled\":false,\"isNfsV3Enabled\":false,\"isSftpEnabled\":false,\"minimumTlsVersion\":\"TLS1_2\",\"networkAcls\":{\"defaultAction\":\"Allow\"},\"publicNetworkAccess\":\"Enabled\",\"supportsHttpsTrafficOnly\":true},\"sku\":{\"name\":\"Standard_LRS\"}}", - "id": "/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Storage/storageAccounts/acctest0001", - "identity": [ - { - "identity_ids": [], - "principal_id": "", - "tenant_id": "", - "type": "None" - } - ], - "ignore_casing": false, - "ignore_changes": null, - "ignore_missing_property": true, - "location": "westeurope", - "locks": null, - "name": "acctest0001", - "output": "{\"id\":\"/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Storage/storageAccounts/acctest0001\",\"identity\":{\"type\":\"None\"},\"kind\":\"StorageV2\",\"location\":\"westeurope\",\"name\":\"acctest0001\",\"properties\":{\"accessTier\":\"Hot\",\"allowBlobPublicAccess\":true,\"allowCrossTenantReplication\":true,\"allowSharedKeyAccess\":true,\"creationTime\":\"2023-08-10T04:15:22.6959214Z\",\"defaultToOAuthAuthentication\":false,\"encryption\":{\"keySource\":\"Microsoft.Storage\",\"services\":{\"blob\":{\"enabled\":true,\"keyType\":\"Account\",\"lastEnabledTime\":\"2023-08-10T04:15:23.1647234Z\"},\"file\":{\"enabled\":true,\"keyType\":\"Account\",\"lastEnabledTime\":\"2023-08-10T04:15:23.1647234Z\"}}},\"isHnsEnabled\":false,\"isNfsV3Enabled\":false,\"isSftpEnabled\":false,\"keyCreationTime\":{\"key1\":\"2023-08-10T04:15:22.8834265Z\",\"key2\":\"2023-08-10T04:15:22.8834265Z\"},\"minimumTlsVersion\":\"TLS1_2\",\"networkAcls\":{\"bypass\":\"AzureServices\",\"defaultAction\":\"Allow\",\"ipRules\":[],\"virtualNetworkRules\":[]},\"primaryEndpoints\":{\"blob\":\"https://acctest0001.blob.core.windows.net/\",\"dfs\":\"https://acctest0001.dfs.core.windows.net/\",\"file\":\"https://acctest0001.file.core.windows.net/\",\"queue\":\"https://acctest0001.queue.core.windows.net/\",\"table\":\"https://acctest0001.table.core.windows.net/\",\"web\":\"https://acctest0001.z6.web.core.windows.net/\"},\"primaryLocation\":\"westeurope\",\"privateEndpointConnections\":[],\"provisioningState\":\"Succeeded\",\"publicNetworkAccess\":\"Enabled\",\"statusOfPrimary\":\"available\",\"supportsHttpsTrafficOnly\":true},\"sku\":{\"name\":\"Standard_LRS\",\"tier\":\"Standard\"},\"tags\":{},\"type\":\"Microsoft.Storage/storageAccounts\"}", - "parent_id": "/subscriptions/******/resourceGroups/acctest0001", - "removing_special_chars": false, - "response_export_values": [ - "*" - ], - "schema_validation_enabled": false, - "tags": {}, - "timeouts": null, - "type": "Microsoft.Storage/storageAccounts@2021-09-01" - }, - "sensitive_attributes": [], - "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInJlYWQiOjMwMDAwMDAwMDAwMCwidXBkYXRlIjoxODAwMDAwMDAwMDAwfX0=", - "dependencies": [ - "azapi_resource.resourceGroup" - ] - } - ] - } - ], - "check_results": null -} diff --git a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks@2022-11-01/main.tf index 0037371b..89fd09ca 100644 --- a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "mobileNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicLandMobileNetworkIdentifier = { mcc = "001" @@ -39,7 +39,7 @@ resource "azapi_resource" "mobileNetwork" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_dataNetworks@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_dataNetworks@2022-11-01/main.tf index 56e9a079..f81a0f80 100644 --- a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_dataNetworks@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_dataNetworks@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "mobileNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicLandMobileNetworkIdentifier = { mcc = "001" @@ -39,7 +39,7 @@ resource "azapi_resource" "mobileNetwork" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,11 +49,11 @@ resource "azapi_resource" "dataNetwork" { parent_id = azapi_resource.mobileNetwork.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_services@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_services@2022-11-01/main.tf index 640514b9..c6df2759 100644 --- a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_services@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_services@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "mobileNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicLandMobileNetworkIdentifier = { mcc = "001" @@ -39,7 +39,7 @@ resource "azapi_resource" "mobileNetwork" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,7 +49,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.mobileNetwork.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { pccRules = [ { @@ -75,7 +75,7 @@ resource "azapi_resource" "service" { servicePrecedence = 0 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_simPolicies@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_simPolicies@2022-11-01/main.tf index ebfdcb5b..177d34a2 100644 --- a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_simPolicies@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_simPolicies@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "mobileNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicLandMobileNetworkIdentifier = { mcc = "001" @@ -39,7 +39,7 @@ resource "azapi_resource" "mobileNetwork" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,7 +49,7 @@ resource "azapi_resource" "service" { parent_id = azapi_resource.mobileNetwork.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { pccRules = [ { @@ -75,7 +75,7 @@ resource "azapi_resource" "service" { servicePrecedence = 0 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -85,11 +85,11 @@ resource "azapi_resource" "dataNetwork" { parent_id = azapi_resource.mobileNetwork.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,14 +99,14 @@ resource "azapi_resource" "slice" { parent_id = azapi_resource.mobileNetwork.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { snssai = { sst = 1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -116,7 +116,7 @@ resource "azapi_resource" "simPolicy" { parent_id = azapi_resource.mobileNetwork.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { defaultSlice = { id = azapi_resource.slice.id @@ -163,7 +163,7 @@ resource "azapi_resource" "simPolicy" { tags = { key = "value" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_sites@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_sites@2022-11-01/main.tf index 71c99712..b3609c2b 100644 --- a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_sites@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_sites@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "mobileNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicLandMobileNetworkIdentifier = { mcc = "001" @@ -39,7 +39,7 @@ resource "azapi_resource" "mobileNetwork" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,11 +49,11 @@ resource "azapi_resource" "site" { parent_id = azapi_resource.mobileNetwork.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_slices@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_slices@2022-11-01/main.tf index 2349db2d..5ba9a4cc 100644 --- a/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_slices@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MobileNetwork_mobileNetworks_slices@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "mobileNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicLandMobileNetworkIdentifier = { mcc = "001" @@ -39,7 +39,7 @@ resource "azapi_resource" "mobileNetwork" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,14 +49,14 @@ resource "azapi_resource" "slice" { parent_id = azapi_resource.mobileNetwork.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { snssai = { sst = 1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.MobileNetwork_packetCoreControlPlanes@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.MobileNetwork_packetCoreControlPlanes@2022-11-01/main.tf index 05677f32..d949b435 100644 --- a/dependency/azapi_examples/Microsoft.MobileNetwork_packetCoreControlPlanes@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MobileNetwork_packetCoreControlPlanes@2022-11-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "mobileNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicLandMobileNetworkIdentifier = { mcc = "001" mnc = "01" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,12 +48,12 @@ resource "azapi_resource" "dataBoxEdgeDevice" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { sku = { name = "EdgeP_Base" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -63,10 +63,10 @@ resource "azapi_resource" "site" { parent_id = azapi_resource.mobileNetwork.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,7 +76,7 @@ resource "azapi_resource" "packetCoreControlPlane" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { controlPlaneAccessInterface = { } @@ -97,7 +97,7 @@ resource "azapi_resource" "packetCoreControlPlane" { sku = "G0" ueMtu = 1440 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.MobileNetwork_packetCoreControlPlanes_packetCoreDataPlanes@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.MobileNetwork_packetCoreControlPlanes_packetCoreDataPlanes@2022-11-01/main.tf index 983ee61f..616059ba 100644 --- a/dependency/azapi_examples/Microsoft.MobileNetwork_packetCoreControlPlanes_packetCoreDataPlanes@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MobileNetwork_packetCoreControlPlanes_packetCoreDataPlanes@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "mobileNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicLandMobileNetworkIdentifier = { mcc = "001" @@ -39,7 +39,7 @@ resource "azapi_resource" "mobileNetwork" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,13 +49,13 @@ resource "azapi_resource" "dataBoxEdgeDevice" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { sku = { name = "EdgeP_Base" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -65,11 +65,11 @@ resource "azapi_resource" "site" { parent_id = azapi_resource.mobileNetwork.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -79,7 +79,7 @@ resource "azapi_resource" "packetCoreControlPlane" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { controlPlaneAccessInterface = { } @@ -101,7 +101,7 @@ resource "azapi_resource" "packetCoreControlPlane" { ueMtu = 1440 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -111,13 +111,13 @@ resource "azapi_resource" "packetCoreDataPlane" { parent_id = azapi_resource.packetCoreControlPlane.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { userPlaneAccessInterface = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.MobileNetwork_simGroups@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.MobileNetwork_simGroups@2022-11-01/main.tf index 6d9e0853..db9a162a 100644 --- a/dependency/azapi_examples/Microsoft.MobileNetwork_simGroups@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.MobileNetwork_simGroups@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "mobileNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicLandMobileNetworkIdentifier = { mcc = "001" @@ -39,7 +39,7 @@ resource "azapi_resource" "mobileNetwork" { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,14 +49,14 @@ resource "azapi_resource" "simGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { mobileNetwork = { id = azapi_resource.mobileNetwork.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Monitor_accounts@2023-04-03/main.tf b/dependency/azapi_examples/Microsoft.Monitor_accounts@2023-04-03/main.tf index 9c4ba46a..244b3960 100644 --- a/dependency/azapi_examples/Microsoft.Monitor_accounts@2023-04-03/main.tf +++ b/dependency/azapi_examples/Microsoft.Monitor_accounts@2023-04-03/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "account" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts@2022-05-01/main.tf b/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts@2022-05-01/main.tf index a631ebc7..8c92f106 100644 --- a/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts@2022-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts@2022-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "netAppAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { activeDirectories = [ ] @@ -39,7 +39,7 @@ resource "azapi_resource" "netAppAccount" { tags = { SkipASMAzSecPack = "true" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools@2022-05-01/main.tf b/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools@2022-05-01/main.tf index 13613306..d9c84367 100644 --- a/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools@2022-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools@2022-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "netAppAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { activeDirectories = [ ] @@ -39,7 +39,7 @@ resource "azapi_resource" "netAppAccount" { tags = { SkipASMAzSecPack = "true" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,7 +49,7 @@ resource "azapi_resource" "capacityPool" { parent_id = azapi_resource.netAppAccount.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { serviceLevel = "Standard" size = 4.398046511104e+12 @@ -57,7 +57,7 @@ resource "azapi_resource" "capacityPool" { tags = { SkipASMAzSecPack = "true" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools_volumes@2022-05-01/main.tf b/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools_volumes@2022-05-01/main.tf index 203f818e..b100bf3f 100644 --- a/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools_volumes@2022-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools_volumes@2022-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -48,10 +48,12 @@ resource "azapi_resource" "virtualNetwork" { tags = { SkipASMAzSecPack = "true" } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "netAppAccount" { @@ -59,7 +61,7 @@ resource "azapi_resource" "netAppAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { activeDirectories = [ ] @@ -67,7 +69,7 @@ resource "azapi_resource" "netAppAccount" { tags = { SkipASMAzSecPack = "true" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,7 +78,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "GatewaySubnet" - body = jsonencode({ + body = { properties = { addressPrefix = "10.6.1.0/24" delegations = [ @@ -88,7 +90,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -97,7 +99,7 @@ resource "azapi_resource" "subnet2" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.6.2.0/24" delegations = [ @@ -115,7 +117,7 @@ resource "azapi_resource" "subnet2" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -125,7 +127,7 @@ resource "azapi_resource" "capacityPool" { parent_id = azapi_resource.netAppAccount.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { serviceLevel = "Standard" size = 4.398046511104e+12 @@ -133,7 +135,7 @@ resource "azapi_resource" "capacityPool" { tags = { SkipASMAzSecPack = "true" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -143,7 +145,7 @@ resource "azapi_resource" "volume" { parent_id = azapi_resource.capacityPool.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { avsDataStore = "Enabled" creationToken = "my-unique-file-path-230630034120103726" @@ -178,7 +180,7 @@ resource "azapi_resource" "volume" { } zones = [ ] - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools_volumes_snapshots@2022-05-01/main.tf b/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools_volumes_snapshots@2022-05-01/main.tf index 8d0826ed..95b60101 100644 --- a/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools_volumes_snapshots@2022-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_capacityPools_volumes_snapshots@2022-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "netAppAccount" { @@ -56,12 +58,12 @@ resource "azapi_resource" "netAppAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { activeDirectories = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -70,7 +72,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -88,7 +90,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,12 +100,12 @@ resource "azapi_resource" "capacityPool" { parent_id = azapi_resource.netAppAccount.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { serviceLevel = "Premium" size = 4.398046511104e+12 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -113,7 +115,7 @@ resource "azapi_resource" "volume" { parent_id = azapi_resource.capacityPool.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { avsDataStore = "Disabled" creationToken = "my-unique-file-path-230630033642692134" @@ -137,7 +139,7 @@ resource "azapi_resource" "volume" { } zones = [ ] - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_snapshotPolicies@2022-05-01/main.tf b/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_snapshotPolicies@2022-05-01/main.tf index e97de4cf..2b1c2935 100644 --- a/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_snapshotPolicies@2022-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.NetApp_netAppAccounts_snapshotPolicies@2022-05-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "netAppAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { activeDirectories = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,7 +46,7 @@ resource "azapi_resource" "snapshotPolicy" { parent_id = azapi_resource.netAppAccount.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { dailySchedule = { hour = 22 @@ -71,7 +71,7 @@ resource "azapi_resource" "snapshotPolicy" { snapshotsToKeep = 1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_ApplicationGatewayWebApplicationFirewallPolicies@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_ApplicationGatewayWebApplicationFirewallPolicies@2022-07-01/main.tf index 43c7987b..3f18da37 100644 --- a/dependency/azapi_examples/Microsoft.Network_ApplicationGatewayWebApplicationFirewallPolicies@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_ApplicationGatewayWebApplicationFirewallPolicies@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "ApplicationGatewayWebApplicationFirewallPolicy" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { customRules = [ ] @@ -55,7 +55,7 @@ resource "azapi_resource" "ApplicationGatewayWebApplicationFirewallPolicy" { state = "Enabled" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_ExpressRoutePorts@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_ExpressRoutePorts@2022-07-01/main.tf index 39bb26a2..38cf728f 100644 --- a/dependency/azapi_examples/Microsoft.Network_ExpressRoutePorts@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_ExpressRoutePorts@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "ExpressRoutePort" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { bandwidthInGbps = 10 billingType = "MeteredData" @@ -41,7 +41,7 @@ resource "azapi_resource" "ExpressRoutePort" { tags = { ENV = "Test" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_FrontDoorWebApplicationFirewallPolicies@2020-11-01/main.tf b/dependency/azapi_examples/Microsoft.Network_FrontDoorWebApplicationFirewallPolicies@2020-11-01/main.tf index f422acfe..447cfbc9 100644 --- a/dependency/azapi_examples/Microsoft.Network_FrontDoorWebApplicationFirewallPolicies@2020-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_FrontDoorWebApplicationFirewallPolicies@2020-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "FrontDoorWebApplicationFirewallPolicy" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { customRules = { rules = [ @@ -94,7 +94,7 @@ resource "azapi_resource" "FrontDoorWebApplicationFirewallPolicy" { sku = { name = "Premium_AzureFrontDoor" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_applicationGateways@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_applicationGateways@2022-07-01/main.tf index f080d3be..b02347ce 100644 --- a/dependency/azapi_examples/Microsoft.Network_applicationGateways@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_applicationGateways@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -44,7 +44,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -54,7 +54,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -68,17 +68,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "subnet-230630033653837171" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.0.0/24" delegations = [ @@ -90,7 +92,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -136,7 +138,7 @@ resource "azapi_resource" "applicationGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { authenticationCertificates = [ ] @@ -259,7 +261,7 @@ resource "azapi_resource" "applicationGateway" { urlPathMaps = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_applicationGateways@2022-07-01/terraform.tfstate b/dependency/azapi_examples/Microsoft.Network_applicationGateways@2022-07-01/terraform.tfstate deleted file mode 100644 index 6ce18da6..00000000 --- a/dependency/azapi_examples/Microsoft.Network_applicationGateways@2022-07-01/terraform.tfstate +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 4, - "terraform_version": "1.5.2", - "serial": 24, - "lineage": "3a1da1c1-6494-7268-69a0-c13102c916d6", - "outputs": {}, - "resources": [], - "check_results": null -} diff --git a/dependency/azapi_examples/Microsoft.Network_azureFirewalls@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_azureFirewalls@2022-07-01/main.tf index 104c023a..3ffdf738 100644 --- a/dependency/azapi_examples/Microsoft.Network_azureFirewalls@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_azureFirewalls@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "publicIPAddress" { @@ -56,7 +58,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -69,7 +71,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +80,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "AzureFirewallSubnet" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.1.0/24" delegations = [ @@ -90,7 +92,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,7 +102,7 @@ resource "azapi_resource" "azureFirewall" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { additionalProperties = { } @@ -123,7 +125,7 @@ resource "azapi_resource" "azureFirewall" { } threatIntelMode = "Deny" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_bastionHosts@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_bastionHosts@2022-07-01/main.tf index 55dc871a..3a37c298 100644 --- a/dependency/azapi_examples/Microsoft.Network_bastionHosts@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_bastionHosts@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "publicIPAddress" { @@ -56,7 +58,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -69,7 +71,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +80,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "AzureBastionSubnet" - body = jsonencode({ + body = { properties = { addressPrefix = "192.168.1.224/27" delegations = [ @@ -90,7 +92,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,7 +102,7 @@ resource "azapi_resource" "bastionHost" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { disableCopyPaste = false enableFileCopy = false @@ -125,7 +127,7 @@ resource "azapi_resource" "bastionHost" { sku = { name = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets@2022-07-01/main.tf index 9e126dab..ee3fd5ea 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "dnsResolver" { @@ -56,14 +58,14 @@ resource "azapi_resource" "dnsResolver" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { virtualNetwork = { id = azapi_resource.virtualNetwork.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -72,7 +74,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "outbounddns" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.0.64/28" delegations = [ @@ -90,7 +92,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,14 +102,14 @@ resource "azapi_resource" "outboundEndpoint" { parent_id = azapi_resource.dnsResolver.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { subnet = { id = azapi_resource.subnet.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -117,7 +119,7 @@ resource "azapi_resource" "dnsForwardingRuleset" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { dnsResolverOutboundEndpoints = [ { @@ -126,7 +128,7 @@ resource "azapi_resource" "dnsForwardingRuleset" { ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets_forwardingRules@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets_forwardingRules@2022-07-01/main.tf index d7879722..f3800e39 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets_forwardingRules@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets_forwardingRules@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "dnsResolver" { @@ -56,14 +58,14 @@ resource "azapi_resource" "dnsResolver" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { virtualNetwork = { id = azapi_resource.virtualNetwork.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -72,7 +74,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "outbounddns" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.0.64/28" delegations = [ @@ -90,7 +92,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,14 +102,14 @@ resource "azapi_resource" "outboundEndpoint" { parent_id = azapi_resource.dnsResolver.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { subnet = { id = azapi_resource.subnet.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -117,7 +119,7 @@ resource "azapi_resource" "dnsForwardingRuleset" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { dnsResolverOutboundEndpoints = [ { @@ -126,7 +128,7 @@ resource "azapi_resource" "dnsForwardingRuleset" { ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -135,7 +137,7 @@ resource "azapi_resource" "forwardingRule" { type = "Microsoft.Network/dnsForwardingRulesets/forwardingRules@2022-07-01" parent_id = azapi_resource.dnsForwardingRuleset.id name = var.resource_name - body = jsonencode({ + body = { properties = { domainName = "onprem.local." forwardingRuleState = "Enabled" @@ -147,7 +149,7 @@ resource "azapi_resource" "forwardingRule" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets_virtualNetworkLinks@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets_virtualNetworkLinks@2022-07-01/main.tf index d3eec573..f84d95d9 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets_virtualNetworkLinks@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsForwardingRulesets_virtualNetworkLinks@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "dnsResolver" { @@ -56,14 +58,14 @@ resource "azapi_resource" "dnsResolver" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { virtualNetwork = { id = azapi_resource.virtualNetwork.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -72,7 +74,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "outbounddns" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.0.64/28" delegations = [ @@ -90,7 +92,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,14 +102,14 @@ resource "azapi_resource" "outboundEndpoint" { parent_id = azapi_resource.dnsResolver.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { subnet = { id = azapi_resource.subnet.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -117,7 +119,7 @@ resource "azapi_resource" "dnsForwardingRuleset" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { dnsResolverOutboundEndpoints = [ { @@ -126,7 +128,7 @@ resource "azapi_resource" "dnsForwardingRuleset" { ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -135,14 +137,14 @@ resource "azapi_resource" "virtualNetworkLink" { type = "Microsoft.Network/dnsForwardingRulesets/virtualNetworkLinks@2022-07-01" parent_id = azapi_resource.dnsForwardingRuleset.id name = var.resource_name - body = jsonencode({ + body = { properties = { metadata = null virtualNetwork = { id = azapi_resource.virtualNetwork.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsResolvers@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsResolvers@2022-07-01/main.tf index f7712835..6f1c48b1 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsResolvers@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsResolvers@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "dnsResolver" { @@ -56,14 +58,14 @@ resource "azapi_resource" "dnsResolver" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { virtualNetwork = { id = azapi_resource.virtualNetwork.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsResolvers_inboundEndpoints@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsResolvers_inboundEndpoints@2022-07-01/main.tf index c14a0466..f4df2be1 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsResolvers_inboundEndpoints@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsResolvers_inboundEndpoints@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "inbounddns" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.0.0/28" delegations = [ @@ -73,7 +75,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -83,14 +85,14 @@ resource "azapi_resource" "dnsResolver" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { virtualNetwork = { id = azapi_resource.virtualNetwork.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,7 +102,7 @@ resource "azapi_resource" "inboundEndpoint" { parent_id = azapi_resource.dnsResolver.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ipConfigurations = [ { @@ -112,7 +114,7 @@ resource "azapi_resource" "inboundEndpoint" { ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsResolvers_outboundEndpoints@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsResolvers_outboundEndpoints@2022-07-01/main.tf index f3a1ba05..de01a905 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsResolvers_outboundEndpoints@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsResolvers_outboundEndpoints@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "dnsResolver" { @@ -56,14 +58,14 @@ resource "azapi_resource" "dnsResolver" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { virtualNetwork = { id = azapi_resource.virtualNetwork.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -72,7 +74,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "outbounddns" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.0.64/28" delegations = [ @@ -90,7 +92,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,14 +102,14 @@ resource "azapi_resource" "outboundEndpoint" { parent_id = azapi_resource.dnsResolver.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { subnet = { id = azapi_resource.subnet.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsZones_A@2018-05-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsZones_A@2018-05-01/main.tf index ce1c2279..0e97289d 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsZones_A@2018-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsZones_A@2018-05-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "A" { type = "Microsoft.Network/dnsZones/A@2018-05-01" parent_id = azapi_resource.dnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { ARecords = [ { @@ -55,7 +55,7 @@ resource "azapi_resource" "A" { targetResource = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsZones_AAAA@2018-05-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsZones_AAAA@2018-05-01/main.tf index 0c9ff16e..53a634ba 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsZones_AAAA@2018-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsZones_AAAA@2018-05-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "AAAA" { type = "Microsoft.Network/dnsZones/AAAA@2018-05-01" parent_id = azapi_resource.dnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { AAAARecords = [ { @@ -55,7 +55,7 @@ resource "azapi_resource" "AAAA" { targetResource = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsZones_CAA@2018-05-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsZones_CAA@2018-05-01/main.tf index f1f203b6..b1e4599e 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsZones_CAA@2018-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsZones_CAA@2018-05-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "CAA" { type = "Microsoft.Network/dnsZones/CAA@2018-05-01" parent_id = azapi_resource.dnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { TTL = 300 caaRecords = [ @@ -67,7 +67,7 @@ resource "azapi_resource" "CAA" { metadata = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsZones_CNAME@2018-05-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsZones_CNAME@2018-05-01/main.tf index c4805bb6..3936f62f 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsZones_CNAME@2018-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsZones_CNAME@2018-05-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "CNAME" { type = "Microsoft.Network/dnsZones/CNAME@2018-05-01" parent_id = azapi_resource.dnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { CNAMERecord = { cname = "${var.resource_name}.webpubsub.azure.com" @@ -50,7 +50,7 @@ resource "azapi_resource" "CNAME" { targetResource = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsZones_MX@2018-05-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsZones_MX@2018-05-01/main.tf index dba0c67c..eb669774 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsZones_MX@2018-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsZones_MX@2018-05-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "MX" { type = "Microsoft.Network/dnsZones/MX@2018-05-01" parent_id = azapi_resource.dnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { MXRecords = [ { @@ -55,7 +55,7 @@ resource "azapi_resource" "MX" { metadata = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsZones_NS@2018-05-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsZones_NS@2018-05-01/main.tf index c33032d8..d53cb99e 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsZones_NS@2018-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsZones_NS@2018-05-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "N" { type = "Microsoft.Network/dnsZones/NS@2018-05-01" parent_id = azapi_resource.dnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { NSRecords = [ { @@ -53,7 +53,7 @@ resource "azapi_resource" "N" { metadata = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsZones_PTR@2018-05-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsZones_PTR@2018-05-01/main.tf index 99287e8c..4b18ecbb 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsZones_PTR@2018-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsZones_PTR@2018-05-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "PTR" { type = "Microsoft.Network/dnsZones/PTR@2018-05-01" parent_id = azapi_resource.dnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { PTRRecords = [ { @@ -53,7 +53,7 @@ resource "azapi_resource" "PTR" { metadata = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsZones_SRV@2018-05-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsZones_SRV@2018-05-01/main.tf index f8b3df47..a8eeb324 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsZones_SRV@2018-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsZones_SRV@2018-05-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "SRV" { type = "Microsoft.Network/dnsZones/SRV@2018-05-01" parent_id = azapi_resource.dnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { SRVRecords = [ { @@ -59,7 +59,7 @@ resource "azapi_resource" "SRV" { metadata = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_dnsZones_TXT@2018-05-01/main.tf b/dependency/azapi_examples/Microsoft.Network_dnsZones_TXT@2018-05-01/main.tf index 620527c2..da6b0c7d 100644 --- a/dependency/azapi_examples/Microsoft.Network_dnsZones_TXT@2018-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_dnsZones_TXT@2018-05-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "TXT" { type = "Microsoft.Network/dnsZones/TXT@2018-05-01" parent_id = azapi_resource.dnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { TTL = 300 TXTRecords = [ @@ -59,7 +59,7 @@ resource "azapi_resource" "TXT" { metadata = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits@2022-07-01/main.tf index d1825d13..c1615d7a 100644 --- a/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits@2022-07-01/main.tf @@ -31,16 +31,13 @@ resource "azapi_resource" "ExpressRoutePort" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { bandwidthInGbps = 10 encapsulation = "Dot1Q" peeringLocation = "CDC-Canberra" } - }) + } schema_validation_enabled = false ignore_casing = true response_export_values = ["*"] @@ -51,7 +48,7 @@ resource "azapi_resource" "expressRouteCircuit" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { authorizationKey = "" bandwidthInGbps = 5 @@ -64,7 +61,7 @@ resource "azapi_resource" "expressRouteCircuit" { name = "Premium_MeteredData" tier = "Premium" } - }) + } schema_validation_enabled = false ignore_casing = true response_export_values = ["*"] diff --git a/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_authorizations@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_authorizations@2022-07-01/main.tf index d4434453..3f354df6 100644 --- a/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_authorizations@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_authorizations@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "expressRouteCircuit" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { authorizationKey = "" serviceProviderProperties = { @@ -49,7 +49,7 @@ resource "azapi_resource" "expressRouteCircuit" { Environment = "production" Purpose = "AcceptanceTests" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -58,10 +58,10 @@ resource "azapi_resource" "authorization" { type = "Microsoft.Network/expressRouteCircuits/authorizations@2022-07-01" parent_id = azapi_resource.expressRouteCircuit.id name = var.resource_name - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_peerings@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_peerings@2022-07-01/main.tf index 93176aae..8429b663 100644 --- a/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_peerings@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_peerings@2022-07-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "ExpressRoutePort" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { bandwidthInGbps = 10 encapsulation = "Dot1Q" peeringLocation = "CDC-Canberra" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "expressRouteCircuit" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { authorizationKey = "" bandwidthInGbps = 5 @@ -60,7 +60,7 @@ resource "azapi_resource" "expressRouteCircuit" { name = "Premium_MeteredData" tier = "Premium" } - }) + } schema_validation_enabled = false ignore_casing = true response_export_values = ["*"] @@ -70,7 +70,7 @@ resource "azapi_resource" "peering" { type = "Microsoft.Network/expressRouteCircuits/peerings@2022-07-01" parent_id = azapi_resource.expressRouteCircuit.id name = "AzurePrivatePeering" - body = jsonencode({ + body = { properties = { azureASN = 12076 gatewayManagerEtag = "" @@ -82,7 +82,7 @@ resource "azapi_resource" "peering" { state = "Enabled" vlanId = 100 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_peerings_connections@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_peerings_connections@2022-07-01/main.tf index 8045bd0d..e4c1d1a7 100644 --- a/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_peerings_connections@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_expressRouteCircuits_peerings_connections@2022-07-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "ExpressRoutePort" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { bandwidthInGbps = 10 encapsulation = "Dot1Q" peeringLocation = "Airtel-Chennai2-CLS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,13 +47,13 @@ resource "azapi_resource" "ExpressRoutePort2" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { bandwidthInGbps = 10 encapsulation = "Dot1Q" peeringLocation = "CDC-Canberra" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -63,7 +63,7 @@ resource "azapi_resource" "expressRouteCircuit" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { authorizationKey = "" bandwidthInGbps = 5 @@ -76,7 +76,7 @@ resource "azapi_resource" "expressRouteCircuit" { name = "Standard_MeteredData" tier = "Standard" } - }) + } ignore_casing = true schema_validation_enabled = false response_export_values = ["*"] @@ -87,7 +87,7 @@ resource "azapi_resource" "expressRouteCircuit2" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { authorizationKey = "" bandwidthInGbps = 5 @@ -100,7 +100,7 @@ resource "azapi_resource" "expressRouteCircuit2" { name = "Standard_MeteredData" tier = "Standard" } - }) + } ignore_casing = true schema_validation_enabled = false response_export_values = ["*"] @@ -110,7 +110,7 @@ resource "azapi_resource" "peering" { type = "Microsoft.Network/expressRouteCircuits/peerings@2022-07-01" parent_id = azapi_resource.expressRouteCircuit.id name = "AzurePrivatePeering" - body = jsonencode({ + body = { properties = { azureASN = 12076 gatewayManagerEtag = "" @@ -122,7 +122,7 @@ resource "azapi_resource" "peering" { state = "Enabled" vlanId = 100 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -131,7 +131,7 @@ resource "azapi_resource" "peering2" { type = "Microsoft.Network/expressRouteCircuits/peerings@2022-07-01" parent_id = azapi_resource.expressRouteCircuit2.id name = "AzurePrivatePeering" - body = jsonencode({ + body = { properties = { azureASN = 12076 gatewayManagerEtag = "" @@ -143,7 +143,7 @@ resource "azapi_resource" "peering2" { state = "Enabled" vlanId = 100 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -152,7 +152,7 @@ resource "azapi_resource" "connection" { type = "Microsoft.Network/expressRouteCircuits/peerings/connections@2022-07-01" parent_id = azapi_resource.peering.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "192.169.8.0/29" expressRouteCircuitPeering = { @@ -162,7 +162,7 @@ resource "azapi_resource" "connection" { id = azapi_resource.peering2.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_expressRouteGateways@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_expressRouteGateways@2022-07-01/main.tf index f5320ea1..2c280a7f 100644 --- a/dependency/azapi_examples/Microsoft.Network_expressRouteGateways@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_expressRouteGateways@2022-07-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "virtualWan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowBranchToBranchTraffic = true disableVpnEncryption = false office365LocalBreakoutCategory = "None" type = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,7 +48,7 @@ resource "azapi_resource" "virtualHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.1.0/24" hubRoutingPreference = "ExpressRoute" @@ -59,7 +59,7 @@ resource "azapi_resource" "virtualHub" { id = azapi_resource.virtualWan.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -69,7 +69,7 @@ resource "azapi_resource" "expressRouteGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowNonVirtualWanTraffic = false autoScaleConfiguration = { @@ -81,7 +81,7 @@ resource "azapi_resource" "expressRouteGateway" { id = azapi_resource.virtualHub.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_expressRouteGateways_expressRouteConnections@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_expressRouteGateways_expressRouteConnections@2022-07-01/main.tf index bb9bc86e..1ce545bf 100644 --- a/dependency/azapi_examples/Microsoft.Network_expressRouteGateways_expressRouteConnections@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_expressRouteGateways_expressRouteConnections@2022-07-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "ExpressRoutePort" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { bandwidthInGbps = 10 encapsulation = "Dot1Q" peeringLocation = "CDC-Canberra" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,14 +47,14 @@ resource "azapi_resource" "virtualWan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowBranchToBranchTraffic = true disableVpnEncryption = false office365LocalBreakoutCategory = "None" type = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,7 +64,7 @@ resource "azapi_resource" "virtualHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.1.0/24" hubRoutingPreference = "ExpressRoute" @@ -75,7 +75,7 @@ resource "azapi_resource" "virtualHub" { id = azapi_resource.virtualWan.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -85,7 +85,7 @@ resource "azapi_resource" "expressRouteCircuit" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { authorizationKey = "" bandwidthInGbps = 5 @@ -98,7 +98,7 @@ resource "azapi_resource" "expressRouteCircuit" { name = "Premium_MeteredData" tier = "Premium" } - }) + } schema_validation_enabled = false ignore_casing = true response_export_values = ["*"] @@ -108,7 +108,7 @@ resource "azapi_resource" "peering" { type = "Microsoft.Network/expressRouteCircuits/peerings@2022-07-01" parent_id = azapi_resource.expressRouteCircuit.id name = "AzurePrivatePeering" - body = jsonencode({ + body = { properties = { azureASN = 12076 gatewayManagerEtag = "" @@ -120,7 +120,7 @@ resource "azapi_resource" "peering" { state = "Enabled" vlanId = 100 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -130,7 +130,7 @@ resource "azapi_resource" "expressRouteGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowNonVirtualWanTraffic = false autoScaleConfiguration = { @@ -142,7 +142,7 @@ resource "azapi_resource" "expressRouteGateway" { id = azapi_resource.virtualHub.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -151,7 +151,7 @@ resource "azapi_resource" "expressRouteConnection" { type = "Microsoft.Network/expressRouteGateways/expressRouteConnections@2022-07-01" parent_id = azapi_resource.expressRouteGateway.id name = var.resource_name - body = jsonencode({ + body = { properties = { enableInternetSecurity = false expressRouteCircuitPeering = { @@ -162,7 +162,7 @@ resource "azapi_resource" "expressRouteConnection" { } routingWeight = 0 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_expressRoutePorts_authorizations@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_expressRoutePorts_authorizations@2022-07-01/main.tf index c00755d4..497c0a2d 100644 --- a/dependency/azapi_examples/Microsoft.Network_expressRoutePorts_authorizations@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_expressRoutePorts_authorizations@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "ExpressRoutePort" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { bandwidthInGbps = 10 billingType = "MeteredData" @@ -41,7 +41,7 @@ resource "azapi_resource" "ExpressRoutePort" { tags = { ENV = "Test" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,10 +50,10 @@ resource "azapi_resource" "authorization" { type = "Microsoft.Network/expressRoutePorts/authorizations@2022-07-01" parent_id = azapi_resource.ExpressRoutePort.id name = var.resource_name - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_firewallPolicies@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_firewallPolicies@2022-07-01/main.tf index 88b7e8f7..6d1e2954 100644 --- a/dependency/azapi_examples/Microsoft.Network_firewallPolicies@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_firewallPolicies@2022-07-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "firewallPolicy" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { threatIntelMode = "Alert" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_firewallPolicies_ruleCollectionGroups@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_firewallPolicies_ruleCollectionGroups@2022-07-01/main.tf index 15a3d8ca..ea657f20 100644 --- a/dependency/azapi_examples/Microsoft.Network_firewallPolicies_ruleCollectionGroups@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_firewallPolicies_ruleCollectionGroups@2022-07-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "firewallPolicy" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { threatIntelMode = "Alert" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -44,12 +44,12 @@ resource "azapi_resource" "ruleCollectionGroup" { type = "Microsoft.Network/firewallPolicies/ruleCollectionGroups@2022-07-01" parent_id = azapi_resource.firewallPolicy.id name = var.resource_name - body = jsonencode({ + body = { properties = { priority = 500 ruleCollections = [] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_frontDoorWebApplicationFirewallPolicies@2020-04-01/main.tf b/dependency/azapi_examples/Microsoft.Network_frontDoorWebApplicationFirewallPolicies@2020-04-01/main.tf index a97164a9..e58b4929 100644 --- a/dependency/azapi_examples/Microsoft.Network_frontDoorWebApplicationFirewallPolicies@2020-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_frontDoorWebApplicationFirewallPolicies@2020-04-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "frontDoorWebApplicationFirewallPolicy" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { policySettings = { enabledState = "Enabled" mode = "Prevention" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_ipGroups@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_ipGroups@2022-07-01/main.tf index 3cd260e4..5fa2ba60 100644 --- a/dependency/azapi_examples/Microsoft.Network_ipGroups@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_ipGroups@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "ipGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ipAddresses = [ ] @@ -39,7 +39,7 @@ resource "azapi_resource" "ipGroup" { tags = { env = "prod" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_loadBalancers@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_loadBalancers@2022-07-01/main.tf index 83169b53..a889f6da 100644 --- a/dependency/azapi_examples/Microsoft.Network_loadBalancers@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_loadBalancers@2022-07-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -61,7 +61,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,7 +71,7 @@ resource "azapi_resource" "loadBalancer" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { frontendIPConfigurations = [ { @@ -88,7 +88,7 @@ resource "azapi_resource" "loadBalancer" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_loadBalancers_backendAddressPools@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_loadBalancers_backendAddressPools@2022-07-01/main.tf index 602dfeb3..43670463 100644 --- a/dependency/azapi_examples/Microsoft.Network_loadBalancers_backendAddressPools@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_loadBalancers_backendAddressPools@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -44,7 +44,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -54,7 +54,7 @@ resource "azapi_resource" "loadBalancer" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { frontendIPConfigurations = [ { @@ -71,7 +71,7 @@ resource "azapi_resource" "loadBalancer" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -80,10 +80,10 @@ resource "azapi_resource" "backendAddressPool" { type = "Microsoft.Network/loadBalancers/backendAddressPools@2022-07-01" parent_id = azapi_resource.loadBalancer.id name = var.resource_name - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_localNetworkGateways@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_localNetworkGateways@2022-07-01/main.tf index aeebfa46..b3e7788d 100644 --- a/dependency/azapi_examples/Microsoft.Network_localNetworkGateways@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_localNetworkGateways@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "localNetworkGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { gatewayIpAddress = "168.62.225.23" localNetworkAddressSpace = { @@ -40,7 +40,7 @@ resource "azapi_resource" "localNetworkGateway" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_natGateways@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_natGateways@2022-07-01/main.tf index cbe29485..f49841b0 100644 --- a/dependency/azapi_examples/Microsoft.Network_natGateways@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_natGateways@2022-07-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "natGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { idleTimeoutInMinutes = 10 } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkInterfaces@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkInterfaces@2022-07-01/main.tf index b3e9bd93..c966d01b 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkInterfaces@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkInterfaces@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,7 +79,7 @@ resource "azapi_resource" "networkInterface" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enableAcceleratedNetworking = false enableIPForwarding = false @@ -95,7 +97,7 @@ resource "azapi_resource" "networkInterface" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkManagerConnections@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkManagerConnections@2022-09-01/main.tf index aa490e69..a918fe04 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkManagerConnections@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkManagerConnections@2022-09-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "networkManager" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" networkManagerScopeAccesses = [ @@ -62,7 +62,7 @@ resource "azapi_resource" "networkManager" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,11 +71,11 @@ resource "azapi_resource" "networkManagerConnection" { type = "Microsoft.Network/networkManagerConnections@2022-09-01" parent_id = data.azapi_resource.subscription.id name = var.resource_name - body = jsonencode({ + body = { properties = { networkManagerId = azapi_resource.networkManager.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkManagers@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkManagers@2022-09-01/main.tf index 0c2c82c6..66ac1887 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkManagers@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkManagers@2022-09-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "networkManager" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" networkManagerScopeAccesses = [ @@ -62,7 +62,7 @@ resource "azapi_resource" "networkManager" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkManagers_connectivityConfigurations@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkManagers_connectivityConfigurations@2022-09-01/main.tf index 4e42d8b9..71d94449 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkManagers_connectivityConfigurations@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkManagers_connectivityConfigurations@2022-09-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "networkManager" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" networkManagerScopeAccesses = [ @@ -63,7 +63,7 @@ resource "azapi_resource" "networkManager" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -73,7 +73,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -88,20 +88,22 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "networkGroup" { type = "Microsoft.Network/networkManagers/networkGroups@2022-09-01" parent_id = azapi_resource.networkManager.id name = var.resource_name - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -110,7 +112,7 @@ resource "azapi_resource" "connectivityConfiguration" { type = "Microsoft.Network/networkManagers/connectivityConfigurations@2022-09-01" parent_id = azapi_resource.networkManager.id name = var.resource_name - body = jsonencode({ + body = { properties = { appliesToGroups = [ { @@ -125,12 +127,12 @@ resource "azapi_resource" "connectivityConfiguration" { hubs = [ { resourceId = azapi_resource.virtualNetwork.id - resourceType = jsondecode(azapi_resource.virtualNetwork.output).type + resourceType = azapi_resource.virtualNetwork.output.type }, ] isGlobal = "False" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkManagers_networkGroups@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkManagers_networkGroups@2022-09-01/main.tf index 19cc3a94..10b1bd18 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkManagers_networkGroups@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkManagers_networkGroups@2022-09-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "networkManager" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" networkManagerScopeAccesses = [ @@ -62,7 +62,7 @@ resource "azapi_resource" "networkManager" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,10 +71,10 @@ resource "azapi_resource" "networkGroup" { type = "Microsoft.Network/networkManagers/networkGroups@2022-09-01" parent_id = azapi_resource.networkManager.id name = var.resource_name - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkManagers_networkGroups_staticMembers@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkManagers_networkGroups_staticMembers@2022-09-01/main.tf index 3c8f299b..0b2e3ce2 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkManagers_networkGroups_staticMembers@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkManagers_networkGroups_staticMembers@2022-09-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "networkManager" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" networkManagerScopeAccesses = [ @@ -62,7 +62,7 @@ resource "azapi_resource" "networkManager" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -72,7 +72,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -86,20 +86,22 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "networkGroup" { type = "Microsoft.Network/networkManagers/networkGroups@2022-09-01" parent_id = azapi_resource.networkManager.id name = var.resource_name - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -108,11 +110,11 @@ resource "azapi_resource" "staticMember" { type = "Microsoft.Network/networkManagers/networkGroups/staticMembers@2022-09-01" parent_id = azapi_resource.networkGroup.id name = var.resource_name - body = jsonencode({ + body = { properties = { resourceId = azapi_resource.virtualNetwork.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkManagers_scopeConnections@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkManagers_scopeConnections@2022-09-01/main.tf index a59f5786..641228bf 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkManagers_scopeConnections@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkManagers_scopeConnections@2022-09-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "networkManager" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" networkManagerScopeAccesses = [ @@ -62,7 +62,7 @@ resource "azapi_resource" "networkManager" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,12 +71,12 @@ resource "azapi_resource" "scopeConnection" { type = "Microsoft.Network/networkManagers/scopeConnections@2022-09-01" parent_id = azapi_resource.networkManager.id name = var.resource_name - body = jsonencode({ + body = { properties = { resourceId = data.azapi_resource.subscription.id - tenantId = jsondecode(data.azapi_resource.subscription.output).tenantId + tenantId = data.azapi_resource.subscription.output.tenantId } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations@2022-09-01/main.tf index 230c938f..e08e415d 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations@2022-09-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "networkManager" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" networkManagerScopeAccesses = [ @@ -62,7 +62,7 @@ resource "azapi_resource" "networkManager" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,11 +71,11 @@ resource "azapi_resource" "securityAdminConfiguration" { type = "Microsoft.Network/networkManagers/securityAdminConfigurations@2022-09-01" parent_id = azapi_resource.networkManager.id name = var.resource_name - body = jsonencode({ + body = { properties = { applyOnNetworkIntentPolicyBasedServices = [] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations_ruleCollections@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations_ruleCollections@2022-09-01/main.tf index 918049c3..c5a69515 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations_ruleCollections@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations_ruleCollections@2022-09-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "networkManager" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" networkManagerScopeAccesses = [ @@ -62,7 +62,7 @@ resource "azapi_resource" "networkManager" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,11 +71,11 @@ resource "azapi_resource" "securityAdminConfiguration" { type = "Microsoft.Network/networkManagers/securityAdminConfigurations@2022-09-01" parent_id = azapi_resource.networkManager.id name = var.resource_name - body = jsonencode({ + body = { properties = { applyOnNetworkIntentPolicyBasedServices = [] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -84,10 +84,10 @@ resource "azapi_resource" "networkGroup" { type = "Microsoft.Network/networkManagers/networkGroups@2022-09-01" parent_id = azapi_resource.networkManager.id name = var.resource_name - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -96,7 +96,7 @@ resource "azapi_resource" "ruleCollection" { type = "Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections@2022-09-01" parent_id = azapi_resource.securityAdminConfiguration.id name = var.resource_name - body = jsonencode({ + body = { properties = { appliesToGroups = [ { @@ -104,7 +104,7 @@ resource "azapi_resource" "ruleCollection" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations_ruleCollections_rules@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations_ruleCollections_rules@2022-09-01/main.tf index 60708176..61c3f1a9 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations_ruleCollections_rules@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkManagers_securityAdminConfigurations_ruleCollections_rules@2022-09-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "networkManager" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { description = "" networkManagerScopeAccesses = [ @@ -62,7 +62,7 @@ resource "azapi_resource" "networkManager" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,11 +71,11 @@ resource "azapi_resource" "securityAdminConfiguration" { type = "Microsoft.Network/networkManagers/securityAdminConfigurations@2022-09-01" parent_id = azapi_resource.networkManager.id name = var.resource_name - body = jsonencode({ + body = { properties = { applyOnNetworkIntentPolicyBasedServices = [] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -84,10 +84,10 @@ resource "azapi_resource" "networkGroup" { type = "Microsoft.Network/networkManagers/networkGroups@2022-09-01" parent_id = azapi_resource.networkManager.id name = var.resource_name - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -96,7 +96,7 @@ resource "azapi_resource" "ruleCollection" { type = "Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections@2022-09-01" parent_id = azapi_resource.securityAdminConfiguration.id name = var.resource_name - body = jsonencode({ + body = { properties = { appliesToGroups = [ { @@ -104,7 +104,7 @@ resource "azapi_resource" "ruleCollection" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -113,7 +113,7 @@ resource "azapi_resource" "rule" { type = "Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections/rules@2022-09-01" parent_id = azapi_resource.ruleCollection.id name = var.resource_name - body = jsonencode({ + body = { kind = "Custom" properties = { access = "Deny" @@ -125,7 +125,7 @@ resource "azapi_resource" "rule" { sourcePortRanges = [] sources = [] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkProfiles@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkProfiles@2022-07-01/main.tf index cf0154f3..a32913e6 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkProfiles@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkProfiles@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.1.0.0/24" delegations = [ @@ -73,7 +75,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -83,7 +85,7 @@ resource "azapi_resource" "networkProfile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { containerNetworkInterfaceConfigurations = [ { @@ -103,7 +105,7 @@ resource "azapi_resource" "networkProfile" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkSecurityGroups@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkSecurityGroups@2022-07-01/main.tf index 3d917c58..e0eb3f0c 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkSecurityGroups@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkSecurityGroups@2022-07-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "networkSecurityGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { securityRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_networkSecurityGroups_securityRules@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_networkSecurityGroups_securityRules@2022-09-01/main.tf index 9cd91bd3..20459a86 100644 --- a/dependency/azapi_examples/Microsoft.Network_networkSecurityGroups_securityRules@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_networkSecurityGroups_securityRules@2022-09-01/main.tf @@ -31,22 +31,24 @@ resource "azapi_resource" "networkSecurityGroup" { parent_id = azapi_resource.resourceGroup.id name = "mi-security-group1-230630034008554952" location = var.location - body = jsonencode({ + body = { properties = { securityRules = [ ] } - }) + } schema_validation_enabled = false - ignore_body_changes = ["properties.securityRules"] response_export_values = ["*"] + lifecycle { + ignore_changes = [body.properties.securityRules] + } } resource "azapi_resource" "securityRule" { type = "Microsoft.Network/networkSecurityGroups/securityRules@2022-09-01" parent_id = azapi_resource.networkSecurityGroup.id name = "allow_management_inbound" - body = jsonencode({ + body = { properties = { access = "Allow" destinationAddressPrefix = "*" @@ -64,7 +66,7 @@ resource "azapi_resource" "securityRule" { sourceAddressPrefix = "*" sourcePortRange = "*" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_p2svpnGateways@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_p2svpnGateways@2022-07-01/main.tf index 71f40e23..be866c79 100644 --- a/dependency/azapi_examples/Microsoft.Network_p2svpnGateways@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_p2svpnGateways@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "vpnServerConfiguration" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { vpnAuthenticationTypes = [ "Certificate", @@ -51,7 +51,7 @@ resource "azapi_resource" "vpnServerConfiguration" { "IkeV2", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -61,14 +61,14 @@ resource "azapi_resource" "virtualWan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowBranchToBranchTraffic = true disableVpnEncryption = false office365LocalBreakoutCategory = "None" type = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +78,7 @@ resource "azapi_resource" "virtualHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.1.0/24" hubRoutingPreference = "ExpressRoute" @@ -89,7 +89,7 @@ resource "azapi_resource" "virtualHub" { id = azapi_resource.virtualWan.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,7 +99,7 @@ resource "azapi_resource" "p2svpnGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { isRoutingPreferenceInternet = false p2SConnectionConfigurations = [ @@ -123,7 +123,7 @@ resource "azapi_resource" "p2svpnGateway" { id = azapi_resource.vpnServerConfiguration.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { diff --git a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_A@2018-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_A@2018-09-01/main.tf index 05d73c62..2964fdb6 100644 --- a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_A@2018-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_A@2018-09-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "A" { type = "Microsoft.Network/privateDnsZones/A@2018-09-01" parent_id = azapi_resource.privateDnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { aRecords = [ { @@ -53,7 +53,7 @@ resource "azapi_resource" "A" { } ttl = 300 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_AAAA@2018-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_AAAA@2018-09-01/main.tf index 96a33936..6e07392f 100644 --- a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_AAAA@2018-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_AAAA@2018-09-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "AAAA" { type = "Microsoft.Network/privateDnsZones/AAAA@2018-09-01" parent_id = azapi_resource.privateDnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { aaaaRecords = [ { @@ -53,7 +53,7 @@ resource "azapi_resource" "AAAA" { } ttl = 300 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_CNAME@2018-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_CNAME@2018-09-01/main.tf index 7118e02c..36683029 100644 --- a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_CNAME@2018-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_CNAME@2018-09-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "CNAME" { type = "Microsoft.Network/privateDnsZones/CNAME@2018-09-01" parent_id = azapi_resource.privateDnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { cnameRecord = { cname = "contoso.com" @@ -48,7 +48,7 @@ resource "azapi_resource" "CNAME" { } ttl = 300 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_MX@2018-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_MX@2018-09-01/main.tf index dfdd1d5f..fb253f36 100644 --- a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_MX@2018-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_MX@2018-09-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "MX" { type = "Microsoft.Network/privateDnsZones/MX@2018-09-01" parent_id = azapi_resource.privateDnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { metadata = { } @@ -55,7 +55,7 @@ resource "azapi_resource" "MX" { ] ttl = 300 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_PTR@2018-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_PTR@2018-09-01/main.tf index a45d9d16..d9cd8485 100644 --- a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_PTR@2018-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_PTR@2018-09-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "PTR" { type = "Microsoft.Network/privateDnsZones/PTR@2018-09-01" parent_id = azapi_resource.privateDnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { metadata = { } @@ -53,7 +53,7 @@ resource "azapi_resource" "PTR" { ] ttl = 300 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_SRV@2018-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_SRV@2018-09-01/main.tf index 3c3f65a1..f188c022 100644 --- a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_SRV@2018-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_SRV@2018-09-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "SRV" { type = "Microsoft.Network/privateDnsZones/SRV@2018-09-01" parent_id = azapi_resource.privateDnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { metadata = { } @@ -59,7 +59,7 @@ resource "azapi_resource" "SRV" { ] ttl = 300 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_TXT@2018-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_TXT@2018-09-01/main.tf index 62b308d7..9be37897 100644 --- a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_TXT@2018-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_TXT@2018-09-01/main.tf @@ -39,7 +39,7 @@ resource "azapi_resource" "TXT" { type = "Microsoft.Network/privateDnsZones/TXT@2018-09-01" parent_id = azapi_resource.privateDnsZone.id name = var.resource_name - body = jsonencode({ + body = { properties = { metadata = { } @@ -59,7 +59,7 @@ resource "azapi_resource" "TXT" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_virtualNetworkLinks@2018-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_virtualNetworkLinks@2018-09-01/main.tf index c5a372fa..260dacad 100644 --- a/dependency/azapi_examples/Microsoft.Network_privateDnsZones_virtualNetworkLinks@2018-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_privateDnsZones_virtualNetworkLinks@2018-09-01/main.tf @@ -40,7 +40,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -60,10 +60,12 @@ resource "azapi_resource" "virtualNetwork" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "virtualNetworkLink" { @@ -71,14 +73,14 @@ resource "azapi_resource" "virtualNetworkLink" { parent_id = azapi_resource.privateDnsZone.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { registrationEnabled = false virtualNetwork = { id = azapi_resource.virtualNetwork.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_privateLinkServices@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_privateLinkServices@2022-07-01/main.tf index 7bca7be9..09a647b8 100644 --- a/dependency/azapi_examples/Microsoft.Network_privateLinkServices@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_privateLinkServices@2022-07-01/main.tf @@ -48,7 +48,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -62,10 +62,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "publicIPAddress" { @@ -73,7 +75,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -86,7 +88,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -96,7 +98,7 @@ resource "azapi_resource" "loadBalancer" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { frontendIPConfigurations = [ { @@ -113,7 +115,7 @@ resource "azapi_resource" "loadBalancer" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -122,7 +124,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.5.4.0/24" delegations = [ @@ -134,7 +136,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -144,7 +146,7 @@ resource "azapi_resource" "privateLinkService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoApproval = { subscriptions = [ @@ -169,7 +171,7 @@ resource "azapi_resource" "privateLinkService" { ] loadBalancerFrontendIpConfigurations = [ { - id = jsondecode(azapi_resource.loadBalancer.output).properties.frontendIPConfigurations[0].id + id = azapi_resource.loadBalancer.output.properties.frontendIPConfigurations[0].id }, ] visibility = { @@ -177,7 +179,7 @@ resource "azapi_resource" "privateLinkService" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_publicIPAddresses@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_publicIPAddresses@2022-07-01/main.tf index 4e4e7668..370cbb01 100644 --- a/dependency/azapi_examples/Microsoft.Network_publicIPAddresses@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_publicIPAddresses@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -44,7 +44,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_publicIPPrefixes@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_publicIPPrefixes@2022-07-01/main.tf index e29fdb07..65b229ce 100644 --- a/dependency/azapi_examples/Microsoft.Network_publicIPPrefixes@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_publicIPPrefixes@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "publicIPPrefix" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { prefixLength = 30 publicIPAddressVersion = "IPv4" @@ -42,7 +42,7 @@ resource "azapi_resource" "publicIPPrefix" { zones = [ "1", ] - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_routeFilters@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_routeFilters@2022-09-01/main.tf index 0ee0c7e1..2da7d1bf 100644 --- a/dependency/azapi_examples/Microsoft.Network_routeFilters@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_routeFilters@2022-09-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "routeFilter" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { rules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_routeTables@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_routeTables@2022-09-01/main.tf index c18093dd..a913abf8 100644 --- a/dependency/azapi_examples/Microsoft.Network_routeTables@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_routeTables@2022-09-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "routeTable" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { disableBgpRoutePropagation = false routes = [ @@ -45,7 +45,7 @@ resource "azapi_resource" "routeTable" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_routeTables_routes@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Network_routeTables_routes@2022-09-01/main.tf index 7b1d0785..dc81a2e9 100644 --- a/dependency/azapi_examples/Microsoft.Network_routeTables_routes@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_routeTables_routes@2022-09-01/main.tf @@ -31,26 +31,28 @@ resource "azapi_resource" "routeTable" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { disableBgpRoutePropagation = false } - }) + } schema_validation_enabled = false - ignore_body_changes = ["properties.routes"] response_export_values = ["*"] + lifecycle { + ignore_changes = [body.properties.routes] + } } resource "azapi_resource" "route" { type = "Microsoft.Network/routeTables/routes@2022-09-01" parent_id = azapi_resource.routeTable.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.1.0.0/16" nextHopType = "VnetLocal" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_securityPartnerProviders@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_securityPartnerProviders@2022-07-01/main.tf index c3df7608..94fb7807 100644 --- a/dependency/azapi_examples/Microsoft.Network_securityPartnerProviders@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_securityPartnerProviders@2022-07-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "securityPartnerProvider" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { securityProviderName = "ZScaler" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_serviceEndpointPolicies@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_serviceEndpointPolicies@2022-07-01/main.tf index 29895500..8570c031 100644 --- a/dependency/azapi_examples/Microsoft.Network_serviceEndpointPolicies@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_serviceEndpointPolicies@2022-07-01/main.tf @@ -31,10 +31,10 @@ resource "azapi_resource" "serviceEndpointPolicy" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles@2018-08-01/main.tf b/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles@2018-08-01/main.tf index 6118dc09..bd6409b0 100644 --- a/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles@2018-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles@2018-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "trafficManagerProfile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { dnsConfig = { relativeName = "acctest-tmp-230630034107605443" @@ -49,7 +49,7 @@ resource "azapi_resource" "trafficManagerProfile" { } trafficRoutingMethod = "Weighted" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_AzureEndpoints@2018-08-01/main.tf b/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_AzureEndpoints@2018-08-01/main.tf index 3c727948..dc413368 100644 --- a/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_AzureEndpoints@2018-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_AzureEndpoints@2018-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -47,7 +47,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Basic" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,7 +57,7 @@ resource "azapi_resource" "trafficManagerProfile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { dnsConfig = { relativeName = "acctest-tmp-230630034107607730" @@ -75,7 +75,7 @@ resource "azapi_resource" "trafficManagerProfile" { } trafficRoutingMethod = "Weighted" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -84,7 +84,7 @@ resource "azapi_resource" "AzureEndpoint" { type = "Microsoft.Network/trafficManagerProfiles/AzureEndpoints@2018-08-01" parent_id = azapi_resource.trafficManagerProfile.id name = var.resource_name - body = jsonencode({ + body = { properties = { customHeaders = [ ] @@ -94,7 +94,7 @@ resource "azapi_resource" "AzureEndpoint" { targetResourceId = azapi_resource.publicIPAddress.id weight = 3 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_ExternalEndpoints@2018-08-01/main.tf b/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_ExternalEndpoints@2018-08-01/main.tf index cb9f1ad9..a6bc74d3 100644 --- a/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_ExternalEndpoints@2018-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_ExternalEndpoints@2018-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "trafficManagerProfile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { dnsConfig = { relativeName = "acctest-tmp-230630034107608613" @@ -49,7 +49,7 @@ resource "azapi_resource" "trafficManagerProfile" { } trafficRoutingMethod = "Weighted" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -58,7 +58,7 @@ resource "azapi_resource" "ExternalEndpoint" { type = "Microsoft.Network/trafficManagerProfiles/ExternalEndpoints@2018-08-01" parent_id = azapi_resource.trafficManagerProfile.id name = var.resource_name - body = jsonencode({ + body = { properties = { customHeaders = [ ] @@ -68,7 +68,7 @@ resource "azapi_resource" "ExternalEndpoint" { target = "www.example.com" weight = 3 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_NestedEndpoints@2018-08-01/main.tf b/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_NestedEndpoints@2018-08-01/main.tf index 0a4b8b81..ad1bb58f 100644 --- a/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_NestedEndpoints@2018-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_trafficManagerProfiles_NestedEndpoints@2018-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "trafficManagerProfile" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { dnsConfig = { relativeName = "acctest-tmp-230630034107605443" @@ -49,7 +49,7 @@ resource "azapi_resource" "trafficManagerProfile" { } trafficRoutingMethod = "Weighted" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -59,7 +59,7 @@ resource "azapi_resource" "trafficManagerProfile2" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { dnsConfig = { relativeName = "acctesttmpchild230630034107605443" @@ -77,7 +77,7 @@ resource "azapi_resource" "trafficManagerProfile2" { } trafficRoutingMethod = "Priority" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -86,7 +86,7 @@ resource "azapi_resource" "NestedEndpoint" { type = "Microsoft.Network/trafficManagerProfiles/NestedEndpoints@2018-08-01" parent_id = azapi_resource.trafficManagerProfile.id name = var.resource_name - body = jsonencode({ + body = { properties = { customHeaders = [ ] @@ -97,7 +97,7 @@ resource "azapi_resource" "NestedEndpoint" { targetResourceId = azapi_resource.trafficManagerProfile2.id weight = 3 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_virtualHubs@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_virtualHubs@2022-07-01/main.tf index a51e650d..b449b72a 100644 --- a/dependency/azapi_examples/Microsoft.Network_virtualHubs@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_virtualHubs@2022-07-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "virtualWan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowBranchToBranchTraffic = true disableVpnEncryption = false office365LocalBreakoutCategory = "None" type = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,7 +48,7 @@ resource "azapi_resource" "virtualHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.0.0/24" hubRoutingPreference = "ExpressRoute" @@ -59,7 +59,7 @@ resource "azapi_resource" "virtualHub" { id = azapi_resource.virtualWan.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_virtualHubs_hubVirtualNetworkConnections@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_virtualHubs_hubVirtualNetworkConnections@2022-07-01/main.tf index 20328e78..3614fdee 100644 --- a/dependency/azapi_examples/Microsoft.Network_virtualHubs_hubVirtualNetworkConnections@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_virtualHubs_hubVirtualNetworkConnections@2022-07-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "virtualWan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowBranchToBranchTraffic = true disableVpnEncryption = false office365LocalBreakoutCategory = "None" type = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,7 +48,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -62,10 +62,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "virtualHub" { @@ -73,7 +75,7 @@ resource "azapi_resource" "virtualHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" hubRoutingPreference = "ExpressRoute" @@ -84,7 +86,7 @@ resource "azapi_resource" "virtualHub" { id = azapi_resource.virtualWan.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -93,14 +95,14 @@ resource "azapi_resource" "hubVirtualNetworkConnection" { type = "Microsoft.Network/virtualHubs/hubVirtualNetworkConnections@2022-07-01" parent_id = azapi_resource.virtualHub.id name = var.resource_name - body = jsonencode({ + body = { properties = { enableInternetSecurity = false remoteVirtualNetwork = { id = azapi_resource.virtualNetwork.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_virtualHubs_ipConfigurations@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_virtualHubs_ipConfigurations@2022-07-01/main.tf index fcc3bcc9..edc8d16d 100644 --- a/dependency/azapi_examples/Microsoft.Network_virtualHubs_ipConfigurations@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_virtualHubs_ipConfigurations@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "publicIPAddress" { @@ -56,7 +58,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -69,7 +71,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -79,7 +81,7 @@ resource "azapi_resource" "virtualHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { hubRoutingPreference = "ExpressRoute" sku = "Standard" @@ -87,7 +89,7 @@ resource "azapi_resource" "virtualHub" { minCapacity = 2 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -96,7 +98,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "RouteServerSubnet" - body = jsonencode({ + body = { properties = { addressPrefix = "10.5.1.0/24" delegations = [ @@ -108,7 +110,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -117,7 +119,7 @@ resource "azapi_resource" "ipConfiguration" { type = "Microsoft.Network/virtualHubs/ipConfigurations@2022-07-01" parent_id = azapi_resource.virtualHub.id name = var.resource_name - body = jsonencode({ + body = { properties = { privateIPAddress = "10.5.1.18" privateIPAllocationMethod = "Static" @@ -128,7 +130,7 @@ resource "azapi_resource" "ipConfiguration" { id = azapi_resource.subnet.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_virtualNetworkGateways@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_virtualNetworkGateways@2022-07-01/main.tf index fc44e59f..c7f4462f 100644 --- a/dependency/azapi_examples/Microsoft.Network_virtualNetworkGateways@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_virtualNetworkGateways@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -48,10 +48,12 @@ resource "azapi_resource" "virtualNetwork" { tags = { SkipASMAzSecPack = "true" } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "publicIPAddress" { @@ -59,7 +61,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -72,7 +74,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Standard" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -81,7 +83,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "GatewaySubnet" - body = jsonencode({ + body = { properties = { addressPrefix = "10.6.1.0/24" delegations = [ @@ -93,7 +95,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -103,7 +105,7 @@ resource "azapi_resource" "virtualNetworkGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { activeActive = false enableBgp = false @@ -129,7 +131,7 @@ resource "azapi_resource" "virtualNetworkGateway" { } vpnType = "RouteBased" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_virtualNetworkGateways_natRules@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_virtualNetworkGateways_natRules@2022-07-01/main.tf index 1e10c739..1e58499b 100644 --- a/dependency/azapi_examples/Microsoft.Network_virtualNetworkGateways_natRules@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_virtualNetworkGateways_natRules@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,10 +45,12 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "publicIPAddress" { @@ -56,7 +58,7 @@ resource "azapi_resource" "publicIPAddress" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { ddosSettings = { protectionMode = "VirtualNetworkInherited" @@ -69,7 +71,7 @@ resource "azapi_resource" "publicIPAddress" { name = "Basic" tier = "Regional" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,7 +80,7 @@ resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = "GatewaySubnet" - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.1.0/24" delegations = [ @@ -90,7 +92,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,7 +102,7 @@ resource "azapi_resource" "virtualNetworkGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { activeActive = false enableBgp = false @@ -126,7 +128,7 @@ resource "azapi_resource" "virtualNetworkGateway" { } vpnType = "RouteBased" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -140,7 +142,7 @@ resource "azapi_resource" "natRule" { type = "Microsoft.Network/virtualNetworkGateways/natRules@2022-07-01" parent_id = azapi_resource.virtualNetworkGateway.id name = var.resource_name - body = jsonencode({ + body = { properties = { externalMappings = [ { @@ -155,7 +157,7 @@ resource "azapi_resource" "natRule" { mode = "EgressSnat" type = "Static" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_virtualNetworks@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_virtualNetworks@2022-07-01/main.tf index a9a44da6..c5820f9d 100644 --- a/dependency/azapi_examples/Microsoft.Network_virtualNetworks@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_virtualNetworks@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,9 +45,11 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } diff --git a/dependency/azapi_examples/Microsoft.Network_virtualNetworks_subnets@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_virtualNetworks_subnets@2022-07-01/main.tf index 182d477c..77f80414 100644 --- a/dependency/azapi_examples/Microsoft.Network_virtualNetworks_subnets@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_virtualNetworks_subnets@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -39,21 +39,23 @@ resource "azapi_resource" "virtualNetwork" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_virtualNetworks_virtualNetworkPeerings@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_virtualNetworks_virtualNetworkPeerings@2022-07-01/main.tf index 3ffc4587..637b245c 100644 --- a/dependency/azapi_examples/Microsoft.Network_virtualNetworks_virtualNetworkPeerings@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_virtualNetworks_virtualNetworkPeerings@2022-07-01/main.tf @@ -37,7 +37,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { managedResourceGroupId = data.azapi_resource_id.workspace_resource_group.id parameters = { @@ -53,7 +53,7 @@ resource "azapi_resource" "workspace" { sku = { name = "standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -63,7 +63,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -77,17 +77,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "virtualNetworkPeering" { type = "Microsoft.Databricks/workspaces/virtualNetworkPeerings@2023-02-01" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { properties = { allowForwardedTraffic = false allowGatewayTransit = false @@ -107,7 +109,7 @@ resource "azapi_resource" "virtualNetworkPeering" { } useRemoteGateways = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_virtualWans@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_virtualWans@2022-07-01/main.tf index d9c986cb..932c6b55 100644 --- a/dependency/azapi_examples/Microsoft.Network_virtualWans@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_virtualWans@2022-07-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "virtualWan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowBranchToBranchTraffic = true disableVpnEncryption = false office365LocalBreakoutCategory = "None" type = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_vpnGateways@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_vpnGateways@2022-07-01/main.tf index 2b5a3c0e..c9ef8b9d 100644 --- a/dependency/azapi_examples/Microsoft.Network_vpnGateways@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_vpnGateways@2022-07-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "virtualWan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowBranchToBranchTraffic = true disableVpnEncryption = false office365LocalBreakoutCategory = "None" type = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,7 +48,7 @@ resource "azapi_resource" "virtualHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.0.0/24" hubRoutingPreference = "ExpressRoute" @@ -59,7 +59,7 @@ resource "azapi_resource" "virtualHub" { id = azapi_resource.virtualWan.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -69,7 +69,7 @@ resource "azapi_resource" "vpnGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enableBgpRouteTranslationForNat = false isRoutingPreferenceInternet = false @@ -78,7 +78,7 @@ resource "azapi_resource" "vpnGateway" { } vpnGatewayScaleUnit = 1 } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { diff --git a/dependency/azapi_examples/Microsoft.Network_vpnGateways_natRules@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_vpnGateways_natRules@2022-07-01/main.tf index cb38acfd..aca98ac9 100644 --- a/dependency/azapi_examples/Microsoft.Network_vpnGateways_natRules@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_vpnGateways_natRules@2022-07-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "virtualWan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowBranchToBranchTraffic = true disableVpnEncryption = false office365LocalBreakoutCategory = "None" type = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,7 +48,7 @@ resource "azapi_resource" "virtualHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.0.0/24" hubRoutingPreference = "ExpressRoute" @@ -59,7 +59,7 @@ resource "azapi_resource" "virtualHub" { id = azapi_resource.virtualWan.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -69,7 +69,7 @@ resource "azapi_resource" "vpnGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enableBgpRouteTranslationForNat = false isRoutingPreferenceInternet = false @@ -78,7 +78,7 @@ resource "azapi_resource" "vpnGateway" { } vpnGatewayScaleUnit = 1 } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -92,7 +92,7 @@ resource "azapi_resource" "natRule" { type = "Microsoft.Network/vpnGateways/natRules@2022-07-01" parent_id = azapi_resource.vpnGateway.id name = var.resource_name - body = jsonencode({ + body = { properties = { externalMappings = [ { @@ -107,7 +107,7 @@ resource "azapi_resource" "natRule" { mode = "EgressSnat" type = "Static" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_vpnGateways_vpnConnections@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_vpnGateways_vpnConnections@2022-07-01/main.tf index 5dca4ee2..bcf5199c 100644 --- a/dependency/azapi_examples/Microsoft.Network_vpnGateways_vpnConnections@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_vpnGateways_vpnConnections@2022-07-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "virtualWan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowBranchToBranchTraffic = true disableVpnEncryption = false office365LocalBreakoutCategory = "None" type = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,7 +48,7 @@ resource "azapi_resource" "virtualHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.0.0/24" hubRoutingPreference = "ExpressRoute" @@ -59,7 +59,7 @@ resource "azapi_resource" "virtualHub" { id = azapi_resource.virtualWan.id } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -69,7 +69,7 @@ resource "azapi_resource" "vpnSite" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -104,7 +104,7 @@ resource "azapi_resource" "vpnSite" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -126,7 +126,7 @@ resource "azapi_resource" "vpnGateway" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enableBgpRouteTranslationForNat = false isRoutingPreferenceInternet = false @@ -135,7 +135,7 @@ resource "azapi_resource" "vpnGateway" { } vpnGatewayScaleUnit = 1 } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { @@ -149,7 +149,7 @@ resource "azapi_resource" "vpnConnection" { type = "Microsoft.Network/vpnGateways/vpnConnections@2022-07-01" parent_id = azapi_resource.vpnGateway.id name = var.resource_name - body = jsonencode({ + body = { properties = { enableInternetSecurity = false remoteVpnSite = { @@ -194,7 +194,7 @@ resource "azapi_resource" "vpnConnection" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_vpnServerConfigurations@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_vpnServerConfigurations@2022-07-01/main.tf index 4173190d..3dbadb98 100644 --- a/dependency/azapi_examples/Microsoft.Network_vpnServerConfigurations@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_vpnServerConfigurations@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "vpnServerConfiguration" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { radiusClientRootCertificates = [ ] @@ -60,7 +60,7 @@ resource "azapi_resource" "vpnServerConfiguration" { "IkeV2", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_vpnServerConfigurations_configurationPolicyGroups@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_vpnServerConfigurations_configurationPolicyGroups@2022-07-01/main.tf index 4402ecf5..b804b8df 100644 --- a/dependency/azapi_examples/Microsoft.Network_vpnServerConfigurations_configurationPolicyGroups@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_vpnServerConfigurations_configurationPolicyGroups@2022-07-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "vpnServerConfiguration" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { radiusClientRootCertificates = [ ] @@ -60,7 +60,7 @@ resource "azapi_resource" "vpnServerConfiguration" { "IkeV2", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -69,7 +69,7 @@ resource "azapi_resource" "configurationPolicyGroup" { type = "Microsoft.Network/vpnServerConfigurations/configurationPolicyGroups@2022-07-01" parent_id = azapi_resource.vpnServerConfiguration.id name = var.resource_name - body = jsonencode({ + body = { properties = { isDefault = false policyMembers = [ @@ -81,7 +81,7 @@ resource "azapi_resource" "configurationPolicyGroup" { ] priority = 0 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Network_vpnSites@2022-07-01/main.tf b/dependency/azapi_examples/Microsoft.Network_vpnSites@2022-07-01/main.tf index 210ef6ec..ef2b93c3 100644 --- a/dependency/azapi_examples/Microsoft.Network_vpnSites@2022-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Network_vpnSites@2022-07-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "virtualWan" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { allowBranchToBranchTraffic = true disableVpnEncryption = false office365LocalBreakoutCategory = "None" type = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,7 +48,7 @@ resource "azapi_resource" "vpnSite" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -83,7 +83,7 @@ resource "azapi_resource" "vpnSite" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces@2017-04-01/main.tf b/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces@2017-04-01/main.tf index e1667185..f184032d 100644 --- a/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces@2017-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces@2017-04-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enabled = true namespaceType = "NotificationHub" @@ -40,7 +40,7 @@ resource "azapi_resource" "namespace" { sku = { name = "Free" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces_notificationHubs@2017-04-01/main.tf b/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces_notificationHubs@2017-04-01/main.tf index e4497209..df75754a 100644 --- a/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces_notificationHubs@2017-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces_notificationHubs@2017-04-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enabled = true namespaceType = "NotificationHub" @@ -40,7 +40,7 @@ resource "azapi_resource" "namespace" { sku = { name = "Free" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,10 +50,10 @@ resource "azapi_resource" "notificationHub" { parent_id = azapi_resource.namespace.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces_notificationHubs_authorizationRules@2017-04-01/main.tf b/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces_notificationHubs_authorizationRules@2017-04-01/main.tf index 21332660..0dc2a350 100644 --- a/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces_notificationHubs_authorizationRules@2017-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.NotificationHubs_namespaces_notificationHubs_authorizationRules@2017-04-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { enabled = true namespaceType = "NotificationHub" @@ -40,7 +40,7 @@ resource "azapi_resource" "namespace" { sku = { name = "Free" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,10 +50,10 @@ resource "azapi_resource" "notificationHub" { parent_id = azapi_resource.namespace.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -62,13 +62,13 @@ resource "azapi_resource" "authorizationRule" { type = "Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules@2017-04-01" parent_id = azapi_resource.notificationHub.id name = var.resource_name - body = jsonencode({ + body = { properties = { rights = [ "Listen", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.OperationalInsights_clusters@2020-08-01/main.tf b/dependency/azapi_examples/Microsoft.OperationalInsights_clusters@2020-08-01/main.tf index 25d2662b..6ef46eff 100644 --- a/dependency/azapi_examples/Microsoft.OperationalInsights_clusters@2020-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.OperationalInsights_clusters@2020-08-01/main.tf @@ -31,15 +31,16 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { sku = { capacity = 1000 name = "CapacityReservation" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.OperationalInsights_queryPacks@2019-09-01/main.tf b/dependency/azapi_examples/Microsoft.OperationalInsights_queryPacks@2019-09-01/main.tf index 44bba9c5..fbce424b 100644 --- a/dependency/azapi_examples/Microsoft.OperationalInsights_queryPacks@2019-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.OperationalInsights_queryPacks@2019-09-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "queryPack" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.OperationalInsights_queryPacks_queries@2019-09-01/main.tf b/dependency/azapi_examples/Microsoft.OperationalInsights_queryPacks_queries@2019-09-01/main.tf index 64b1e5db..39c5b905 100644 --- a/dependency/azapi_examples/Microsoft.OperationalInsights_queryPacks_queries@2019-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.OperationalInsights_queryPacks_queries@2019-09-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "queryPack" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -44,14 +44,14 @@ resource "azapi_resource" "query" { type = "Microsoft.OperationalInsights/queryPacks/queries@2019-09-01" parent_id = azapi_resource.queryPack.id name = "aca50e92-d3e6-8f7d-1f70-2ec7adc1a926" - body = jsonencode({ + body = { properties = { body = " let newExceptionsTimeRange = 1d;\n let timeRangeToCheckBefore = 7d;\n exceptions\n | where timestamp < ago(timeRangeToCheckBefore)\n | summarize count() by problemId\n | join kind= rightanti (\n exceptions\n | where timestamp >= ago(newExceptionsTimeRange)\n | extend stack = tostring(details[0].rawStack)\n | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId\n ) on problemId\n | order by count_ desc\n" displayName = "Exceptions - New in the last 24 hours" related = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces@2022-10-01/main.tf index fcd43ce9..4ded524c 100644 --- a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces@2022-10-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_dataExports@2020-08-01/main.tf b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_dataExports@2020-08-01/main.tf index 67d9e301..f9187870 100644 --- a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_dataExports@2020-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_dataExports@2020-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,10 +57,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -92,7 +89,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -101,7 +98,7 @@ resource "azapi_resource" "dataExport" { type = "Microsoft.OperationalInsights/workspaces/dataExports@2020-08-01" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { properties = { destination = { resourceId = azapi_resource.storageAccount.id @@ -111,7 +108,7 @@ resource "azapi_resource" "dataExport" { "Heartbeat", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_dataSources@2020-08-01/main.tf b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_dataSources@2020-08-01/main.tf index 520730d2..fffb2067 100644 --- a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_dataSources@2020-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_dataSources@2020-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,7 +56,7 @@ resource "azapi_resource" "dataSource" { type = "Microsoft.OperationalInsights/workspaces/dataSources@2020-08-01" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { kind = "WindowsPerformanceCounter" properties = { counterName = "CPU" @@ -64,7 +64,7 @@ resource "azapi_resource" "dataSource" { intervalSeconds = 10 objectName = "CPU" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_linkedServices@2020-08-01/main.tf b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_linkedServices@2020-08-01/main.tf index 3dbe3e2a..c2f07bf7 100644 --- a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_linkedServices@2020-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_linkedServices@2020-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,7 +57,7 @@ resource "azapi_resource" "automationAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { encryption = { keySource = "Microsoft.Automation" @@ -67,7 +67,7 @@ resource "azapi_resource" "automationAccount" { name = "Basic" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,11 +76,11 @@ resource "azapi_resource" "linkedService" { type = "Microsoft.OperationalInsights/workspaces/linkedServices@2020-08-01" parent_id = azapi_resource.workspace.id name = "Automation" - body = jsonencode({ + body = { properties = { resourceId = azapi_resource.automationAccount.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_linkedStorageAccounts@2020-08-01/main.tf b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_linkedStorageAccounts@2020-08-01/main.tf index 924f4a48..45ced34a 100644 --- a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_linkedStorageAccounts@2020-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_linkedStorageAccounts@2020-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,10 +57,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -92,7 +89,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_GRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -101,13 +98,13 @@ resource "azapi_resource" "linkedStorageAccount" { type = "Microsoft.OperationalInsights/workspaces/linkedStorageAccounts@2020-08-01" parent_id = azapi_resource.workspace.id name = "CustomLogs" - body = jsonencode({ + body = { properties = { storageAccountIds = [ azapi_resource.storageAccount.id, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_savedSearches@2020-08-01/main.tf b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_savedSearches@2020-08-01/main.tf index e548be56..91d6425c 100644 --- a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_savedSearches@2020-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_savedSearches@2020-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,7 +56,7 @@ resource "azapi_resource" "savedSearch" { type = "Microsoft.OperationalInsights/workspaces/savedSearches@2020-08-01" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { properties = { category = "Saved Search Test Category" displayName = "Create or Update Saved Search Test" @@ -65,7 +65,7 @@ resource "azapi_resource" "savedSearch" { tags = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_storageInsightConfigs@2020-08-01/main.tf b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_storageInsightConfigs@2020-08-01/main.tf index 4c0bdf6c..5af6cdb0 100644 --- a/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_storageInsightConfigs@2020-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.OperationalInsights_workspaces_storageInsightConfigs@2020-08-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,10 +57,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -92,7 +89,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -108,14 +105,14 @@ resource "azapi_resource" "storageInsightConfig" { type = "Microsoft.OperationalInsights/workspaces/storageInsightConfigs@2020-08-01" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { properties = { storageAccount = { id = azapi_resource.storageAccount.id - key = jsondecode(data.azapi_resource_action.listKeys.output).keys[0].value + key = data.azapi_resource_action.listKeys.output.keys[0].value } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Orbital_spacecrafts@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.Orbital_spacecrafts@2022-11-01/main.tf index 0620a170..50e80fdc 100644 --- a/dependency/azapi_examples/Microsoft.Orbital_spacecrafts@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Orbital_spacecrafts@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "spacecraft" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { links = [ { @@ -48,7 +48,7 @@ resource "azapi_resource" "spacecraft" { tleLine2 = "2 23455 99.0090 272.6745 0008546 223.1686 136.8816 14.11711747148495" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.PolicyInsights_remediations@2021-10-01/main.tf b/dependency/azapi_examples/Microsoft.PolicyInsights_remediations@2021-10-01/main.tf index 4483bb67..2197b961 100644 --- a/dependency/azapi_examples/Microsoft.PolicyInsights_remediations@2021-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.PolicyInsights_remediations@2021-10-01/main.tf @@ -41,7 +41,7 @@ resource "azapi_resource" "policyAssignment" { type = "Microsoft.Authorization/policyAssignments@2022-06-01" parent_id = data.azapi_resource.subscription.id name = var.resource_name - body = jsonencode({ + body = { properties = { displayName = "" enforcementMode = "Default" @@ -57,7 +57,7 @@ resource "azapi_resource" "policyAssignment" { policyDefinitionId = "/providers/Microsoft.Authorization/policyDefinitions/e56962a6-4747-49cd-b67b-bf8b01975c4c" scope = data.azapi_resource.subscription.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -66,7 +66,7 @@ resource "azapi_resource" "remediation" { type = "Microsoft.PolicyInsights/remediations@2021-10-01" parent_id = data.azapi_resource.subscription.id name = var.resource_name - body = jsonencode({ + body = { properties = { filters = { locations = [ @@ -76,7 +76,7 @@ resource "azapi_resource" "remediation" { policyDefinitionReferenceId = "" resourceDiscoveryMode = "ExistingNonCompliant" } - }) + } schema_validation_enabled = false ignore_casing = true response_export_values = ["*"] diff --git a/dependency/azapi_examples/Microsoft.Portal_dashboards@2019-01-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Portal_dashboards@2019-01-01-preview/main.tf index 1a85969e..571a37f1 100644 --- a/dependency/azapi_examples/Microsoft.Portal_dashboards@2019-01-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Portal_dashboards@2019-01-01-preview/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "dashboard" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { lenses = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.PowerBIDedicated_capacities@2021-01-01/main.tf b/dependency/azapi_examples/Microsoft.PowerBIDedicated_capacities@2021-01-01/main.tf index a1cd2282..58393ea4 100644 --- a/dependency/azapi_examples/Microsoft.PowerBIDedicated_capacities@2021-01-01/main.tf +++ b/dependency/azapi_examples/Microsoft.PowerBIDedicated_capacities@2021-01-01/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "capacity" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administration = { members = [ @@ -54,7 +54,7 @@ resource "azapi_resource" "capacity" { sku = { name = "A1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Purview_accounts@2021-07-01/main.tf b/dependency/azapi_examples/Microsoft.Purview_accounts@2021-07-01/main.tf index cc0c0c8d..3492bddf 100644 --- a/dependency/azapi_examples/Microsoft.Purview_accounts@2021-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Purview_accounts@2021-07-01/main.tf @@ -31,15 +31,15 @@ resource "azapi_resource" "account" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { publicNetworkAccess = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults@2022-10-01/main.tf index 544b6104..4977bbd5 100644 --- a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults@2022-10-01/main.tf @@ -31,18 +31,14 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { publicNetworkAccess = "Enabled" } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupPolicies@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupPolicies@2023-02-01/main.tf index 52e20161..61f2ceed 100644 --- a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupPolicies@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupPolicies@2023-02-01/main.tf @@ -31,18 +31,14 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { publicNetworkAccess = "Enabled" } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,7 +47,7 @@ resource "azapi_resource" "backupPolicy" { type = "Microsoft.RecoveryServices/vaults/backupPolicies@2023-02-01" parent_id = azapi_resource.vault.id name = var.resource_name - body = jsonencode({ + body = { properties = { backupManagementType = "AzureStorage" retentionPolicy = { @@ -76,7 +72,7 @@ resource "azapi_resource" "backupPolicy" { timeZone = "UTC" workLoadType = "AzureFileShare" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupResourceGuardProxies@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupResourceGuardProxies@2023-02-01/main.tf index 63ddeee5..a1715707 100644 --- a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupResourceGuardProxies@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupResourceGuardProxies@2023-02-01/main.tf @@ -31,18 +31,14 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { publicNetworkAccess = "Enabled" } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -52,12 +48,12 @@ resource "azapi_resource" "resourceGuard" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { vaultCriticalOperationExclusionList = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -66,12 +62,12 @@ resource "azapi_resource" "backupResourceGuardProxy" { type = "Microsoft.RecoveryServices/vaults/backupResourceGuardProxies@2023-02-01" parent_id = azapi_resource.vault.id name = var.resource_name - body = jsonencode({ + body = { properties = { resourceGuardResourceId = azapi_resource.resourceGuard.id } type = "Microsoft.RecoveryServices/vaults/backupResourceGuardProxies" - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupStorageConfig@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupStorageConfig@2023-02-01/main.tf index a173b592..f3bfcc91 100644 --- a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupStorageConfig@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_backupStorageConfig@2023-02-01/main.tf @@ -31,18 +31,14 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { publicNetworkAccess = "Enabled" } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,12 +47,12 @@ resource "azapi_update_resource" "backupStorageConfig" { type = "Microsoft.RecoveryServices/vaults/backupStorageConfig@2023-02-01" parent_id = azapi_resource.vault.id name = "vaultStorageConfig" - body = jsonencode({ + body = { properties = { crossRegionRestoreFlag = false storageModelType = "GeoRedundant" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationFabrics@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationFabrics@2022-10-01/main.tf index 0cbf516d..64a65589 100644 --- a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationFabrics@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationFabrics@2022-10-01/main.tf @@ -31,18 +31,14 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { publicNetworkAccess = "Enabled" } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,14 +47,14 @@ resource "azapi_resource" "replicationFabric2" { type = "Microsoft.RecoveryServices/vaults/replicationFabrics@2022-10-01" parent_id = azapi_resource.vault.id name = var.resource_name - body = jsonencode({ + body = { properties = { customDetails = { instanceType = "Azure" location = var.location } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationFabrics_replicationProtectionContainers@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationFabrics_replicationProtectionContainers@2022-10-01/main.tf index de609a27..83a58809 100644 --- a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationFabrics_replicationProtectionContainers@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationFabrics_replicationProtectionContainers@2022-10-01/main.tf @@ -31,18 +31,14 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { publicNetworkAccess = "Enabled" } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,14 +47,14 @@ resource "azapi_resource" "replicationFabric" { type = "Microsoft.RecoveryServices/vaults/replicationFabrics@2022-10-01" parent_id = azapi_resource.vault.id name = var.resource_name - body = jsonencode({ + body = { properties = { customDetails = { instanceType = "Azure" location = var.location } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,10 +63,10 @@ resource "azapi_resource" "replicationProtectionContainer" { type = "Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers@2022-10-01" parent_id = azapi_resource.replicationFabric.id name = var.resource_name - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationPolicies@2022-10-01/main.tf b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationPolicies@2022-10-01/main.tf index 57716fac..306792a8 100644 --- a/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationPolicies@2022-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.RecoveryServices_vaults_replicationPolicies@2022-10-01/main.tf @@ -31,18 +31,14 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { publicNetworkAccess = "Enabled" } sku = { name = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,7 +47,7 @@ resource "azapi_resource" "replicationPolicy" { type = "Microsoft.RecoveryServices/vaults/replicationPolicies@2022-10-01" parent_id = azapi_resource.vault.id name = var.resource_name - body = jsonencode({ + body = { properties = { providerSpecificInput = { appConsistentFrequencyInMinutes = 240 @@ -61,7 +57,7 @@ resource "azapi_resource" "replicationPolicy" { recoveryPointHistoryInMinutes = 1440 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Relay_namespaces@2017-04-01/main.tf b/dependency/azapi_examples/Microsoft.Relay_namespaces@2017-04-01/main.tf index cfeaff78..8f416490 100644 --- a/dependency/azapi_examples/Microsoft.Relay_namespaces@2017-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Relay_namespaces@2017-04-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Relay_namespaces_authorizationRules@2017-04-01/main.tf b/dependency/azapi_examples/Microsoft.Relay_namespaces_authorizationRules@2017-04-01/main.tf index a792f606..d0fe3665 100644 --- a/dependency/azapi_examples/Microsoft.Relay_namespaces_authorizationRules@2017-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Relay_namespaces_authorizationRules@2017-04-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,14 +47,14 @@ resource "azapi_resource" "authorizationRule" { type = "Microsoft.Relay/namespaces/authorizationRules@2017-04-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { rights = [ "Listen", "Send", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Relay_namespaces_hybridConnections@2017-04-01/main.tf b/dependency/azapi_examples/Microsoft.Relay_namespaces_hybridConnections@2017-04-01/main.tf index 42cc696b..9b4f5322 100644 --- a/dependency/azapi_examples/Microsoft.Relay_namespaces_hybridConnections@2017-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Relay_namespaces_hybridConnections@2017-04-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,12 +47,12 @@ resource "azapi_resource" "hybridConnection" { type = "Microsoft.Relay/namespaces/hybridConnections@2017-04-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { requiresClientAuthorization = true userMetadata = "metadatatest" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Relay_namespaces_hybridConnections_authorizationRules@2017-04-01/main.tf b/dependency/azapi_examples/Microsoft.Relay_namespaces_hybridConnections_authorizationRules@2017-04-01/main.tf index 37ca8b8e..563d993c 100644 --- a/dependency/azapi_examples/Microsoft.Relay_namespaces_hybridConnections_authorizationRules@2017-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Relay_namespaces_hybridConnections_authorizationRules@2017-04-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,12 +47,12 @@ resource "azapi_resource" "hybridConnection" { type = "Microsoft.Relay/namespaces/hybridConnections@2017-04-01" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { requiresClientAuthorization = true userMetadata = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -61,14 +61,14 @@ resource "azapi_resource" "authorizationRule" { type = "Microsoft.Relay/namespaces/hybridConnections/authorizationRules@2017-04-01" parent_id = azapi_resource.hybridConnection.id name = var.resource_name - body = jsonencode({ + body = { properties = { rights = [ "Listen", "Send", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Resources_deploymentScripts@2020-10-01/main.tf b/dependency/azapi_examples/Microsoft.Resources_deploymentScripts@2020-10-01/main.tf index 5c791902..6749f1e1 100644 --- a/dependency/azapi_examples/Microsoft.Resources_deploymentScripts@2020-10-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Resources_deploymentScripts@2020-10-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "deploymentScript" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "AzurePowerShell" properties = { azPowerShellVersion = "8.3" @@ -42,7 +42,7 @@ resource "azapi_resource" "deploymentScript" { supportingScriptUris = null timeout = "P1D" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Resources_deployments@2020-06-01/main.tf b/dependency/azapi_examples/Microsoft.Resources_deployments@2020-06-01/main.tf index 8cb083ad..7ab76787 100644 --- a/dependency/azapi_examples/Microsoft.Resources_deployments@2020-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Resources_deployments@2020-06-01/main.tf @@ -30,7 +30,7 @@ resource "azapi_resource" "deployment" { type = "Microsoft.Resources/deployments@2020-06-01" parent_id = azapi_resource.resourceGroup.id name = var.resource_name - body = jsonencode({ + body = { properties = { mode = "Complete" template = { @@ -83,7 +83,7 @@ resource "azapi_resource" "deployment" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Search_searchServices@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Search_searchServices@2022-09-01/main.tf index 6dc935d9..797193ee 100644 --- a/dependency/azapi_examples/Microsoft.Search_searchServices@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Search_searchServices@2022-09-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "searchService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { authOptions = { apiKeyOnly = { @@ -56,7 +56,7 @@ resource "azapi_resource" "searchService" { tags = { environment = "staging" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Search_searchServices_sharedPrivateLinkResources@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Search_searchServices_sharedPrivateLinkResources@2022-09-01/main.tf index f51d38a8..5c68cf7c 100644 --- a/dependency/azapi_examples/Microsoft.Search_searchServices_sharedPrivateLinkResources@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Search_searchServices_sharedPrivateLinkResources@2022-09-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,7 +73,7 @@ resource "azapi_resource" "searchService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { authOptions = { apiKeyOnly = { @@ -101,7 +98,7 @@ resource "azapi_resource" "searchService" { tags = { environment = "staging" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -110,13 +107,13 @@ resource "azapi_resource" "sharedPrivateLinkResource" { type = "Microsoft.Search/searchServices/sharedPrivateLinkResources@2022-09-01" parent_id = azapi_resource.searchService.id name = var.resource_name - body = jsonencode({ + body = { properties = { groupId = "blob" privateLinkResourceId = azapi_resource.storageAccount.id requestMessage = "please approve" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.SecurityInsights_alertRules@2022-10-01-preview/main.tf b/dependency/azapi_examples/Microsoft.SecurityInsights_alertRules@2022-10-01-preview/main.tf index e31ec795..220ba2d7 100644 --- a/dependency/azapi_examples/Microsoft.SecurityInsights_alertRules@2022-10-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.SecurityInsights_alertRules@2022-10-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,18 +56,18 @@ resource "azapi_resource" "onboardingState" { type = "Microsoft.SecurityInsights/onboardingStates@2023-06-01-preview" parent_id = azapi_resource.workspace.id name = "default" - body = jsonencode({ + body = { properties = { customerManagedKey = false } - }) + } } resource "azapi_resource" "alertRule" { type = "Microsoft.SecurityInsights/alertRules@2022-10-01-preview" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { kind = "NRT" properties = { description = "" @@ -82,7 +82,7 @@ resource "azapi_resource" "alertRule" { techniques = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] depends_on = [azapi_resource.onboardingState] diff --git a/dependency/azapi_examples/Microsoft.SecurityInsights_automationRules@2022-10-01-preview/main.tf b/dependency/azapi_examples/Microsoft.SecurityInsights_automationRules@2022-10-01-preview/main.tf index d7fe9a65..e3fa2c2f 100644 --- a/dependency/azapi_examples/Microsoft.SecurityInsights_automationRules@2022-10-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.SecurityInsights_automationRules@2022-10-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,18 +56,18 @@ resource "azapi_resource" "onboardingState" { type = "Microsoft.SecurityInsights/onboardingStates@2023-06-01-preview" parent_id = azapi_resource.workspace.id name = "default" - body = jsonencode({ + body = { properties = { customerManagedKey = false } - }) + } } resource "azapi_resource" "automationRule" { type = "Microsoft.SecurityInsights/automationRules@2022-10-01-preview" parent_id = azapi_resource.workspace.id name = "3b862818-ad7b-409e-83be-8812f2a06d37" - body = jsonencode({ + body = { properties = { actions = [ { @@ -90,7 +90,7 @@ resource "azapi_resource" "automationRule" { triggersWhen = "Created" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] depends_on = [azapi_resource.onboardingState] diff --git a/dependency/azapi_examples/Microsoft.SecurityInsights_dataConnectors@2022-10-01-preview/main.tf b/dependency/azapi_examples/Microsoft.SecurityInsights_dataConnectors@2022-10-01-preview/main.tf index 4b7fb928..f0a4c9a8 100644 --- a/dependency/azapi_examples/Microsoft.SecurityInsights_dataConnectors@2022-10-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.SecurityInsights_dataConnectors@2022-10-01-preview/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -58,7 +58,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,18 +67,18 @@ resource "azapi_resource" "onboardingState" { type = "Microsoft.SecurityInsights/onboardingStates@2023-06-01-preview" parent_id = azapi_resource.workspace.id name = "default" - body = jsonencode({ + body = { properties = { customerManagedKey = false } - }) + } } resource "azapi_resource" "dataConnector" { type = "Microsoft.SecurityInsights/dataConnectors@2022-10-01-preview" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { kind = "MicrosoftThreatIntelligence" properties = { dataTypes = { @@ -93,7 +93,7 @@ resource "azapi_resource" "dataConnector" { } tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] depends_on = [azapi_resource.onboardingState] diff --git a/dependency/azapi_examples/Microsoft.SecurityInsights_metadata@2022-10-01-preview/main.tf b/dependency/azapi_examples/Microsoft.SecurityInsights_metadata@2022-10-01-preview/main.tf index 311d5d07..f02b6214 100644 --- a/dependency/azapi_examples/Microsoft.SecurityInsights_metadata@2022-10-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.SecurityInsights_metadata@2022-10-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,18 +56,18 @@ resource "azapi_resource" "onboardingState" { type = "Microsoft.SecurityInsights/onboardingStates@2023-06-01-preview" parent_id = azapi_resource.workspace.id name = "default" - body = jsonencode({ + body = { properties = { customerManagedKey = false } - }) + } } resource "azapi_resource" "alertRule" { type = "Microsoft.SecurityInsights/alertRules@2022-10-01-preview" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { kind = "NRT" properties = { description = "" @@ -82,7 +82,7 @@ resource "azapi_resource" "alertRule" { techniques = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] depends_on = [azapi_resource.onboardingState] @@ -92,14 +92,14 @@ resource "azapi_resource" "metadata" { type = "Microsoft.SecurityInsights/metadata@2022-10-01-preview" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { properties = { contentId = var.resource_name contentSchemaVersion = "2.0" kind = "AnalyticsRule" parentId = azapi_resource.alertRule.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.SecurityInsights_onboardingStates@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.SecurityInsights_onboardingStates@2022-11-01/main.tf index 328945d8..47bd107e 100644 --- a/dependency/azapi_examples/Microsoft.SecurityInsights_onboardingStates@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.SecurityInsights_onboardingStates@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,11 +56,11 @@ resource "azapi_resource" "onboardingState" { type = "Microsoft.SecurityInsights/onboardingStates@2022-11-01" parent_id = azapi_resource.workspace.id name = "default" - body = jsonencode({ + body = { properties = { customerManagedKey = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.SecurityInsights_watchlists@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.SecurityInsights_watchlists@2022-11-01/main.tf index bd41fb0c..dcf7baa8 100644 --- a/dependency/azapi_examples/Microsoft.SecurityInsights_watchlists@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.SecurityInsights_watchlists@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,25 +56,25 @@ resource "azapi_resource" "onboardingState" { type = "Microsoft.SecurityInsights/onboardingStates@2022-11-01" parent_id = azapi_resource.workspace.id name = "default" - body = jsonencode({ + body = { properties = { customerManagedKey = false } - }) + } } resource "azapi_resource" "watchlist" { type = "Microsoft.SecurityInsights/watchlists@2022-11-01" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { properties = { displayName = "test" itemsSearchKey = "k1" provider = "Microsoft" source = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] depends_on = [azapi_resource.onboardingState] diff --git a/dependency/azapi_examples/Microsoft.SecurityInsights_watchlists_watchlistItems@2022-11-01/main.tf b/dependency/azapi_examples/Microsoft.SecurityInsights_watchlists_watchlistItems@2022-11-01/main.tf index dae96264..8b096495 100644 --- a/dependency/azapi_examples/Microsoft.SecurityInsights_watchlists_watchlistItems@2022-11-01/main.tf +++ b/dependency/azapi_examples/Microsoft.SecurityInsights_watchlists_watchlistItems@2022-11-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -47,7 +47,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -56,25 +56,25 @@ resource "azapi_resource" "onboardingState" { type = "Microsoft.SecurityInsights/onboardingStates@2022-11-01" parent_id = azapi_resource.workspace.id name = "default" - body = jsonencode({ + body = { properties = { customerManagedKey = false } - }) + } } resource "azapi_resource" "watchlist" { type = "Microsoft.SecurityInsights/watchlists@2022-11-01" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { properties = { displayName = "test" itemsSearchKey = "k1" provider = "Microsoft" source = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] depends_on = [azapi_resource.onboardingState] @@ -84,13 +84,13 @@ resource "azapi_resource" "watchlistItem" { type = "Microsoft.SecurityInsights/watchlists/watchlistItems@2022-11-01" parent_id = azapi_resource.watchlist.id name = "196abd06-eb4e-4322-9c70-37c32e1a588a" - body = jsonencode({ + body = { properties = { itemsKeyValue = { k1 = "v1" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Security_advancedThreatProtectionSettings@2019-01-01/main.tf b/dependency/azapi_examples/Microsoft.Security_advancedThreatProtectionSettings@2019-01-01/main.tf index 8927b25d..5d78ccf0 100644 --- a/dependency/azapi_examples/Microsoft.Security_advancedThreatProtectionSettings@2019-01-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Security_advancedThreatProtectionSettings@2019-01-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -69,7 +66,7 @@ resource "azapi_resource" "storageAccount" { tags = { environment = "production" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -78,10 +75,10 @@ resource "azapi_update_resource" "update_advancedThreatProtectionSetting" { type = "Microsoft.Security/advancedThreatProtectionSettings@2019-01-01" parent_id = azapi_resource.storageAccount.id name = "current" - body = jsonencode({ + body = { properties = { isEnabled = true } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Security_assessmentMetadata@2020-01-01/main.tf b/dependency/azapi_examples/Microsoft.Security_assessmentMetadata@2020-01-01/main.tf index 986e26ed..0662c011 100644 --- a/dependency/azapi_examples/Microsoft.Security_assessmentMetadata@2020-01-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Security_assessmentMetadata@2020-01-01/main.tf @@ -35,14 +35,14 @@ resource "azapi_resource" "assessmentMetadatum" { type = "Microsoft.Security/assessmentMetadata@2020-01-01" parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" name = "95c7a001-d595-43af-9754-1310c740d34c" - body = jsonencode({ + body = { properties = { assessmentType = "CustomerManaged" description = "Test Description" displayName = "Test Display Name" severity = "Medium" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Security_defenderForStorageSettings@2022-12-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Security_defenderForStorageSettings@2022-12-01-preview/main.tf new file mode 100644 index 00000000..81d59ac3 --- /dev/null +++ b/dependency/azapi_examples/Microsoft.Security_defenderForStorageSettings@2022-12-01-preview/main.tf @@ -0,0 +1,65 @@ +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" +} + +resource "azapi_resource" "resourceGroup" { + type = "Microsoft.Resources/resourceGroups@2020-06-01" + name = var.resource_name + location = var.location +} + +resource "azapi_resource" "storageAccount" { + type = "Microsoft.Storage/storageAccounts@2021-09-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + body = { + kind = "StorageV2" + properties = { + } + sku = { + name = "Standard_LRS" + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_update_resource" "defenderForStorageSetting" { + type = "Microsoft.Security/defenderForStorageSettings@2022-12-01-preview" + parent_id = azapi_resource.storageAccount.id + name = "current" + body = { + properties = { + isEnabled = true + malwareScanning = { + onUpload = { + capGBPerMonth = 5000 + isEnabled = true + } + } + sensitiveDataDiscovery = { + isEnabled = true + } + overrideSubscriptionLevelSettings = true + } + } +} diff --git a/dependency/azapi_examples/Microsoft.Security_iotSecuritySolutions@2019-08-01/main.tf b/dependency/azapi_examples/Microsoft.Security_iotSecuritySolutions@2019-08-01/main.tf index 2a88e55e..588a26e7 100644 --- a/dependency/azapi_examples/Microsoft.Security_iotSecuritySolutions@2019-08-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Security_iotSecuritySolutions@2019-08-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "IotHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { cloudToDevice = { } @@ -58,7 +55,7 @@ resource "azapi_resource" "IotHub" { capacity = 1 name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -68,7 +65,7 @@ resource "azapi_resource" "iotSecuritySolution" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { displayName = "Iot Security Solution" iotHubs = [ @@ -77,7 +74,7 @@ resource "azapi_resource" "iotSecuritySolution" { status = "Enabled" unmaskedIpLoggingStatus = "Disabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Security_securityContacts@2017-08-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Security_securityContacts@2017-08-01-preview/main.tf index 819ee229..733dd68d 100644 --- a/dependency/azapi_examples/Microsoft.Security_securityContacts@2017-08-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Security_securityContacts@2017-08-01-preview/main.tf @@ -35,14 +35,14 @@ resource "azapi_resource" "securityContact" { type = "Microsoft.Security/securityContacts@2017-08-01-preview" parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" name = var.resource_name - body = jsonencode({ + body = { properties = { alertNotifications = "On" alertsToAdmins = "On" email = "basic@example.com" phone = "+1-555-555-5555" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Security_workspaceSettings@2017-08-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Security_workspaceSettings@2017-08-01-preview/main.tf index df420af9..a2aea641 100644 --- a/dependency/azapi_examples/Microsoft.Security_workspaceSettings@2017-08-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Security_workspaceSettings@2017-08-01-preview/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { features = { disableLocalAuth = false @@ -58,7 +58,7 @@ resource "azapi_resource" "workspace" { dailyQuotaGb = -1 } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,12 +67,12 @@ resource "azapi_resource" "workspaceSetting" { type = "Microsoft.Security/workspaceSettings@2017-08-01-preview" parent_id = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" name = "default" - body = jsonencode({ + body = { properties = { scope = "/subscriptions/${data.azurerm_client_config.current.subscription_id}" workspaceId = azapi_resource.workspace.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces@2022-01-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces@2022-01-01-preview/main.tf index b98181fd..92ddab8c 100644 --- a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces@2022-01-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces@2022-01-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false publicNetworkAccess = "Enabled" @@ -46,7 +42,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_authorizationRules@2021-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_authorizationRules@2021-06-01-preview/main.tf index 67cb7dba..e5deb8fa 100644 --- a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_authorizationRules@2021-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_authorizationRules@2021-06-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false publicNetworkAccess = "Enabled" @@ -46,7 +42,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -55,13 +51,13 @@ resource "azapi_resource" "authorizationRule" { type = "Microsoft.ServiceBus/namespaces/authorizationRules@2021-06-01-preview" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { rights = [ "Listen", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_queues@2021-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_queues@2021-06-01-preview/main.tf index 2141559f..aa4c157e 100644 --- a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_queues@2021-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_queues@2021-06-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false publicNetworkAccess = "Enabled" @@ -46,7 +42,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -55,7 +51,7 @@ resource "azapi_resource" "queue" { type = "Microsoft.ServiceBus/namespaces/queues@2021-06-01-preview" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { deadLetteringOnMessageExpiration = false enableBatchedOperations = true @@ -67,7 +63,7 @@ resource "azapi_resource" "queue" { requiresSession = false status = "Active" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_queues_authorizationRules@2021-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_queues_authorizationRules@2021-06-01-preview/main.tf index c75d4abe..a046dcd6 100644 --- a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_queues_authorizationRules@2021-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_queues_authorizationRules@2021-06-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false publicNetworkAccess = "Enabled" @@ -46,7 +42,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -55,7 +51,7 @@ resource "azapi_resource" "queue" { type = "Microsoft.ServiceBus/namespaces/queues@2021-06-01-preview" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { deadLetteringOnMessageExpiration = false enableBatchedOperations = true @@ -67,7 +63,7 @@ resource "azapi_resource" "queue" { requiresSession = false status = "Active" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,13 +72,13 @@ resource "azapi_resource" "authorizationRule" { type = "Microsoft.ServiceBus/namespaces/queues/authorizationRules@2021-06-01-preview" parent_id = azapi_resource.queue.id name = var.resource_name - body = jsonencode({ + body = { properties = { rights = [ "Send", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics@2021-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics@2021-06-01-preview/main.tf index 9acce34f..b02144a2 100644 --- a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics@2021-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics@2021-06-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false publicNetworkAccess = "Enabled" @@ -46,7 +42,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -55,7 +51,7 @@ resource "azapi_resource" "topic" { type = "Microsoft.ServiceBus/namespaces/topics@2021-06-01-preview" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { enableBatchedOperations = false enableExpress = false @@ -65,7 +61,7 @@ resource "azapi_resource" "topic" { status = "Active" supportOrdering = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_authorizationRules@2021-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_authorizationRules@2021-06-01-preview/main.tf index 86232960..454f2b90 100644 --- a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_authorizationRules@2021-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_authorizationRules@2021-06-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false publicNetworkAccess = "Enabled" @@ -46,7 +42,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -55,7 +51,7 @@ resource "azapi_resource" "topic" { type = "Microsoft.ServiceBus/namespaces/topics@2021-06-01-preview" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { enableBatchedOperations = false enableExpress = false @@ -65,7 +61,7 @@ resource "azapi_resource" "topic" { status = "Active" supportOrdering = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -74,13 +70,13 @@ resource "azapi_resource" "authorizationRule" { type = "Microsoft.ServiceBus/namespaces/topics/authorizationRules@2021-06-01-preview" parent_id = azapi_resource.topic.id name = var.resource_name - body = jsonencode({ + body = { properties = { rights = [ "Send", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_subscriptions@2021-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_subscriptions@2021-06-01-preview/main.tf index ebebbf4d..c20c74b6 100644 --- a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_subscriptions@2021-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_subscriptions@2021-06-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false publicNetworkAccess = "Enabled" @@ -46,7 +42,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -55,7 +51,7 @@ resource "azapi_resource" "topic" { type = "Microsoft.ServiceBus/namespaces/topics@2021-06-01-preview" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { enableBatchedOperations = false enableExpress = false @@ -65,7 +61,7 @@ resource "azapi_resource" "topic" { status = "Active" supportOrdering = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -74,7 +70,7 @@ resource "azapi_resource" "subscription" { type = "Microsoft.ServiceBus/namespaces/topics/subscriptions@2021-06-01-preview" parent_id = azapi_resource.topic.id name = var.resource_name - body = jsonencode({ + body = { properties = { clientAffineProperties = { } @@ -86,7 +82,7 @@ resource "azapi_resource" "subscription" { requiresSession = false status = "Active" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_subscriptions_rules@2021-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_subscriptions_rules@2021-06-01-preview/main.tf index a68fd66e..fcd9f72d 100644 --- a/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_subscriptions_rules@2021-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceBus_namespaces_topics_subscriptions_rules@2021-06-01-preview/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "namespace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableLocalAuth = false publicNetworkAccess = "Enabled" @@ -46,7 +42,7 @@ resource "azapi_resource" "namespace" { name = "Standard" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -55,7 +51,7 @@ resource "azapi_resource" "topic" { type = "Microsoft.ServiceBus/namespaces/topics@2021-06-01-preview" parent_id = azapi_resource.namespace.id name = var.resource_name - body = jsonencode({ + body = { properties = { enableBatchedOperations = false enableExpress = false @@ -65,7 +61,7 @@ resource "azapi_resource" "topic" { status = "Active" supportOrdering = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -74,7 +70,7 @@ resource "azapi_resource" "subscription" { type = "Microsoft.ServiceBus/namespaces/topics/subscriptions@2021-06-01-preview" parent_id = azapi_resource.topic.id name = var.resource_name - body = jsonencode({ + body = { properties = { clientAffineProperties = { } @@ -86,7 +82,7 @@ resource "azapi_resource" "subscription" { requiresSession = false status = "Active" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -95,7 +91,7 @@ resource "azapi_resource" "rule" { type = "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules@2021-06-01-preview" parent_id = azapi_resource.subscription.id name = var.resource_name - body = jsonencode({ + body = { properties = { correlationFilter = { contentType = "test_content_type" @@ -109,7 +105,7 @@ resource "azapi_resource" "rule" { } filterType = "CorrelationFilter" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceFabric_clusters@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.ServiceFabric_clusters@2021-06-01/main.tf index 09d8ad89..0c08779f 100644 --- a/dependency/azapi_examples/Microsoft.ServiceFabric_clusters@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceFabric_clusters@2021-06-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addOnFeatures = [ ] @@ -58,7 +58,7 @@ resource "azapi_resource" "cluster" { upgradeMode = "Automatic" vmImage = "Windows" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceFabric_managedClusters@2021-05-01/main.tf b/dependency/azapi_examples/Microsoft.ServiceFabric_managedClusters@2021-05-01/main.tf index 7ad64ba6..6f6ea807 100644 --- a/dependency/azapi_examples/Microsoft.ServiceFabric_managedClusters@2021-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceFabric_managedClusters@2021-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "managedCluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addonFeatures = [ "DnsService", @@ -79,7 +79,7 @@ resource "azapi_resource" "managedCluster" { tags = { Test = "value" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceFabric_managedClusters_nodeTypes@2021-05-01/main.tf b/dependency/azapi_examples/Microsoft.ServiceFabric_managedClusters_nodeTypes@2021-05-01/main.tf index 723ee8ee..839519a5 100644 --- a/dependency/azapi_examples/Microsoft.ServiceFabric_managedClusters_nodeTypes@2021-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceFabric_managedClusters_nodeTypes@2021-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "managedCluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addonFeatures = [ "DnsService", @@ -79,7 +79,7 @@ resource "azapi_resource" "managedCluster" { tags = { Test = "value" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -88,7 +88,7 @@ resource "azapi_resource" "nodeType" { type = "Microsoft.ServiceFabric/managedClusters/nodeTypes@2021-05-01" parent_id = azapi_resource.managedCluster.id name = var.resource_name - body = jsonencode({ + body = { properties = { applicationPorts = { endPort = 9000 @@ -116,7 +116,7 @@ resource "azapi_resource" "nodeType" { ] vmSize = "Standard_DS2_v2" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.ServiceLinker_linkers@2022-05-01/main.tf b/dependency/azapi_examples/Microsoft.ServiceLinker_linkers@2022-05-01/main.tf index 8a9a5915..9e0ef695 100644 --- a/dependency/azapi_examples/Microsoft.ServiceLinker_linkers@2022-05-01/main.tf +++ b/dependency/azapi_examples/Microsoft.ServiceLinker_linkers@2022-05-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "Spring" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { zoneRedundant = false } sku = { name = "S0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -48,10 +48,7 @@ resource "azapi_resource" "databaseAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "GlobalDocumentDB" properties = { capabilities = [ @@ -86,7 +83,7 @@ resource "azapi_resource" "databaseAccount" { virtualNetworkRules = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -95,7 +92,7 @@ resource "azapi_resource" "sqlDatabase" { type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2021-10-15" parent_id = azapi_resource.databaseAccount.id name = var.resource_name - body = jsonencode({ + body = { properties = { options = { throughput = 400 @@ -104,7 +101,7 @@ resource "azapi_resource" "sqlDatabase" { id = var.resource_name } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -114,17 +111,18 @@ resource "azapi_resource" "app" { parent_id = azapi_resource.Spring.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { customPersistentDisks = [ ] enableEndToEndTLS = false public = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -133,7 +131,7 @@ resource "azapi_resource" "deployment" { type = "Microsoft.AppPlatform/Spring/apps/deployments@2023-05-01-preview" parent_id = azapi_resource.app.id name = "deploy-q4uff" - body = jsonencode({ + body = { properties = { deploymentSettings = { environmentVariables = { @@ -155,7 +153,7 @@ resource "azapi_resource" "deployment" { name = "S0" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -164,7 +162,7 @@ resource "azapi_resource" "linker" { type = "Microsoft.ServiceLinker/linkers@2022-05-01" parent_id = azapi_resource.deployment.id name = var.resource_name - body = jsonencode({ + body = { properties = { authInfo = { authType = "systemAssignedIdentity" @@ -176,7 +174,7 @@ resource "azapi_resource" "linker" { type = "AzureResource" } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.SignalRService_signalR@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.SignalRService_signalR@2023-02-01/main.tf index aa38852f..3a40ce31 100644 --- a/dependency/azapi_examples/Microsoft.SignalRService_signalR@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.SignalRService_signalR@2023-02-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "signalR" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { cors = { } @@ -91,7 +87,7 @@ resource "azapi_resource" "signalR" { capacity = 1 name = "Standard_S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.SignalRService_signalR_sharedPrivateLinkResources@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.SignalRService_signalR_sharedPrivateLinkResources@2023-02-01/main.tf index 0a7d372c..b92a98e4 100644 --- a/dependency/azapi_examples/Microsoft.SignalRService_signalR_sharedPrivateLinkResources@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.SignalRService_signalR_sharedPrivateLinkResources@2023-02-01/main.tf @@ -42,11 +42,7 @@ resource "azapi_resource" "signalR" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { cors = { } @@ -102,7 +98,7 @@ resource "azapi_resource" "signalR" { capacity = 1 name = "Standard_S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -112,7 +108,7 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { accessPolicies = [ { @@ -147,7 +143,7 @@ resource "azapi_resource" "vault" { softDeleteRetentionInDays = 7 tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -156,13 +152,13 @@ resource "azapi_resource" "sharedPrivateLinkResource" { type = "Microsoft.SignalRService/signalR/sharedPrivateLinkResources@2023-02-01" parent_id = azapi_resource.signalR.id name = var.resource_name - body = jsonencode({ + body = { properties = { groupId = "vault" privateLinkResourceId = azapi_resource.vault.id requestMessage = "please approve" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.SignalRService_webPubSub@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.SignalRService_webPubSub@2023-02-01/main.tf index 89a1ff45..727d5b1b 100644 --- a/dependency/azapi_examples/Microsoft.SignalRService_webPubSub@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.SignalRService_webPubSub@2023-02-01/main.tf @@ -31,11 +31,7 @@ resource "azapi_resource" "webPubSub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableAadAuth = false disableLocalAuth = false @@ -48,7 +44,7 @@ resource "azapi_resource" "webPubSub" { capacity = 1 name = "Standard_S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.SignalRService_webPubSub_hubs@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.SignalRService_webPubSub_hubs@2023-02-01/main.tf index d0327993..4c74adce 100644 --- a/dependency/azapi_examples/Microsoft.SignalRService_webPubSub_hubs@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.SignalRService_webPubSub_hubs@2023-02-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "webPubSub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - userAssignedIdentities = null - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { disableAadAuth = false disableLocalAuth = false @@ -48,7 +48,7 @@ resource "azapi_resource" "webPubSub" { capacity = 1 name = "Standard_S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,13 +57,13 @@ resource "azapi_resource" "hub" { type = "Microsoft.SignalRService/webPubSub/hubs@2023-02-01" parent_id = azapi_resource.webPubSub.id name = var.resource_name - body = jsonencode({ + body = { properties = { anonymousConnectPolicy = "Deny" eventListeners = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.SignalRService_webPubSub_sharedPrivateLinkResources@2023-02-01/main.tf b/dependency/azapi_examples/Microsoft.SignalRService_webPubSub_sharedPrivateLinkResources@2023-02-01/main.tf index bd55192d..4d66bcb8 100644 --- a/dependency/azapi_examples/Microsoft.SignalRService_webPubSub_sharedPrivateLinkResources@2023-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.SignalRService_webPubSub_sharedPrivateLinkResources@2023-02-01/main.tf @@ -42,11 +42,7 @@ resource "azapi_resource" "webPubSub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { disableAadAuth = false disableLocalAuth = false @@ -59,7 +55,7 @@ resource "azapi_resource" "webPubSub" { capacity = 1 name = "Standard_S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -69,7 +65,7 @@ resource "azapi_resource" "vault" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { accessPolicies = [ { @@ -104,7 +100,7 @@ resource "azapi_resource" "vault" { softDeleteRetentionInDays = 7 tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -113,12 +109,12 @@ resource "azapi_resource" "sharedPrivateLinkResource" { type = "Microsoft.SignalRService/webPubSub/sharedPrivateLinkResources@2023-02-01" parent_id = azapi_resource.webPubSub.id name = var.resource_name - body = jsonencode({ + body = { properties = { groupId = "vault" privateLinkResourceId = azapi_resource.vault.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Solutions_applicationDefinitions@2021-07-01/main.tf b/dependency/azapi_examples/Microsoft.Solutions_applicationDefinitions@2021-07-01/main.tf index 5f2bb8bc..50d25354 100644 --- a/dependency/azapi_examples/Microsoft.Solutions_applicationDefinitions@2021-07-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Solutions_applicationDefinitions@2021-07-01/main.tf @@ -50,12 +50,12 @@ resource "azapi_resource" "applicationDefinition" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { authorizations = [ { principalId = data.azurerm_client_config.current.object_id - roleDefinitionId = jsondecode(data.azapi_resource_action.roleDefinitions.output).value[0].name + roleDefinitionId = data.azapi_resource_action.roleDefinitions.output.value[0].name }, ] description = "Test Managed App Definition" @@ -64,7 +64,7 @@ resource "azapi_resource" "applicationDefinition" { lockLevel = "ReadOnly" packageFileUri = "https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_instancePools@2022-05-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_instancePools@2022-05-01-preview/main.tf new file mode 100644 index 00000000..d77eb7cf --- /dev/null +++ b/dependency/azapi_examples/Microsoft.Sql_instancePools@2022-05-01-preview/main.tf @@ -0,0 +1,246 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + azurerm = { + source = "hashicorp/azurerm" + } + } +} + +provider "azurerm" { + features { + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "resource_name" { + type = string + default = "acctest0001" +} + +variable "location" { + type = string + default = "westeurope" +} + +resource "azapi_resource" "resourceGroup" { + type = "Microsoft.Resources/resourceGroups@2022-09-01" + name = var.resource_name + location = var.location +} + +resource "azapi_resource" "networkSecurityGroup" { + type = "Microsoft.Network/networkSecurityGroups@2023-04-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = azapi_resource.resourceGroup.location + body = { + properties = { + securityRules = [ + { + name = "allow_tds_inbound" + properties = { + description = "Allow access to data" + protocol = "TCP" + sourcePortRange = "*" + destinationPortRange = "1433" + sourceAddressPrefix = "VirtualNetwork" + destinationAddressPrefix = "*" + access = "Allow" + priority = 1000 + direction = "Inbound" + } + }, + { + name = "allow_redirect_inbound" + properties = { + description = "Allow inbound redirect traffic to Managed Instance inside the virtual network" + protocol = "Tcp" + sourcePortRange = "*" + destinationPortRange = "11000-11999" + sourceAddressPrefix = "VirtualNetwork" + destinationAddressPrefix = "*" + access = "Allow" + priority = 1100 + direction = "Inbound" + } + }, + { + name = "allow_geodr_inbound" + properties = { + description = "Allow inbound geodr traffic inside the virtual network" + protocol = "Tcp" + sourcePortRange = "*" + destinationPortRange = "5022" + sourceAddressPrefix = "VirtualNetwork" + destinationAddressPrefix = "*" + access = "Allow" + priority = 1200 + direction = "Inbound" + } + }, + { + name = "deny_all_inbound" + properties = { + description = "Deny all other inbound traffic" + protocol = "*" + sourcePortRange = "*" + destinationPortRange = "*" + sourceAddressPrefix = "*" + destinationAddressPrefix = "*" + access = "Deny" + priority = 4096 + direction = "Inbound" + } + }, + { + name = "allow_linkedserver_outbound" + properties = { + description = "Allow outbound linkedserver traffic inside the virtual network" + protocol = "Tcp" + sourcePortRange = "*" + destinationPortRange = "1433" + sourceAddressPrefix = "*" + destinationAddressPrefix = "VirtualNetwork" + access = "Allow" + priority = 1000 + direction = "Outbound" + } + }, + { + name = "allow_redirect_outbound" + properties = { + description = "Allow outbound redirect traffic to Managed Instance inside the virtual network" + protocol = "Tcp" + sourcePortRange = "*" + destinationPortRange = "11000-11999" + sourceAddressPrefix = "*" + destinationAddressPrefix = "VirtualNetwork" + access = "Allow" + priority = 1100 + direction = "Outbound" + } + }, + { + name = "allow_geodr_outbound" + properties = { + description = "Allow outbound geodr traffic inside the virtual network" + protocol = "Tcp" + sourcePortRange = "*" + destinationPortRange = "5022" + sourceAddressPrefix = "*" + destinationAddressPrefix = "VirtualNetwork" + access = "Allow" + priority = 1200 + direction = "Outbound" + } + }, + { + name = "deny_all_outbound" + properties = { + description = "Deny all other outbound traffic" + protocol = "*" + sourcePortRange = "*" + destinationPortRange = "*" + sourceAddressPrefix = "*" + destinationAddressPrefix = "*" + access = "Deny" + priority = 4096 + direction = "Outbound" + } + } + ] + } + } +} + +resource "azapi_resource" "routeTable" { + type = "Microsoft.Network/routeTables@2023-04-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = azapi_resource.resourceGroup.location + body = { + properties = { + disableBgpRoutePropagation = false + } + } +} + +resource "azapi_resource" "virtualNetwork" { + type = "Microsoft.Network/virtualNetworks@2023-04-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = azapi_resource.resourceGroup.location + body = { + properties = { + addressSpace = { + addressPrefixes = ["10.0.0.0/16"] + } + subnets = [ + { + name = "Default" + properties = { + addressPrefix = "10.0.0.0/24" + } + }, + { + name = var.resource_name + properties = { + addressPrefix = "10.0.1.0/24" + networkSecurityGroup = { + id = azapi_resource.networkSecurityGroup.id + } + routeTable = { + id = azapi_resource.routeTable.id + } + delegations = [ + { + name = "miDelegation" + properties = { + serviceName = "Microsoft.Sql/managedInstances" + } + } + ] + } + } + ] + } + } +} + +data "azapi_resource" "subnet" { + type = "Microsoft.Network/virtualNetworks/subnets@2023-04-01" + parent_id = azapi_resource.virtualNetwork.id + name = var.resource_name +} + + +resource "azapi_resource" "instancePool" { + type = "Microsoft.Sql/instancePools@2022-05-01-preview" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = azapi_resource.resourceGroup.location + body = { + properties = { + licenseType = "LicenseIncluded" + subnetId = data.azapi_resource.subnet.id + vCores = 8 + } + sku = { + family = "Gen5" + name = "GP_Gen5" + tier = "GeneralPurpose" + } + } + + timeouts { + create = "300m" + update = "300m" + delete = "300m" + } +} diff --git a/dependency/azapi_examples/Microsoft.Sql_servers@2021-02-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers@2021-02-01-preview/main.tf index 073f6aec..d5f38929 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers@2021-02-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers@2021-02-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "mradministrator" administratorLoginPassword = "thisIsDog11" @@ -40,7 +40,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_administrators@2020-11-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_administrators@2020-11-01-preview/main.tf index 1ad400fd..2f037e90 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_administrators@2020-11-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_administrators@2020-11-01-preview/main.tf @@ -42,13 +42,13 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "mradministrator" administratorLoginPassword = "thisIsDog11" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -57,14 +57,14 @@ resource "azapi_resource" "administrator" { type = "Microsoft.Sql/servers/administrators@2020-11-01-preview" parent_id = azapi_resource.server.id name = "ActiveDirectory" - body = jsonencode({ + body = { properties = { administratorType = "ActiveDirectory" login = "sqladmin" sid = data.azurerm_client_config.current.client_id tenantId = data.azurerm_client_config.current.tenant_id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_connectionPolicies@2014-04-01/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_connectionPolicies@2014-04-01/main.tf index 4610c3db..9f00a998 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_connectionPolicies@2014-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_connectionPolicies@2014-04-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "mradministrator" administratorLoginPassword = "thisIsDog11" @@ -40,7 +40,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,11 +49,11 @@ resource "azapi_update_resource" "connectionPolicy" { type = "Microsoft.Sql/servers/connectionPolicies@2014-04-01" parent_id = azapi_resource.server.id name = "default" - body = jsonencode({ + body = { properties = { connectionType = "Default" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_databases@2014-04-01/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_databases@2014-04-01/main.tf index b1f8529b..9bd2cdff 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_databases@2014-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_databases@2014-04-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestadmin" administratorLoginPassword = "t2RX8A76GrnE4EKC" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { collation = "SQL_LATIN1_GENERAL_CP1_CI_AS" createMode = "Default" @@ -56,7 +56,7 @@ resource "azapi_resource" "database" { requestedServiceObjectiveName = "S0" zoneRedundant = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_databases@2021-02-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_databases@2021-02-01-preview/main.tf index 9b36ea0e..40f1ee18 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_databases@2021-02-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_databases@2021-02-01-preview/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "mradministrator" administratorLoginPassword = "thisIsDog11" @@ -51,7 +51,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,7 +67,7 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoPauseDelay = 0 createMode = "Default" @@ -81,7 +81,7 @@ resource "azapi_resource" "database" { requestedBackupStorageRedundancy = "Geo" zoneRedundant = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_databases_securityAlertPolicies@2014-04-01/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_databases_securityAlertPolicies@2014-04-01/main.tf index 2099b7ab..fa6d2768 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_databases_securityAlertPolicies@2014-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_databases_securityAlertPolicies@2014-04-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestadmin" administratorLoginPassword = "t2RX8A76GrnE4EKC" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,7 +47,7 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { collation = "SQL_LATIN1_GENERAL_CP1_CI_AS" createMode = "Default" @@ -56,7 +56,7 @@ resource "azapi_resource" "database" { requestedServiceObjectiveName = "S0" zoneRedundant = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -65,11 +65,11 @@ resource "azapi_update_resource" "securityAlertPolicy" { type = "Microsoft.Sql/servers/databases/securityAlertPolicies@2014-04-01" parent_id = azapi_resource.database.id name = "default" - body = jsonencode({ + body = { properties = { state = "Disabled" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_databases_securityAlertPolicies@2020-11-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_databases_securityAlertPolicies@2020-11-01-preview/main.tf index 8844a3ab..0c10d356 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_databases_securityAlertPolicies@2020-11-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_databases_securityAlertPolicies@2020-11-01-preview/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "mradministrator" administratorLoginPassword = "thisIsDog11" @@ -51,7 +51,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,7 +67,7 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoPauseDelay = 0 createMode = "Default" @@ -81,7 +81,7 @@ resource "azapi_resource" "database" { requestedBackupStorageRedundancy = "Geo" zoneRedundant = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -90,11 +90,11 @@ resource "azapi_update_resource" "securityAlertPolicy" { type = "Microsoft.Sql/servers/databases/securityAlertPolicies@2020-11-01-preview" parent_id = azapi_resource.database.id name = "default" - body = jsonencode({ + body = { properties = { state = "Disabled" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_databases_transparentDataEncryption@2014-04-01/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_databases_transparentDataEncryption@2014-04-01/main.tf index 01a6056b..1f89f5e4 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_databases_transparentDataEncryption@2014-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_databases_transparentDataEncryption@2014-04-01/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "mradministrator" administratorLoginPassword = "thisIsDog11" @@ -51,7 +51,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,7 +67,7 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoPauseDelay = 0 createMode = "Default" @@ -81,7 +81,7 @@ resource "azapi_resource" "database" { requestedBackupStorageRedundancy = "Geo" zoneRedundant = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -90,11 +90,11 @@ resource "azapi_update_resource" "transparentDataEncryption" { type = "Microsoft.Sql/servers/databases/transparentDataEncryption@2014-04-01" parent_id = azapi_resource.database.id name = "current" - body = jsonencode({ + body = { properties = { status = "Enabled" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_dnsAliases@2020-11-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_dnsAliases@2020-11-01-preview/main.tf index 52d8a5cc..0e318148 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_dnsAliases@2020-11-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_dnsAliases@2020-11-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "umtacc" administratorLoginPassword = "random81jdpwd_$#fs" @@ -40,7 +40,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_elasticPools@2014-04-01/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_elasticPools@2014-04-01/main.tf index 6a11a226..5c0b281a 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_elasticPools@2014-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_elasticPools@2014-04-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "4dm1n157r470r" administratorLoginPassword = "4-v3ry-53cr37-p455w0rd" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -47,13 +47,13 @@ resource "azapi_resource" "elasticPool" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { dtu = 50 edition = "Basic" storageMB = 5000 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_elasticPools@2020-11-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_elasticPools@2020-11-01-preview/main.tf index 9eaaf0aa..feabb314 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_elasticPools@2020-11-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_elasticPools@2020-11-01-preview/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "4dm1n157r470r" administratorLoginPassword = "4-v3ry-53cr37-p455w0rd" @@ -51,7 +51,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,7 +67,7 @@ resource "azapi_resource" "elasticPool" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { maintenanceConfigurationId = data.azapi_resource_id.publicMaintenanceConfiguration.id maxSizeBytes = 5.24288e+09 @@ -83,7 +83,7 @@ resource "azapi_resource" "elasticPool" { name = "BasicPool" tier = "Basic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_firewallRules@2014-04-01/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_firewallRules@2014-04-01/main.tf index 46845406..76be86ab 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_firewallRules@2014-04-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_firewallRules@2014-04-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "mradministrator" administratorLoginPassword = "thisIsDog11" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,12 +46,12 @@ resource "azapi_resource" "firewallRule" { type = "Microsoft.Sql/servers/firewallRules@2014-04-01" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { endIpAddress = "255.255.255.255" startIpAddress = "0.0.0.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_firewallRules@2020-11-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_firewallRules@2020-11-01-preview/main.tf index 23a6d661..0406a4fc 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_firewallRules@2020-11-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_firewallRules@2020-11-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "msincredible" administratorLoginPassword = "P@55W0rD!!j1ya4" @@ -40,7 +40,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,12 +49,12 @@ resource "azapi_resource" "firewallRule" { type = "Microsoft.Sql/servers/firewallRules@2020-11-01-preview" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { endIpAddress = "255.255.255.255" startIpAddress = "0.0.0.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_jobAgents@2020-11-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_jobAgents@2020-11-01-preview/main.tf index 0c821807..bd64c86a 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_jobAgents@2020-11-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_jobAgents@2020-11-01-preview/main.tf @@ -42,7 +42,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "4dministr4t0r" administratorLoginPassword = "superSecur3!!!" @@ -51,7 +51,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -67,7 +67,7 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoPauseDelay = 0 collation = "SQL_Latin1_General_CP1_CI_AS" @@ -81,7 +81,7 @@ resource "azapi_resource" "database" { requestedBackupStorageRedundancy = "Geo" zoneRedundant = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -91,11 +91,11 @@ resource "azapi_resource" "jobAgent" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { databaseId = azapi_resource.database.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_jobAgents_credentials@2020-11-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_jobAgents_credentials@2020-11-01-preview/main.tf index 11aa4afe..c7f79130 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_jobAgents_credentials@2020-11-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_jobAgents_credentials@2020-11-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "4dministr4t0r" administratorLoginPassword = "superSecur3!!!" @@ -40,7 +40,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,7 +50,7 @@ resource "azapi_resource" "database" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoPauseDelay = 0 collation = "SQL_Latin1_General_CP1_CI_AS" @@ -63,7 +63,7 @@ resource "azapi_resource" "database" { requestedBackupStorageRedundancy = "Geo" zoneRedundant = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -73,11 +73,11 @@ resource "azapi_resource" "jobAgent" { parent_id = azapi_resource.server.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { databaseId = azapi_resource.database.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -86,12 +86,12 @@ resource "azapi_resource" "credential" { type = "Microsoft.Sql/servers/jobAgents/credentials@2020-11-01-preview" parent_id = azapi_resource.jobAgent.id name = var.resource_name - body = jsonencode({ + body = { properties = { password = "test" username = "test" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_outboundFirewallRules@2021-02-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_outboundFirewallRules@2021-02-01-preview/main.tf index 1710ff62..2a39171e 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_outboundFirewallRules@2021-02-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_outboundFirewallRules@2021-02-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "msincredible" administratorLoginPassword = "P@55W0rD!!y0exn" @@ -40,7 +40,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Enabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -49,10 +49,10 @@ resource "azapi_resource" "outboundFirewallRule" { type = "Microsoft.Sql/servers/outboundFirewallRules@2021-02-01-preview" parent_id = azapi_resource.server.id name = "sql230630033612934212.database.windows.net" - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_securityAlertPolicies@2017-03-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_securityAlertPolicies@2017-03-01-preview/main.tf index e3df1660..a3609351 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_securityAlertPolicies@2017-03-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_securityAlertPolicies@2017-03-01-preview/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "acctestadmin" administratorLoginPassword = "t2RX8A76GrnE4EKC" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -46,11 +46,11 @@ resource "azapi_update_resource" "securityAlertPolicy" { type = "Microsoft.Sql/servers/securityAlertPolicies@2017-03-01-preview" parent_id = azapi_resource.server.id name = "Default" - body = jsonencode({ + body = { properties = { state = "Disabled" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Sql_servers_virtualNetworkRules@2020-11-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Sql_servers_virtualNetworkRules@2020-11-01-preview/main.tf index f99d9f20..31a7ce57 100644 --- a/dependency/azapi_examples/Microsoft.Sql_servers_virtualNetworkRules@2020-11-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Sql_servers_virtualNetworkRules@2020-11-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "server" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { administratorLogin = "missadmin" administratorLoginPassword = "P@55W0rD!!oyefp" @@ -40,7 +40,7 @@ resource "azapi_resource" "server" { restrictOutboundNetworkAccess = "Disabled" version = "12.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,7 +50,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -64,17 +64,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.7.28.0/25" delegations = [ @@ -89,7 +91,7 @@ resource "azapi_resource" "subnet" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -98,12 +100,12 @@ resource "azapi_resource" "virtualNetworkRule" { type = "Microsoft.Sql/servers/virtualNetworkRules@2020-11-01-preview" parent_id = azapi_resource.server.id name = var.resource_name - body = jsonencode({ + body = { properties = { ignoreMissingVnetServiceEndpoint = false virtualNetworkSubnetId = azapi_resource.subnet.id } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.StorageCache_caches@2023-01-01/main.tf b/dependency/azapi_examples/Microsoft.StorageCache_caches@2023-01-01/main.tf index 17968194..1b5d290b 100644 --- a/dependency/azapi_examples/Microsoft.StorageCache_caches@2023-01-01/main.tf +++ b/dependency/azapi_examples/Microsoft.StorageCache_caches@2023-01-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "virtualNetwork" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,17 +45,19 @@ resource "azapi_resource" "virtualNetwork" { subnets = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] - ignore_body_changes = ["properties.subnets"] + lifecycle { + ignore_changes = [body.properties.subnets] + } } resource "azapi_resource" "subnet" { type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" parent_id = azapi_resource.virtualNetwork.id name = var.resource_name - body = jsonencode({ + body = { properties = { addressPrefix = "10.0.2.0/24" delegations = [ @@ -67,7 +69,7 @@ resource "azapi_resource" "subnet" { serviceEndpoints = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -77,11 +79,7 @@ resource "azapi_resource" "cach" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - userAssignedIdentities = null - } + body = { properties = { cacheSizeGB = 3072 networkSettings = { @@ -93,7 +91,7 @@ resource "azapi_resource" "cach" { sku = { name = "Standard_2G" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.StorageMover_storageMovers@2023-03-01/main.tf b/dependency/azapi_examples/Microsoft.StorageMover_storageMovers@2023-03-01/main.tf index 1e6fa9bf..2e9be9c1 100644 --- a/dependency/azapi_examples/Microsoft.StorageMover_storageMovers@2023-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.StorageMover_storageMovers@2023-03-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "storageMover" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.StorageMover_storageMovers_endpoints@2023-03-01/main.tf b/dependency/azapi_examples/Microsoft.StorageMover_storageMovers_endpoints@2023-03-01/main.tf index 1d40c58e..7efdaf2b 100644 --- a/dependency/azapi_examples/Microsoft.StorageMover_storageMovers_endpoints@2023-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.StorageMover_storageMovers_endpoints@2023-03-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "storageMover" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -44,14 +44,14 @@ resource "azapi_resource" "endpoint" { type = "Microsoft.StorageMover/storageMovers/endpoints@2023-03-01" parent_id = azapi_resource.storageMover.id name = var.resource_name - body = jsonencode({ + body = { properties = { endpointType = "NfsMount" export = "" host = "192.168.0.1" nfsVersion = "NFSauto" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.StorageMover_storageMovers_projects@2023-03-01/main.tf b/dependency/azapi_examples/Microsoft.StorageMover_storageMovers_projects@2023-03-01/main.tf index 5e9724e1..8b4b1ff9 100644 --- a/dependency/azapi_examples/Microsoft.StorageMover_storageMovers_projects@2023-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.StorageMover_storageMovers_projects@2023-03-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "storageMover" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -44,10 +44,10 @@ resource "azapi_resource" "project" { type = "Microsoft.StorageMover/storageMovers/projects@2023-03-01" parent_id = azapi_resource.storageMover.id name = var.resource_name - body = jsonencode({ + body = { properties = { } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.StorageSync_storageSyncServices@2020-03-01/main.tf b/dependency/azapi_examples/Microsoft.StorageSync_storageSyncServices@2020-03-01/main.tf index 0833e09e..dddb05b4 100644 --- a/dependency/azapi_examples/Microsoft.StorageSync_storageSyncServices@2020-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.StorageSync_storageSyncServices@2020-03-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "storageSyncService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { incomingTrafficPolicy = "AllowAllTraffic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.StorageSync_storageSyncServices_syncGroups@2020-03-01/main.tf b/dependency/azapi_examples/Microsoft.StorageSync_storageSyncServices_syncGroups@2020-03-01/main.tf index 7b8e06f5..63465c3a 100644 --- a/dependency/azapi_examples/Microsoft.StorageSync_storageSyncServices_syncGroups@2020-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.StorageSync_storageSyncServices_syncGroups@2020-03-01/main.tf @@ -31,11 +31,11 @@ resource "azapi_resource" "storageSyncService" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { incomingTrafficPolicy = "AllowAllTraffic" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Storage_storageAccounts@2021-09-01/main.tf b/dependency/azapi_examples/Microsoft.Storage_storageAccounts@2021-09-01/main.tf index 129f6e25..b2f86c0b 100644 --- a/dependency/azapi_examples/Microsoft.Storage_storageAccounts@2021-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Storage_storageAccounts@2021-09-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_blobServices@2021-09-01/main.tf b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_blobServices@2021-09-01/main.tf index b8eee68e..8506ae1b 100644 --- a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_blobServices@2021-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_blobServices@2021-09-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -75,7 +72,7 @@ resource "azapi_update_resource" "blobService" { type = "Microsoft.Storage/storageAccounts/blobServices@2021-09-01" parent_id = azapi_resource.storageAccount.id name = "default" - body = jsonencode({ + body = { properties = { changeFeed = { enabled = true @@ -96,7 +93,7 @@ resource "azapi_update_resource" "blobService" { enabled = false } } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_blobServices_containers@2021-09-01/main.tf b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_blobServices_containers@2021-09-01/main.tf index 5d058990..85f9b976 100644 --- a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_blobServices_containers@2021-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_blobServices_containers@2021-09-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -59,13 +59,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_fileServices_shares@2021-09-01/main.tf b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_fileServices_shares@2021-09-01/main.tf index 29a7fff2..f68a0773 100644 --- a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_fileServices_shares@2021-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_fileServices_shares@2021-09-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -59,11 +59,11 @@ resource "azapi_resource" "share" { type = "Microsoft.Storage/storageAccounts/fileServices/shares@2022-09-01" parent_id = data.azapi_resource.fileService.id name = var.resource_name - body = jsonencode({ + body = { properties = { accessTier = "Cool" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_managementPolicies@2021-09-01/main.tf b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_managementPolicies@2021-09-01/main.tf index 17cc05d2..96cd1c79 100644 --- a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_managementPolicies@2021-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_managementPolicies@2021-09-01/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "BlobStorage" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -75,7 +72,7 @@ resource "azapi_resource" "managementPolicy" { type = "Microsoft.Storage/storageAccounts/managementPolicies@2021-09-01" parent_id = azapi_resource.storageAccount.id name = "default" - body = jsonencode({ + body = { properties = { policy = { rules = [ @@ -115,7 +112,7 @@ resource "azapi_resource" "managementPolicy" { ] } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_queueServices_queues@2021-09-01/main.tf b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_queueServices_queues@2021-09-01/main.tf index 9a8433a3..33cfd113 100644 --- a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_queueServices_queues@2021-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_queueServices_queues@2021-09-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -59,13 +59,13 @@ resource "azapi_resource" "queue" { type = "Microsoft.Storage/storageAccounts/queueServices/queues@2022-09-01" parent_id = data.azapi_resource.queueService.id name = var.resource_name - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_tableServices_tables@2021-09-01/main.tf b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_tableServices_tables@2021-09-01/main.tf index a0c3feb7..b84f00d9 100644 --- a/dependency/azapi_examples/Microsoft.Storage_storageAccounts_tableServices_tables@2021-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Storage_storageAccounts_tableServices_tables@2021-09-01/main.tf @@ -31,13 +31,13 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -59,11 +59,11 @@ resource "azapi_resource" "table" { type = "Microsoft.Storage/storageAccounts/tableServices/tables@2022-09-01" parent_id = data.azapi_resource.tableService.id name = var.resource_name - body = jsonencode({ + body = { properties = { signedIdentifiers = [] } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.StreamAnalytics_clusters@2020-03-01/main.tf b/dependency/azapi_examples/Microsoft.StreamAnalytics_clusters@2020-03-01/main.tf index b86083d7..1d92411b 100644 --- a/dependency/azapi_examples/Microsoft.StreamAnalytics_clusters@2020-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.StreamAnalytics_clusters@2020-03-01/main.tf @@ -31,12 +31,12 @@ resource "azapi_resource" "cluster" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { sku = { capacity = 36 name = "Default" } - }) + } schema_validation_enabled = false response_export_values = ["*"] timeouts { diff --git a/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs@2020-03-01/main.tf b/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs@2020-03-01/main.tf index a5471faf..7e4ebc48 100644 --- a/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs@2020-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs@2020-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "streamingJob" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { cluster = { } @@ -54,7 +54,7 @@ resource "azapi_resource" "streamingJob" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_functions@2020-03-01/main.tf b/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_functions@2020-03-01/main.tf index bd5d4bb7..ecf89a52 100644 --- a/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_functions@2020-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_functions@2020-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "streamingJob" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { cluster = { } @@ -54,7 +54,7 @@ resource "azapi_resource" "streamingJob" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -63,7 +63,7 @@ resource "azapi_resource" "function" { type = "Microsoft.StreamAnalytics/streamingJobs/functions@2020-03-01" parent_id = azapi_resource.streamingJob.id name = var.resource_name - body = jsonencode({ + body = { properties = { properties = { binding = { @@ -84,7 +84,7 @@ resource "azapi_resource" "function" { } type = "Scalar" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_inputs@2020-03-01/main.tf b/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_inputs@2020-03-01/main.tf index a2983b44..ad1738e7 100644 --- a/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_inputs@2020-03-01/main.tf +++ b/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_inputs@2020-03-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "streamingJob" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { cluster = { } @@ -54,7 +54,7 @@ resource "azapi_resource" "streamingJob" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,10 +64,7 @@ resource "azapi_resource" "IotHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { cloudToDevice = { } @@ -91,7 +88,7 @@ resource "azapi_resource" "IotHub" { capacity = 1 name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -107,14 +104,14 @@ resource "azapi_resource" "input" { type = "Microsoft.StreamAnalytics/streamingJobs/inputs@2020-03-01" parent_id = azapi_resource.streamingJob.id name = var.resource_name - body = jsonencode({ + body = { properties = { datasource = { properties = { consumerGroupName = "$Default" endpoint = "messages/events" iotHubNamespace = azapi_resource.IotHub.name - sharedAccessPolicyKey = jsondecode(data.azapi_resource_action.listkeys.output).value[0].primaryKey + sharedAccessPolicyKey = data.azapi_resource_action.listkeys.output.value[0].primaryKey sharedAccessPolicyName = "iothubowner" } type = "Microsoft.Devices/IotHubs" @@ -125,7 +122,7 @@ resource "azapi_resource" "input" { } type = "Stream" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_outputs@2021-10-01-preview/main.tf b/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_outputs@2021-10-01-preview/main.tf index 3bdc386f..9638b520 100644 --- a/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_outputs@2021-10-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.StreamAnalytics_streamingJobs_outputs@2021-10-01-preview/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "streamingJob" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { cluster = { } @@ -54,7 +54,7 @@ resource "azapi_resource" "streamingJob" { } } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -64,10 +64,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -99,7 +96,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -115,11 +112,11 @@ resource "azapi_resource" "output" { type = "Microsoft.StreamAnalytics/streamingJobs/outputs@2021-10-01-preview" parent_id = azapi_resource.streamingJob.id name = var.resource_name - body = jsonencode({ + body = { properties = { datasource = { properties = { - accountKey = jsondecode(data.azapi_resource_action.listKeys.output).keys[0].value + accountKey = data.azapi_resource_action.listKeys.output.keys[0].value accountName = azapi_resource.storageAccount.name batchSize = 100 partitionKey = "foo" @@ -130,7 +127,7 @@ resource "azapi_resource" "output" { } serialization = null } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Synapse_workspaces@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Synapse_workspaces@2021-06-01/main.tf index a8064f4c..06ef9492 100644 --- a/dependency/azapi_examples/Microsoft.Synapse_workspaces@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Synapse_workspaces@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -60,13 +60,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -75,13 +75,14 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { defaultDataLakeStorage = { - accountUrl = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.dfs + accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs filesystem = azapi_resource.container.name } managedVirtualNetwork = "" @@ -89,7 +90,7 @@ resource "azapi_resource" "workspace" { sqlAdministratorLogin = "sqladminuser" sqlAdministratorLoginPassword = "H@Sh1CoR3!" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Synapse_workspaces_bigDataPools@2021-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Synapse_workspaces_bigDataPools@2021-06-01-preview/main.tf index 6c2cb107..d6494be9 100644 --- a/dependency/azapi_examples/Microsoft.Synapse_workspaces_bigDataPools@2021-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Synapse_workspaces_bigDataPools@2021-06-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -53,13 +53,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -68,13 +68,14 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { defaultDataLakeStorage = { - accountUrl = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.dfs + accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs filesystem = azapi_resource.container.name } @@ -83,7 +84,7 @@ resource "azapi_resource" "workspace" { sqlAdministratorLogin = "sqladminuser" sqlAdministratorLoginPassword = "H@Sh1CoR3!" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -93,7 +94,7 @@ resource "azapi_resource" "bigDataPool" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { autoPause = { enabled = false @@ -116,7 +117,7 @@ resource "azapi_resource" "bigDataPool" { sparkEventsFolder = "/events" sparkVersion = "2.4" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Synapse_workspaces_firewallRules@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Synapse_workspaces_firewallRules@2021-06-01/main.tf index 8a91a0bb..64a8fb01 100644 --- a/dependency/azapi_examples/Microsoft.Synapse_workspaces_firewallRules@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Synapse_workspaces_firewallRules@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -60,13 +60,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -75,13 +75,14 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { defaultDataLakeStorage = { - accountUrl = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.dfs + accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs filesystem = azapi_resource.container.name } @@ -90,7 +91,7 @@ resource "azapi_resource" "workspace" { sqlAdministratorLogin = "sqladminuser" sqlAdministratorLoginPassword = "H@Sh1CoR3!" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,12 +100,12 @@ resource "azapi_resource" "firewallRule" { type = "Microsoft.Synapse/workspaces/firewallRules@2021-06-01" parent_id = azapi_resource.workspace.id name = "AllowAll" - body = jsonencode({ + body = { properties = { endIpAddress = "255.255.255.255" startIpAddress = "0.0.0.0" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Synapse_workspaces_integrationRuntimes@2021-06-01-preview/main.tf b/dependency/azapi_examples/Microsoft.Synapse_workspaces_integrationRuntimes@2021-06-01-preview/main.tf index 035abfaf..77a57a0d 100644 --- a/dependency/azapi_examples/Microsoft.Synapse_workspaces_integrationRuntimes@2021-06-01-preview/main.tf +++ b/dependency/azapi_examples/Microsoft.Synapse_workspaces_integrationRuntimes@2021-06-01-preview/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -60,13 +60,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -75,13 +75,14 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { defaultDataLakeStorage = { - accountUrl = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.dfs + accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs filesystem = azapi_resource.container.name } @@ -90,7 +91,7 @@ resource "azapi_resource" "workspace" { sqlAdministratorLogin = "sqladminuser" sqlAdministratorLoginPassword = "H@Sh1CoR3!" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,12 +100,12 @@ resource "azapi_resource" "integrationRuntime" { type = "Microsoft.Synapse/workspaces/integrationRuntimes@2021-06-01-preview" parent_id = azapi_resource.workspace.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "test" type = "SelfHosted" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Synapse_workspaces_managedIdentitySqlControlSettings@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Synapse_workspaces_managedIdentitySqlControlSettings@2021-06-01/main.tf index b21f7c5d..3c0df314 100644 --- a/dependency/azapi_examples/Microsoft.Synapse_workspaces_managedIdentitySqlControlSettings@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Synapse_workspaces_managedIdentitySqlControlSettings@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -60,13 +60,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -75,13 +75,14 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { defaultDataLakeStorage = { - accountUrl = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.dfs + accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs filesystem = azapi_resource.container.name } @@ -90,7 +91,7 @@ resource "azapi_resource" "workspace" { sqlAdministratorLogin = "sqladminuser" sqlAdministratorLoginPassword = "H@Sh1CoR3!" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,13 +100,13 @@ resource "azapi_update_resource" "managedIdentitySqlControlSetting" { type = "Microsoft.Synapse/workspaces/managedIdentitySqlControlSettings@2021-06-01" parent_id = azapi_resource.workspace.id name = "default" - body = jsonencode({ + body = { properties = { grantSqlControlToManagedIdentity = { desiredState = "Disabled" } } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Synapse_workspaces_securityAlertPolicies@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Synapse_workspaces_securityAlertPolicies@2021-06-01/main.tf index a3d9b670..21f800e8 100644 --- a/dependency/azapi_examples/Microsoft.Synapse_workspaces_securityAlertPolicies@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Synapse_workspaces_securityAlertPolicies@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -60,13 +60,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -75,13 +75,14 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { defaultDataLakeStorage = { - accountUrl = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.dfs + accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs filesystem = azapi_resource.container.name } @@ -90,7 +91,7 @@ resource "azapi_resource" "workspace" { sqlAdministratorLogin = "sqladminuser" sqlAdministratorLoginPassword = "H@Sh1CoR3!" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,13 +100,13 @@ resource "azapi_update_resource" "securityAlertPolicy" { type = "Microsoft.Synapse/workspaces/securityAlertPolicies@2021-06-01" parent_id = azapi_resource.workspace.id name = "Default" - body = jsonencode({ + body = { properties = { state = "Enabled" - storageAccountAccessKey = jsondecode(data.azapi_resource_action.listKeys.output).keys[0].value - storageEndpoint = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.blob + storageAccountAccessKey = data.azapi_resource_action.listKeys.output.keys[0].value + storageEndpoint = azapi_resource.storageAccount.output.properties.primaryEndpoints.blob } - }) + } response_export_values = ["*"] ignore_missing_property = true } diff --git a/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools@2021-06-01/main.tf index f37f8c13..fc241c69 100644 --- a/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -60,13 +60,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -75,13 +75,14 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { defaultDataLakeStorage = { - accountUrl = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.dfs + accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs filesystem = azapi_resource.container.name } @@ -90,7 +91,7 @@ resource "azapi_resource" "workspace" { sqlAdministratorLogin = "sqladminuser" sqlAdministratorLoginPassword = "H@Sh1CoR3!" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,14 +101,14 @@ resource "azapi_resource" "sqlPool" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { createMode = "Default" } sku = { name = "DW100c" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_vulnerabilityAssessments@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_vulnerabilityAssessments@2021-06-01/main.tf index 39e492ad..725feb45 100644 --- a/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_vulnerabilityAssessments@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_vulnerabilityAssessments@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -60,13 +60,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -75,13 +75,14 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { defaultDataLakeStorage = { - accountUrl = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.dfs + accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs filesystem = azapi_resource.container.name } managedVirtualNetwork = "" @@ -89,7 +90,7 @@ resource "azapi_resource" "workspace" { sqlAdministratorLogin = "sqladminuser" sqlAdministratorLoginPassword = "H@Sh1CoR3!" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,14 +100,14 @@ resource "azapi_resource" "sqlPool" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { createMode = "Default" } sku = { name = "DW100c" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -115,12 +116,12 @@ resource "azapi_update_resource" "vulnerabilityAssessment" { type = "Microsoft.Synapse/workspaces/sqlPools/vulnerabilityAssessments@2021-06-01" parent_id = azapi_resource.sqlPool.id name = "default" - body = jsonencode({ + body = { properties = { - storageAccountAccessKey = jsondecode(data.azapi_resource_action.listKeys.output).keys[0].value + storageAccountAccessKey = data.azapi_resource_action.listKeys.output.keys[0].value storageContainerPath = "https://${azapi_resource.storageAccount.name}.blob.core.windows.net/${azapi_resource.container.name}/" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_workloadGroups@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_workloadGroups@2021-06-01/main.tf index 4e242abc..b3c31e91 100644 --- a/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_workloadGroups@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_workloadGroups@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -60,13 +60,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -75,13 +75,14 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { defaultDataLakeStorage = { - accountUrl = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.dfs + accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs filesystem = azapi_resource.container.name } managedVirtualNetwork = "" @@ -89,7 +90,7 @@ resource "azapi_resource" "workspace" { sqlAdministratorLogin = "sqladminuser" sqlAdministratorLoginPassword = "H@Sh1CoR3!" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,14 +100,14 @@ resource "azapi_resource" "sqlPool" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { createMode = "Default" } sku = { name = "DW100c" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -115,7 +116,7 @@ resource "azapi_resource" "workloadGroup" { type = "Microsoft.Synapse/workspaces/sqlPools/workloadGroups@2021-06-01" parent_id = azapi_resource.sqlPool.id name = var.resource_name - body = jsonencode({ + body = { properties = { importance = "normal" maxResourcePercent = 100 @@ -123,7 +124,7 @@ resource "azapi_resource" "workloadGroup" { minResourcePercent = 0 minResourcePercentPerRequest = 3 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_workloadGroups_workloadClassifiers@2021-06-01/main.tf b/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_workloadGroups_workloadClassifiers@2021-06-01/main.tf index 658e93e9..876fa163 100644 --- a/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_workloadGroups_workloadClassifiers@2021-06-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Synapse_workspaces_sqlPools_workloadGroups_workloadClassifiers@2021-06-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "StorageV2" properties = { } sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -60,13 +60,13 @@ resource "azapi_resource" "container" { type = "Microsoft.Storage/storageAccounts/blobServices/containers@2022-09-01" name = var.resource_name parent_id = data.azapi_resource.blobService.id - body = jsonencode({ + body = { properties = { metadata = { key = "value" } } - }) + } response_export_values = ["*"] } @@ -75,13 +75,14 @@ resource "azapi_resource" "workspace" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "SystemAssigned" - } + identity { + type = "SystemAssigned" + identity_ids = [] + } + body = { properties = { defaultDataLakeStorage = { - accountUrl = jsondecode(azapi_resource.storageAccount.output).properties.primaryEndpoints.dfs + accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs filesystem = azapi_resource.container.name } @@ -90,7 +91,7 @@ resource "azapi_resource" "workspace" { sqlAdministratorLogin = "sqladminuser" sqlAdministratorLoginPassword = "H@Sh1CoR3!" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -100,14 +101,14 @@ resource "azapi_resource" "sqlPool" { parent_id = azapi_resource.workspace.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { createMode = "Default" } sku = { name = "DW100c" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -116,7 +117,7 @@ resource "azapi_resource" "workloadGroup" { type = "Microsoft.Synapse/workspaces/sqlPools/workloadGroups@2021-06-01" parent_id = azapi_resource.sqlPool.id name = var.resource_name - body = jsonencode({ + body = { properties = { importance = "normal" maxResourcePercent = 100 @@ -124,7 +125,7 @@ resource "azapi_resource" "workloadGroup" { minResourcePercent = 0 minResourcePercentPerRequest = 3 } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -133,11 +134,11 @@ resource "azapi_resource" "workloadClassifier" { type = "Microsoft.Synapse/workspaces/sqlPools/workloadGroups/workloadClassifiers@2021-06-01" parent_id = azapi_resource.workloadGroup.id name = var.resource_name - body = jsonencode({ + body = { properties = { memberName = "dbo" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments@2020-05-15/main.tf b/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments@2020-05-15/main.tf index 2d870da4..63abf46d 100644 --- a/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments@2020-05-15/main.tf +++ b/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments@2020-05-15/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "environment" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "Gen1" properties = { dataRetentionTime = "P30D" @@ -41,7 +41,7 @@ resource "azapi_resource" "environment" { capacity = 1 name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_accessPolicies@2020-05-15/main.tf b/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_accessPolicies@2020-05-15/main.tf index a4c6f99f..1522add2 100644 --- a/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_accessPolicies@2020-05-15/main.tf +++ b/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_accessPolicies@2020-05-15/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "environment" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "Gen1" properties = { dataRetentionTime = "P30D" @@ -41,7 +41,7 @@ resource "azapi_resource" "environment" { capacity = 1 name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -50,7 +50,7 @@ resource "azapi_resource" "accessPolicy" { type = "Microsoft.TimeSeriesInsights/environments/accessPolicies@2020-05-15" parent_id = azapi_resource.environment.id name = var.resource_name - body = jsonencode({ + body = { properties = { description = "" principalObjectId = "aGUID" @@ -58,7 +58,7 @@ resource "azapi_resource" "accessPolicy" { "Reader", ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_eventSources@2020-05-15/main.tf b/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_eventSources@2020-05-15/main.tf index ff2f9eee..e7e085d3 100644 --- a/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_eventSources@2020-05-15/main.tf +++ b/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_eventSources@2020-05-15/main.tf @@ -31,10 +31,7 @@ resource "azapi_resource" "storageAccount" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { kind = "StorageV2" properties = { accessTier = "Hot" @@ -66,7 +63,7 @@ resource "azapi_resource" "storageAccount" { sku = { name = "Standard_LRS" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -76,10 +73,7 @@ resource "azapi_resource" "IotHub" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { cloudToDevice = { } @@ -106,7 +100,7 @@ resource "azapi_resource" "IotHub" { tags = { purpose = "testing" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -123,12 +117,12 @@ resource "azapi_resource" "environment" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "Gen2" properties = { storageConfiguration = { accountName = azapi_resource.storageAccount.name - managementKey = jsondecode(data.azapi_resource_action.listKeys.output).keys[0].value + managementKey = data.azapi_resource_action.listKeys.output.keys[0].value } timeSeriesIdProperties = [ { @@ -141,7 +135,7 @@ resource "azapi_resource" "environment" { capacity = 1 name = "L1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -158,17 +152,17 @@ resource "azapi_resource" "eventSource" { parent_id = azapi_resource.environment.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "Microsoft.IoTHub" properties = { consumerGroupName = "test" eventSourceResourceId = azapi_resource.IotHub.id iotHubName = azapi_resource.IotHub.name keyName = "iothubowner" - sharedAccessKey = jsondecode(data.azapi_resource_action.listkeys.output).value[0].primaryKey + sharedAccessKey = data.azapi_resource_action.listkeys.output.value[0].primaryKey timestampPropertyName = "" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_referenceDataSets@2020-05-15/main.tf b/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_referenceDataSets@2020-05-15/main.tf index 0031b354..2fb0a906 100644 --- a/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_referenceDataSets@2020-05-15/main.tf +++ b/dependency/azapi_examples/Microsoft.TimeSeriesInsights_environments_referenceDataSets@2020-05-15/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "environment" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "Gen1" properties = { dataRetentionTime = "P30D" @@ -41,7 +41,7 @@ resource "azapi_resource" "environment" { capacity = 1 name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,7 +51,7 @@ resource "azapi_resource" "referenceDataSet" { parent_id = azapi_resource.environment.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { dataStringComparisonBehavior = "Ordinal" keyProperties = [ @@ -61,7 +61,7 @@ resource "azapi_resource" "referenceDataSet" { }, ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Web_serverfarms@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Web_serverfarms@2022-09-01/main.tf index ebe64e8b..ad2259a1 100644 --- a/dependency/azapi_examples/Microsoft.Web_serverfarms@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Web_serverfarms@2022-09-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "serverfarm" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { hyperV = false perSiteScaling = false @@ -41,7 +41,7 @@ resource "azapi_resource" "serverfarm" { sku = { name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Web_sites@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Web_sites@2022-09-01/main.tf index 8ea555e2..7d6974a1 100644 --- a/dependency/azapi_examples/Microsoft.Web_sites@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Web_sites@2022-09-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "serverfarm" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { hyperV = false perSiteScaling = false @@ -41,7 +41,7 @@ resource "azapi_resource" "serverfarm" { sku = { name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,10 +51,7 @@ resource "azapi_resource" "site" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { clientAffinityEnabled = false clientCertEnabled = false @@ -84,7 +81,7 @@ resource "azapi_resource" "site" { } vnetRouteAllEnabled = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Web_sites_config@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Web_sites_config@2022-09-01/main.tf index 82791916..694d7bda 100644 --- a/dependency/azapi_examples/Microsoft.Web_sites_config@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Web_sites_config@2022-09-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "serverfarm" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { hyperV = false perSiteScaling = false @@ -41,7 +41,7 @@ resource "azapi_resource" "serverfarm" { sku = { name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,10 +51,7 @@ resource "azapi_resource" "site" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { clientAffinityEnabled = false clientCertEnabled = false @@ -84,7 +81,7 @@ resource "azapi_resource" "site" { } vnetRouteAllEnabled = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -99,11 +96,11 @@ resource "azapi_resource_action" "config" { type = "Microsoft.Web/sites/config@2022-09-01" resource_id = data.azapi_resource_id.config.id method = "PUT" - body = jsonencode({ + body = { name = "azurestorageaccounts" properties = { } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Web_sites_publicCertificates@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Web_sites_publicCertificates@2022-09-01/main.tf index 81b689a2..c03ce2d9 100644 --- a/dependency/azapi_examples/Microsoft.Web_sites_publicCertificates@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Web_sites_publicCertificates@2022-09-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "serverfarm" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "Windows" properties = { isXenon = false @@ -42,7 +42,7 @@ resource "azapi_resource" "serverfarm" { size = "S1" tier = "Standard" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -52,7 +52,7 @@ resource "azapi_resource" "site" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { clientAffinityEnabled = false clientCertEnabled = false @@ -62,7 +62,7 @@ resource "azapi_resource" "site" { siteConfig = { } } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -71,12 +71,12 @@ resource "azapi_resource" "publicCertificate" { type = "Microsoft.Web/sites/publicCertificates@2022-09-01" parent_id = azapi_resource.site.id name = var.resource_name - body = jsonencode({ + body = { properties = { blob = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNzakNDQVpvQ0NRQ01kdDdEdnlnUHREQU5CZ2txaGtpRzl3MEJBUXNGQURBYk1Sa3dGd1lEVlFRRERCQmgKY0drdWRHVnljbUZtYjNKdExtbHZNQjRYRFRFNE1EY3dOVEV3TXpNek1Gb1hEVEk0TURjd01qRXdNek16TUZvdwpHekVaTUJjR0ExVUVBd3dRWVhCcExuUmxjbkpoWm05eWJTNXBiekNDQVNJd0RRWUpLb1pJaHZjTkFRRUJCUUFECmdnRVBBRENDQVFvQ2dnRUJBS1FXMzMyT2wyOENzaWRBaGVEMWFMOVVsOEpXbktMZGFWeEtaM3NzbDVDWGpQRE8KbU03SVhrMFNnYlFuVUM4bElsUEZaaURHYlExc0I2T1RNdW42Wlo0aXBMcDgwZHRsMHJvQ0x0Q25EUU9CR3pDTgpBckNZQW9YUnVyamtYRVk3dHBEMHd3dFU3MiszN2gzSFE0ZzBWUzZWSXRKQ3FKOVFBRFYrSE8yWld1WlRlejcwCk1ob0w2T0xmWlA3SEdZZEpES2dmRVZORjVYbGJWek5BR2tESUpGZGhqTnh5R0d1NU5mc20xcGZRaEF5dW5razcKSlZhbWpVZzVJb2pSZG82M0lTOXd3ek1PZGVHU0FiQmNzSmZZZUNmVmcya3VwUjhxMFRtWit4OTNSbW1PbGJTaQo2NmtFWXhSelo5WUNRZUhKbW4xWWZKOTJCcENVaXk5QTZaMWlhS1VDQXdFQUFUQU5CZ2txaGtpRzl3MEJBUXNGCkFBT0NBUUVBSjdKaGxlY1A3SjQ4d0kyUUhUTWJBTWtrV0J2L2lXcTEvUUlGNHVnSDNaYjVQb3JPditOZmhRMEwKbFdpdy9Tek44QWU5NXZVaXhBR1lITVNhMjhvdW1NNUsxT3NxS0VrVklvMUFvQkg4bkJ6K1ZjVHBSRC9tSFhvdApBSFBBWnQ5ajVMcWVIWCtlblI2UmJJTkFmM2puK1lVM01kVmUwTXNBRGRGQVNWRGZqbVFQMlI3bzlhSmIvUXFPCmczYlpCV3NpQkRFSVNmeWFIMitwZ1VNN3d0d0VvRldtRU1sZ2pMSzFNUkJzMWNEWlhxbkhhQ2QvcnMrTm1XVjkKbmFFdTd4NWZ5UU9rNEhvemtwd2VSK0p4MXNCbFRSc2E0OS9xU0h0LzZVTEtmTzAxL2NUczRpRjcxeWtYUGJoMwpLajljSTJ1bzlhWXRYa3hraEtyR3lVcEE3RkpxV3c9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==" publicCertificateLocation = "Unknown" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Web_sites_slots@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Web_sites_slots@2022-09-01/main.tf index b41f6813..57e764c4 100644 --- a/dependency/azapi_examples/Microsoft.Web_sites_slots@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Web_sites_slots@2022-09-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "serverfarm" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { hyperV = false perSiteScaling = false @@ -41,7 +41,7 @@ resource "azapi_resource" "serverfarm" { sku = { name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,10 +51,7 @@ resource "azapi_resource" "site" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { clientAffinityEnabled = false clientCertEnabled = false @@ -84,7 +81,7 @@ resource "azapi_resource" "site" { } vnetRouteAllEnabled = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -94,10 +91,7 @@ resource "azapi_resource" "slot" { parent_id = azapi_resource.site.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { clientAffinityEnabled = false clientCertEnabled = false @@ -128,7 +122,7 @@ resource "azapi_resource" "slot" { } vnetRouteAllEnabled = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Web_sites_slots_config@2022-09-01/main.tf b/dependency/azapi_examples/Microsoft.Web_sites_slots_config@2022-09-01/main.tf index 9d65924d..fbef89b0 100644 --- a/dependency/azapi_examples/Microsoft.Web_sites_slots_config@2022-09-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Web_sites_slots_config@2022-09-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "serverfarm" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { hyperV = false perSiteScaling = false @@ -41,7 +41,7 @@ resource "azapi_resource" "serverfarm" { sku = { name = "S1" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -51,10 +51,7 @@ resource "azapi_resource" "site" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { clientAffinityEnabled = false clientCertEnabled = false @@ -84,7 +81,7 @@ resource "azapi_resource" "site" { } vnetRouteAllEnabled = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -94,10 +91,7 @@ resource "azapi_resource" "slot" { parent_id = azapi_resource.site.id name = var.resource_name location = var.location - body = jsonencode({ - identity = { - type = "None" - } + body = { properties = { clientAffinityEnabled = false clientCertEnabled = false @@ -128,7 +122,7 @@ resource "azapi_resource" "slot" { } vnetRouteAllEnabled = false } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -143,11 +137,11 @@ resource "azapi_resource_action" "config" { type = "Microsoft.Web/sites/slots/config@2022-09-01" resource_id = data.azapi_resource_id.config.id method = "PUT" - body = jsonencode({ + body = { name = "azurestorageaccounts" properties = { } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Web_sourcecontrols@2021-02-01/main.tf b/dependency/azapi_examples/Microsoft.Web_sourcecontrols@2021-02-01/main.tf index b8a9d7b4..5f06efea 100644 --- a/dependency/azapi_examples/Microsoft.Web_sourcecontrols@2021-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Web_sourcecontrols@2021-02-01/main.tf @@ -24,12 +24,12 @@ resource "azapi_update_resource" "sourcecontrol" { type = "Microsoft.Web/sourcecontrols@2021-02-01" parent_id = "/" name = "GitHub" - body = jsonencode({ + body = { properties = { token = "6mb7ploznwolt38scl2h31b00dppgaxgc8l8denep" tokenSecret = "u1komhavcqvu3qe6aedsvm9u33hlvb9qs9mfl6zr9" } - }) + } response_export_values = ["*"] } diff --git a/dependency/azapi_examples/Microsoft.Web_staticSites@2021-02-01/main.tf b/dependency/azapi_examples/Microsoft.Web_staticSites@2021-02-01/main.tf index 789bb103..2017b130 100644 --- a/dependency/azapi_examples/Microsoft.Web_staticSites@2021-02-01/main.tf +++ b/dependency/azapi_examples/Microsoft.Web_staticSites@2021-02-01/main.tf @@ -31,14 +31,14 @@ resource "azapi_resource" "staticSite" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { properties = { } sku = { name = "Free" tier = "Free" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/microsoft.alertsManagement_smartDetectorAlertRules@2019-06-01/main.tf b/dependency/azapi_examples/microsoft.alertsManagement_smartDetectorAlertRules@2019-06-01/main.tf index 19f24c4f..fb1189fd 100644 --- a/dependency/azapi_examples/microsoft.alertsManagement_smartDetectorAlertRules@2019-06-01/main.tf +++ b/dependency/azapi_examples/microsoft.alertsManagement_smartDetectorAlertRules@2019-06-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "actionGroup" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { armRoleReceivers = [ ] @@ -58,7 +58,7 @@ resource "azapi_resource" "actionGroup" { webhookReceivers = [ ] } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -68,7 +68,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -80,7 +80,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -90,7 +90,7 @@ resource "azapi_resource" "smartDetectorAlertRule" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = "global" - body = jsonencode({ + body = { properties = { actionGroups = { customEmailSubject = "" @@ -110,7 +110,7 @@ resource "azapi_resource" "smartDetectorAlertRule" { severity = "Sev0" state = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } diff --git a/dependency/azapi_examples/microsoft.insights_components_analyticsItems@2015-05-01/main.tf b/dependency/azapi_examples/microsoft.insights_components_analyticsItems@2015-05-01/main.tf index e017f878..224b6666 100644 --- a/dependency/azapi_examples/microsoft.insights_components_analyticsItems@2015-05-01/main.tf +++ b/dependency/azapi_examples/microsoft.insights_components_analyticsItems@2015-05-01/main.tf @@ -31,7 +31,7 @@ resource "azapi_resource" "component" { parent_id = azapi_resource.resourceGroup.id name = var.resource_name location = var.location - body = jsonencode({ + body = { kind = "web" properties = { Application_Type = "web" @@ -43,7 +43,7 @@ resource "azapi_resource" "component" { publicNetworkAccessForIngestion = "Enabled" publicNetworkAccessForQuery = "Enabled" } - }) + } schema_validation_enabled = false response_export_values = ["*"] } @@ -58,11 +58,11 @@ resource "azapi_resource_action" "analyticsItem" { type = "microsoft.insights/components/analyticsItems@2015-05-01" resource_id = data.azapi_resource_id.analyticsItem.id method = "PUT" - body = jsonencode({ + body = { Content = "requests #test" Name = "testquery" Scope = "shared" Type = "query" - }) + } } diff --git a/resource/context.go b/resource/context.go index f088da4a..23e510b8 100644 --- a/resource/context.go +++ b/resource/context.go @@ -26,7 +26,10 @@ type Context struct { azapiAddingMap map[string]bool } -const DefaultProviderConfig = `terraform { +var DefaultProviderConfig string + +func init() { + DefaultProviderConfig = fmt.Sprintf(`terraform { required_providers { azapi = { source = "Azure/azapi" @@ -34,13 +37,26 @@ const DefaultProviderConfig = `terraform { } } +provider "azurerm" { + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + key_vault { + purge_soft_delete_on_destroy = false + purge_soft_deleted_keys_on_destroy = false + } + } + skip_provider_registration = true +} + provider "azapi" { skip_provider_registration = false } variable "resource_name" { type = string - default = "acctest0001" + default = "acctest%04d" } variable "location" { @@ -48,7 +64,8 @@ variable "location" { default = "westeurope" } -` +`, rand.New(rand.NewSource(time.Now().UnixNano())).Intn(10000)) +} func NewContext(referenceResolvers []resolver.ReferenceResolver) *Context { knownPatternMap := make(map[string]types.Reference) diff --git a/resource/context_test.go b/resource/context_test.go index f76e6bdc..84a364dd 100644 --- a/resource/context_test.go +++ b/resource/context_test.go @@ -17,6 +17,19 @@ func Test_NewContextInit(t *testing.T) { } } +provider "azurerm" { + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + key_vault { + purge_soft_delete_on_destroy = false + purge_soft_deleted_keys_on_destroy = false + } + } + skip_provider_registration = true +} + provider "azapi" { skip_provider_registration = false } diff --git a/resource/types/azapi_definition.go b/resource/types/azapi_definition.go index 11bdeffe..56b8a860 100644 --- a/resource/types/azapi_definition.go +++ b/resource/types/azapi_definition.go @@ -60,7 +60,7 @@ func (def AzapiDefinition) String() string { BODY`, jsonBody) } else { expressions += fmt.Sprintf(` - body = jsonencode(%[1]s)`, hcl.MarshalIndent(bodyMap, " ", " ")) + body = %[1]s`, hcl.MarshalIndent(bodyMap, " ", " ")) } } } diff --git a/resource/types/azapi_definition_test.go b/resource/types/azapi_definition_test.go index 219c98cc..4afe4cf9 100644 --- a/resource/types/azapi_definition_test.go +++ b/resource/types/azapi_definition_test.go @@ -37,7 +37,7 @@ func Test_AzapiDefinitionString(t *testing.T) { type = "Microsoft.Network/virtualNetworks@2020-06-01" parent_id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test" name = "test" - body = jsonencode({ + body = { properties = { addressSpace = { addressPrefixes = [ @@ -45,7 +45,7 @@ func Test_AzapiDefinitionString(t *testing.T) { ] } } - }) + } } `, }, diff --git a/tf/terraform.go b/tf/terraform.go index a8fb7628..c60569e7 100644 --- a/tf/terraform.go +++ b/tf/terraform.go @@ -64,7 +64,7 @@ func (t *Terraform) Show() (*tfjson.State, error) { } func (t *Terraform) Plan() (*tfjson.Plan, error) { - ok, err := t.exec.Plan(context.TODO(), tfexec.Out(planfile)) + ok, err := t.exec.Plan(context.TODO(), tfexec.Out(planfile), tfexec.Refresh(true)) if err != nil { return nil, err } diff --git a/tf/utils.go b/tf/utils.go index 423bfd92..b1c40d7c 100644 --- a/tf/utils.go +++ b/tf/utils.go @@ -65,10 +65,10 @@ func NewDiffReport(plan *tfjson.Plan, logs []paltypes.RequestTrace) types.DiffRe } for _, resourceChange := range plan.ResourceChanges { - if !strings.HasPrefix(resourceChange.Address, "azapi_") { + if resourceChange == nil || resourceChange.Change == nil || resourceChange.Change.Before == nil || resourceChange.Change.After == nil { continue } - if resourceChange == nil || resourceChange.Change == nil || resourceChange.Change.Before == nil || resourceChange.Change.After == nil { + if !strings.HasPrefix(resourceChange.Address, "azapi_") { continue } if len(resourceChange.Change.Actions) == 1 && resourceChange.Change.Actions[0] == tfjson.ActionNoop { @@ -83,14 +83,28 @@ func NewDiffReport(plan *tfjson.Plan, logs []paltypes.RequestTrace) types.DiffRe logrus.Errorf("resource %s has no id", resourceChange.Address) continue } + + var change types.Change + + if _, ok := beforeMap["body"].(string); ok { + change = types.Change{ + Before: beforeMap["body"].(string), + After: afterMap["body"].(string), + } + } else { + payloadBefore, _ := json.Marshal(beforeMap["body"]) + payloadAfter, _ := json.Marshal(afterMap["body"]) + change = types.Change{ + Before: string(payloadBefore), + After: string(payloadAfter), + } + } + out.Diffs = append(out.Diffs, types.Diff{ Id: afterMap["id"].(string), Type: afterMap["type"].(string), Address: resourceChange.Address, - Change: types.Change{ - Before: beforeMap["body"].(string), - After: afterMap["body"].(string), - }, + Change: change, }) } @@ -130,10 +144,10 @@ func NewPassReport(plan *tfjson.Plan) types.PassReport { } for _, resourceChange := range plan.ResourceChanges { - if !strings.HasPrefix(resourceChange.Address, "azapi_") { + if resourceChange == nil || resourceChange.Change == nil { continue } - if resourceChange == nil || resourceChange.Change == nil { + if !strings.HasPrefix(resourceChange.Address, "azapi_") { continue } if len(resourceChange.Change.Actions) == 1 && resourceChange.Change.Actions[0] == tfjson.ActionNoop { @@ -214,11 +228,13 @@ func NewCoverageReport(plan *tfjson.Plan, swaggerPath string) (coverage.Coverage continue } if actions := resourceChange.Change.Actions; len(actions) == 1 && (actions[0] == tfjson.ActionNoop || actions[0] == tfjson.ActionUpdate) { - beforeMap, beforeMapOk := resourceChange.Change.Before.(map[string]interface{}) + outMap, beforeMapOk := resourceChange.Change.Before.(map[string]interface{}) if !beforeMapOk { continue } + beforeMap := DeepCopy(outMap).(map[string]interface{}) + id := "" if v, ok := beforeMap["id"]; ok { id = v.(string) @@ -247,7 +263,11 @@ func NewCoverageReport(plan *tfjson.Plan, swaggerPath string) (coverage.Coverage func getBody(input map[string]interface{}) (map[string]interface{}, error) { output := map[string]interface{}{} - if bodyRaw, ok := input["body"]; ok && bodyRaw != nil && bodyRaw.(string) != "" { + bodyRaw, ok := input["body"] + if !ok || bodyRaw == nil { + return output, nil + } + if bodyStr, ok := bodyRaw.(string); ok && bodyStr != "" { if value, ok := input["tags"]; ok && value != nil && len(value.(map[string]interface{})) > 0 { output["tags"] = value.(map[string]interface{}) } @@ -260,10 +280,22 @@ func getBody(input map[string]interface{}) (map[string]interface{}, error) { output["identity"] = expandIdentity(value.([]interface{})) } - err := json.Unmarshal([]byte(bodyRaw.(string)), &output) - if err != nil { - return output, err + err := json.Unmarshal([]byte(bodyStr), &output) + return output, err + } + if bodyMap, ok := bodyRaw.(map[string]interface{}); ok { + if value, ok := input["tags"]; ok && value != nil && len(value.(map[string]interface{})) > 0 { + bodyMap["tags"] = value.(map[string]interface{}) + } + + if value, ok := input["location"]; ok && value != nil && value.(string) != "" { + bodyMap["location"] = value.(string) } + + if value, ok := input["identity"]; ok && value != nil && len(value.([]interface{})) > 0 { + bodyMap["identity"] = expandIdentity(value.([]interface{})) + } + return bodyMap, nil } return output, nil @@ -300,14 +332,19 @@ func NewErrorReport(applyErr error, logs []paltypes.RequestTrace) types.ErrorRep if applyErr == nil { return out } - res := strings.Split(applyErr.Error(), "Error: creating/updating") + var res []string + if strings.Contains(applyErr.Error(), "Error: Failed to create/update resource") { + res = strings.Split(applyErr.Error(), "Error: Failed to create/update resource") + } else { + res = strings.Split(applyErr.Error(), "Error: creating/updating") + } for _, e := range res { var id, apiVersion, label string errorMessage := e if lastIndex := strings.LastIndex(e, "------"); lastIndex != -1 { errorMessage = errorMessage[0:lastIndex] } - if matches := regexp.MustCompile(`ResourceId \\"(.+)\\" / Api Version \\"(.+)\\"\)`).FindAllStringSubmatch(e, -1); len(matches) == 1 { + if matches := regexp.MustCompile(`ResourceId\s+\\?"([^\\]+)\\?"\s+/\s+Api Version \\?"([^\\]+)\\?"\)`).FindAllStringSubmatch(e, -1); len(matches) == 1 { id = matches[0][1] apiVersion = matches[0][2] } @@ -332,14 +369,22 @@ func NewCleanupErrorReport(applyErr error, logs []paltypes.RequestTrace) types.E Errors: make([]types.Error, 0), Logs: logs, } - res := strings.Split(applyErr.Error(), "Error: deleting") + if applyErr == nil { + return out + } + var res []string + if strings.Contains(applyErr.Error(), "Error: Failed to delete resource") { + res = strings.Split(applyErr.Error(), "Error: Failed to delete resource") + } else { + res = strings.Split(applyErr.Error(), "Error: deleting") + } for _, e := range res { var id, apiVersion string errorMessage := e if lastIndex := strings.LastIndex(e, "------"); lastIndex != -1 { errorMessage = errorMessage[0:lastIndex] } - if matches := regexp.MustCompile(`ResourceId \\"(.+)\\" / Api Version \\"(.+)\\"\)`).FindAllStringSubmatch(e, -1); len(matches) == 1 { + if matches := regexp.MustCompile(`ResourceId\s+\\?"([^\\]+)\\?"\s+/\s+Api Version \\?"([^\\]+)\\?"\)`).FindAllStringSubmatch(e, -1); len(matches) == 1 { id = matches[0][1] apiVersion = matches[0][2] } else { @@ -370,3 +415,25 @@ func NewIdAddressFromState(state *tfjson.State) map[string]string { } return out } + +func DeepCopy(input interface{}) interface{} { + if input == nil { + return nil + } + switch v := input.(type) { + case map[string]interface{}: + out := map[string]interface{}{} + for key, value := range v { + out[key] = DeepCopy(value) + } + return out + case []interface{}: + out := make([]interface{}, len(v)) + for i, value := range v { + out[i] = DeepCopy(value) + } + return out + default: + return input + } +} diff --git a/tf/utils_test.go b/tf/utils_test.go index 6af4ecac..c44af7c9 100644 --- a/tf/utils_test.go +++ b/tf/utils_test.go @@ -2,12 +2,499 @@ package tf_test import ( "fmt" + "reflect" "testing" "github.com/azure/armstrong/tf" "github.com/azure/armstrong/types" + tfjson "github.com/hashicorp/terraform-json" ) +func Test_GetChanges(t *testing.T) { + var testcases = []struct { + Input *tfjson.Plan + Expect []tf.Action + }{ + { + Input: nil, + Expect: []tf.Action{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionCreate}, + }, + }, + }, + }, + Expect: []tf.Action{tf.ActionCreate}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionRead}, + }, + }, + }, + }, + Expect: []tf.Action{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionNoop}, + }, + }, + }, + }, + Expect: []tf.Action{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionDelete}, + }, + }, + }, + }, + Expect: []tf.Action{tf.ActionDelete}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionUpdate}, + }, + }, + }, + }, + Expect: []tf.Action{tf.ActionUpdate}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionDelete, tfjson.ActionCreate}, + }, + }, + }, + }, + Expect: []tf.Action{tf.ActionReplace}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Change: &tfjson.Change{ + Actions: []tfjson.Action{}, + }, + }, + }, + }, + Expect: []tf.Action{}, + }, + } + + for _, testcase := range testcases { + actual := tf.GetChanges(testcase.Input) + if len(actual) != len(testcase.Expect) { + t.Errorf("Expect %d changes, but got %d", len(testcase.Expect), len(actual)) + continue + } + for i := 0; i < len(actual); i++ { + if actual[i] != testcase.Expect[i] { + t.Errorf("Expect change %s, but got %s", testcase.Expect[i], actual[i]) + } + } + } +} + +func Test_NewDiffReport(t *testing.T) { + var testcases = []struct { + Input *tfjson.Plan + Expect types.DiffReport + }{ + { + Input: nil, + Expect: types.DiffReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + {}, + }, + }, + Expect: types.DiffReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azurerm_resource_group.test", + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionUpdate}, + Before: "before", + After: "after", + }, + }, + }, + }, + Expect: types.DiffReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azapi_resource.test", + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionNoop}, + Before: "foo", + After: "foo", + }, + }, + }, + }, + Expect: types.DiffReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azapi_resource.test", + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionUpdate}, + Before: "foo", + After: "foo", + }, + }, + }, + }, + Expect: types.DiffReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azapi_resource.test", + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionUpdate}, + Before: map[string]interface{}{ + "type": "Microsoft.AppPlatform/Spring", + "body": map[string]interface{}{ + "foo": "bar", + }, + }, + After: map[string]interface{}{ + "type": "Microsoft.AppPlatform/Spring", + "body": map[string]interface{}{ + "foo": "bar", + }, + }, + }, + }, + }, + }, + Expect: types.DiffReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azapi_resource.test", + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionUpdate}, + Before: map[string]interface{}{ + "id": "/subscriptions/*****/resourceGroups/acctest1220/providers/Microsoft.AppPlatform/Spring/acctest1220", + "type": "Microsoft.AppPlatform/Spring", + "body": `{"foo": "bar"}`, + }, + After: map[string]interface{}{ + "id": "/subscriptions/*****/resourceGroups/acctest1220/providers/Microsoft.AppPlatform/Spring/acctest1220", + "type": "Microsoft.AppPlatform/Spring", + "body": `{"foo": "after"}`, + }, + }, + }, + }, + }, + Expect: types.DiffReport{ + Diffs: []types.Diff{ + { + Id: "/subscriptions/*****/resourceGroups/acctest1220/providers/Microsoft.AppPlatform/Spring/acctest1220", + Type: "Microsoft.AppPlatform/Spring", + Address: "azapi_resource.test", + Change: types.Change{ + Before: `{"foo": "bar"}`, + After: `{"foo": "after"}`, + }, + }, + }, + }, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azapi_resource.test", + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionUpdate}, + Before: map[string]interface{}{ + "id": "/subscriptions/*****/resourceGroups/acctest1220/providers/Microsoft.AppPlatform/Spring/acctest1220", + "type": "Microsoft.AppPlatform/Spring", + "body": map[string]interface{}{ + "foo": "bar", + }, + }, + After: map[string]interface{}{ + "id": "/subscriptions/*****/resourceGroups/acctest1220/providers/Microsoft.AppPlatform/Spring/acctest1220", + "type": "Microsoft.AppPlatform/Spring", + "body": map[string]interface{}{ + "foo": "after", + }, + }, + }, + }, + }, + }, + Expect: types.DiffReport{ + Diffs: []types.Diff{ + { + Id: "/subscriptions/*****/resourceGroups/acctest1220/providers/Microsoft.AppPlatform/Spring/acctest1220", + Type: "Microsoft.AppPlatform/Spring", + Address: "azapi_resource.test", + Change: types.Change{ + Before: `{"foo":"bar"}`, + After: `{"foo":"after"}`, + }, + }, + }, + }, + }, + } + + for _, testcase := range testcases { + actual := tf.NewDiffReport(testcase.Input, nil) + if len(actual.Diffs) != len(testcase.Expect.Diffs) { + t.Errorf("Expect diff %v, but got %v", testcase.Expect.Diffs, actual.Diffs) + continue + } + for i := 0; i < len(actual.Diffs); i++ { + if actual.Diffs[i].Id != testcase.Expect.Diffs[i].Id { + t.Errorf("Expect diff id %s, but got %s", testcase.Expect.Diffs[i].Id, actual.Diffs[i].Id) + } + if actual.Diffs[i].Type != testcase.Expect.Diffs[i].Type { + t.Errorf("Expect diff type %s, but got %s", testcase.Expect.Diffs[i].Type, actual.Diffs[i].Type) + } + if actual.Diffs[i].Address != testcase.Expect.Diffs[i].Address { + t.Errorf("Expect diff address %s, but got %s", testcase.Expect.Diffs[i].Address, actual.Diffs[i].Address) + } + if actual.Diffs[i].Change.Before != testcase.Expect.Diffs[i].Change.Before { + t.Errorf("Expect diff before %s, but got %s", testcase.Expect.Diffs[i].Change.Before, actual.Diffs[i].Change.Before) + } + if actual.Diffs[i].Change.After != testcase.Expect.Diffs[i].Change.After { + t.Errorf("Expect diff after %s, but got %s", testcase.Expect.Diffs[i].Change.After, actual.Diffs[i].Change.After) + } + } + } +} + +func Test_NewPassReportFromState(t *testing.T) { + var testcases = []struct { + Input *tfjson.State + Expect types.PassReport + }{ + { + Input: nil, + Expect: types.PassReport{}, + }, + { + Input: &tfjson.State{}, + Expect: types.PassReport{}, + }, + { + Input: &tfjson.State{ + Values: &tfjson.StateValues{ + RootModule: &tfjson.StateModule{ + Resources: []*tfjson.StateResource{ + { + Address: "azapi_resource.test", + AttributeValues: map[string]interface{}{ + "type": "Microsoft.AppPlatform/Spring", + }, + }, + { + Address: "azapi_resource.test2", + AttributeValues: map[string]interface{}{ + "type": "Microsoft.AppPlatform/Spring", + }, + }, + { + Address: "azurerm_resource_group.test", + AttributeValues: map[string]interface{}{}, + }, + }, + }, + }, + }, + Expect: types.PassReport{ + Resources: []types.Resource{ + { + Type: "Microsoft.AppPlatform/Spring", + Address: "azapi_resource.test", + }, + { + Type: "Microsoft.AppPlatform/Spring", + Address: "azapi_resource.test2", + }, + }, + }, + }, + } + + for _, testcase := range testcases { + actual := tf.NewPassReportFromState(testcase.Input) + if len(actual.Resources) != len(testcase.Expect.Resources) { + t.Errorf("Expect %d resources, but got %d", len(testcase.Expect.Resources), len(actual.Resources)) + continue + } + for i := 0; i < len(actual.Resources); i++ { + if actual.Resources[i].Address != testcase.Expect.Resources[i].Address { + t.Errorf("Expect resource address %s, but got %s", testcase.Expect.Resources[i].Address, actual.Resources[i].Address) + } + if actual.Resources[i].Type != testcase.Expect.Resources[i].Type { + t.Errorf("Expect resource type %s, but got %s", testcase.Expect.Resources[i].Type, actual.Resources[i].Type) + } + } + } +} + +func Test_NewPassReport(t *testing.T) { + var testcases = []struct { + Input *tfjson.Plan + Expect types.PassReport + }{ + { + Input: nil, + Expect: types.PassReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + {}, + }, + }, + Expect: types.PassReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azurerm_resource_group.test", + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionUpdate}, + Before: "before", + After: "after", + }, + }, + }, + }, + Expect: types.PassReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azapi_resource.test", + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionNoop}, + Before: "foo", + After: "foo", + }, + }, + }, + }, + Expect: types.PassReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azapi_resource.test", + }, + }, + }, + Expect: types.PassReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azapi_resource.test", + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionUpdate}, + Before: "foo", + After: "foo", + }, + }, + }, + }, + Expect: types.PassReport{}, + }, + { + Input: &tfjson.Plan{ + ResourceChanges: []*tfjson.ResourceChange{ + { + Address: "azapi_resource.test", + Change: &tfjson.Change{ + Actions: []tfjson.Action{tfjson.ActionNoop}, + Before: map[string]interface{}{ + "type": "Microsoft.AppPlatform/Spring", + }, + After: map[string]interface{}{ + "type": "Microsoft.AppPlatform/Spring", + }, + }, + }, + }, + }, + Expect: types.PassReport{ + Resources: []types.Resource{ + { + Type: "Microsoft.AppPlatform/Spring", + Address: "azapi_resource.test", + }, + }, + }, + }, + } + + for _, testcase := range testcases { + actual := tf.NewPassReport(testcase.Input) + if len(actual.Resources) != len(testcase.Expect.Resources) { + t.Errorf("Expect %d resources, but got %d", len(testcase.Expect.Resources), len(actual.Resources)) + continue + } + for i := 0; i < len(actual.Resources); i++ { + if actual.Resources[i].Address != testcase.Expect.Resources[i].Address { + t.Errorf("Expect resource address %s, but got %s", testcase.Expect.Resources[i].Address, actual.Resources[i].Address) + } + if actual.Resources[i].Type != testcase.Expect.Resources[i].Type { + t.Errorf("Expect resource type %s, but got %s", testcase.Expect.Resources[i].Type, actual.Resources[i].Type) + } + } + } +} + func Test_NewErrorReport(t *testing.T) { var testcases = []struct { Input error @@ -72,6 +559,44 @@ Response contained no body }, }, }, + { + Input: fmt.Errorf(` +Error: Failed to create/update resource + + with azapi_resource.dataCollectionRule, + on testing.tf line 2, in resource "azapi_resource" "dataCollectionRule": + 2: resource "azapi_resource" "dataCollectionRule" { + +creating/updating Resource: (ResourceId +"/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001" +/ Api Version "2022-06-01"): PUT +https://management.azure.com/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001 +-------------------------------------------------------------------------------- +RESPONSE 400: 400 Bad Request +ERROR CODE: InvalidPayload +-------------------------------------------------------------------------------- +{ + "error": { + "code": "InvalidPayload", + "message": "Data collection rule is invalid", + "details": [ + { + "code": "InvalidProperty", + "message": "XPath query is invalid. Query: 'Security!', Error: Query expression cannot be empty.", + "target": "Properties.DataSources.WindowsEventLogs[0].XPathQueries[0]" + } + ] + } +} +--------------------------------------------------------------------------------`), + Expect: []types.Error{ + { + Type: "Microsoft.Insights/dataCollectionRules@2022-06-01", + Label: "dataCollectionRule", + Id: "/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001", + }, + }, + }, } for _, testcase := range testcases { @@ -93,3 +618,150 @@ Response contained no body } } } + +func Test_NewCleanupErrorReport(t *testing.T) { + var testcases = []struct { + Input error + Expect types.ErrorReport + }{ + { + Input: nil, + Expect: types.ErrorReport{}, + }, + { + Input: fmt.Errorf(`Error: Failed to delete resource + +deleting Resource: (ResourceId +"/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001" +/ Api Version "2022-06-01"): DELETE +https://management.azure.com/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001 +-------------------------------------------------------------------------------- +RESPONSE 409: 409 Conflict +ERROR CODE: ScopeLocked +-------------------------------------------------------------------------------- +{ + "error": { + "code": "ScopeLocked", + "message": "The scope '/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001' cannot perform delete operation because following scope(s) are locked: '/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001'. Please remove the lock and try again." + } +} +--------------------------------------------------------------------------------`), + Expect: types.ErrorReport{ + Errors: []types.Error{ + { + Type: "Microsoft.Insights/dataCollectionRules@2022-06-01", + Id: "/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001", + }, + }, + }, + }, + { + Input: fmt.Errorf(`Error: deleting Resource: (ResourceId \"/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001\" / Api Version \"2022-06-01\"): + +DELETE https://management.azure.com/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001 +-------------------------------------------------------------------------------- +RESPONSE 409: 409 Conflict +ERROR CODE: ScopeLocked +-------------------------------------------------------------------------------- +{ + "error": { + "code": "ScopeLocked", + "message": "The scope '/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001' cannot perform delete operation because following scope(s) are locked: '/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001'. Please remove the lock and try again." + } +} +--------------------------------------------------------------------------------`), + Expect: types.ErrorReport{ + Errors: []types.Error{ + { + Type: "Microsoft.Insights/dataCollectionRules@2022-06-01", + Id: "/subscriptions/******/resourceGroups/acctest0001/providers/Microsoft.Insights/dataCollectionRules/acctest0001", + }, + }, + }, + }, + } + + for _, testcase := range testcases { + actual := tf.NewCleanupErrorReport(testcase.Input, nil) + if len(actual.Errors) != len(testcase.Expect.Errors) { + t.Errorf("Expect %d errors, but got %d", len(testcase.Expect.Errors), len(actual.Errors)) + continue + } + for i := 0; i < len(actual.Errors); i++ { + if actual.Errors[i].Type != testcase.Expect.Errors[i].Type { + t.Errorf("Expect error type %s, but got %s", testcase.Expect.Errors[i].Type, actual.Errors[i].Type) + } + if actual.Errors[i].Id != testcase.Expect.Errors[i].Id { + t.Errorf("Expect error id %s, but got %s", testcase.Expect.Errors[i].Id, actual.Errors[i].Id) + } + } + } +} + +func Test_NewIdAddressFromState(t *testing.T) { + testcases := []struct { + Input *tfjson.State + Expect map[string]string + }{ + { + Input: nil, + Expect: map[string]string{}, + }, + { + Input: &tfjson.State{ + Values: &tfjson.StateValues{ + RootModule: &tfjson.StateModule{ + Resources: []*tfjson.StateResource{ + { + Address: "azapi_resource.test", + AttributeValues: map[string]interface{}{ + "id": "/subscriptions/*****/resourceGroups/acctest1220/providers/Microsoft.AppPlatform/Spring/acctest1220", + }, + }, + { + Address: "azapi_resource.test2", + AttributeValues: map[string]interface{}{ + "id": "/subscriptions/*****/resourceGroups/acctest1220/providers/Microsoft.AppPlatform/Spring/acctest1222", + }, + }, + }, + }, + }, + }, + Expect: map[string]string{ + "/subscriptions/*****/resourceGroups/acctest1220/providers/Microsoft.AppPlatform/Spring/acctest1220": "azapi_resource.test", + "/subscriptions/*****/resourceGroups/acctest1220/providers/Microsoft.AppPlatform/Spring/acctest1222": "azapi_resource.test2", + }, + }, + } + + for _, testcase := range testcases { + actual := tf.NewIdAddressFromState(testcase.Input) + if !reflect.DeepEqual(actual, testcase.Expect) { + t.Errorf("Expect %v, but got %v", testcase.Expect, actual) + } + } +} + +func Test_DeepCopy(t *testing.T) { + testcases := []interface{}{ + nil, + "foo", + 1, + 1.1, + true, + map[string]interface{}{ + "foo": "bar", + }, + []interface{}{ + "foo", + }, + } + + for _, testcase := range testcases { + actual := tf.DeepCopy(testcase) + if !reflect.DeepEqual(actual, testcase) { + t.Errorf("Expect different pointer, but got the same") + } + } +} diff --git a/utils/hcl_test.go b/utils/hcl_test.go index 21f89444..c55af9e7 100644 --- a/utils/hcl_test.go +++ b/utils/hcl_test.go @@ -112,6 +112,9 @@ data "azapi_resource_list" "listDomainsByApp" { depends_on = [azapi_resource.domain] } +data "azapi_resource_list" "test" { +} + `, Expected: []string{ "Microsoft.Resources/resourceGroups@2020-06-01", @@ -120,6 +123,7 @@ data "azapi_resource_list" "listDomainsByApp" { "Microsoft.AppPlatform/Spring/apps/domains@2022-04-01", "Microsoft.AppPlatform/Spring/apps/domains@2022-04-01", "Microsoft.AppPlatform/Spring/apps/domains@2022-04-01", + "", }, }, } diff --git a/utils/id_test.go b/utils/id_test.go index 3b11442f..edf60081 100644 --- a/utils/id_test.go +++ b/utils/id_test.go @@ -50,6 +50,74 @@ func Test_IsResourceId(t *testing.T) { } } +func Test_ActionName(t *testing.T) { + testcases := []struct { + Input string + Expect string + }{ + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000", + Expect: "", + }, + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg", + Expect: "", + }, + { + Input: "/", + Expect: "", + }, + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/aa/runbooks/rb/providers/Microsoft.Resources/locks/myLock", + Expect: "", + }, + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/aa/runbooks/rb/start", + Expect: "start", + }, + } + + for _, testcase := range testcases { + t.Logf("[DEBUG] testcase: %s", testcase.Input) + actual := utils.ActionName(testcase.Input) + if actual != testcase.Expect { + t.Fatalf("[ERROR] expect %s, actual %s", testcase.Expect, actual) + } + } +} + +func Test_LastSegment(t *testing.T) { + testcases := []struct { + Input string + Expect string + }{ + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000", + Expect: "00000000-0000-0000-0000-000000000000", + }, + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg", + Expect: "rg", + }, + { + Input: "/", + Expect: "", + }, + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/validate", + Expect: "validate", + }, + } + + for _, testcase := range testcases { + t.Logf("[DEBUG] testcase: %s", testcase.Input) + actual := utils.LastSegment(testcase.Input) + if actual != testcase.Expect { + t.Fatalf("[ERROR] expect %s, actual %s", testcase.Expect, actual) + } + } +} + func Test_ResourceTypeOfResourceId(t *testing.T) { testcases := []struct { Input string @@ -97,6 +165,10 @@ func Test_ResourceTypeOfResourceId(t *testing.T) { Input: "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Automation/checkNameAvailability", Expect: "Microsoft.Automation", }, + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Automation/automationAccounts/aa/runbooks/rb/providers/Microsoft.Resources/locks/myLock", + Expect: "Microsoft.Resources/locks", + }, } for _, testcase := range testcases { @@ -108,6 +180,42 @@ func Test_ResourceTypeOfResourceId(t *testing.T) { } } +func Test_ScopeOfListAction(t *testing.T) { + testcases := []struct { + Input string + Expect string + }{ + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups", + Expect: "/subscriptions/00000000-0000-0000-0000-000000000000", + }, + { + Input: "/", + Expect: "", + }, + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/aa/runbooks/rb/providers/Microsoft.Resources/locks", + Expect: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/aa/runbooks/rb", + }, + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/aa/runbooks", + Expect: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/aa", + }, + { + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts", + Expect: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg", + }, + } + + for _, testcase := range testcases { + t.Logf("[DEBUG] testcase: %s", testcase.Input) + actual := utils.ScopeOfListAction(testcase.Input) + if actual != testcase.Expect { + t.Fatalf("[ERROR] expect %s, actual %s", testcase.Expect, actual) + } + } +} + func Test_PrentIdOfResourceId(t *testing.T) { testcases := []struct { Input string