diff --git a/docs/resources/netflow_exporter_policy.md b/docs/resources/netflow_exporter_policy.md index 68de629c7..d22701571 100644 --- a/docs/resources/netflow_exporter_policy.md +++ b/docs/resources/netflow_exporter_policy.md @@ -69,13 +69,13 @@ resource "aci_netflow_exporter_policy" "full_example_tenant" { relation_to_vrf = [ { annotation = "annotation_1" - target_dn = "uni/tn-test_tenant/ctx-test_vrf" + target_dn = aci_vrf.example.id } ] relation_to_epg = [ { annotation = "annotation_1" - target_dn = "uni/tn-test_tenant/ap-test_ap/epg-test_epg" + target_dn = aci_application_epg.example.id } ] annotations = [ diff --git a/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf b/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf index aa89ae48a..8cf1e63a4 100644 --- a/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf +++ b/examples/resources/aci_netflow_exporter_policy/resource-all-attributes.tf @@ -16,13 +16,13 @@ resource "aci_netflow_exporter_policy" "full_example_tenant" { relation_to_vrf = [ { annotation = "annotation_1" - target_dn = "uni/tn-test_tenant/ctx-test_vrf" + target_dn = aci_vrf.example.id } ] relation_to_epg = [ { annotation = "annotation_1" - target_dn = "uni/tn-test_tenant/ap-test_ap/epg-test_epg" + target_dn = aci_application_epg.example.id } ] annotations = [ diff --git a/gen/definitions/properties.yaml b/gen/definitions/properties.yaml index 33de05b29..132473aa1 100644 --- a/gen/definitions/properties.yaml +++ b/gen/definitions/properties.yaml @@ -980,6 +980,7 @@ netflowRsExporterToEPg: targets: - class_name: "fvAEPg" target_dn: "uni/tn-test_tenant/ap-test_ap/epg-test_epg" + target_dn_overwrite_docs: "aci_application_epg.example.id" relation_resource_name: "epg" static: true @@ -991,6 +992,7 @@ netflowRsExporterToCtx: targets: - class_name: "fvCtx" target_dn: "uni/tn-test_tenant/ctx-test_vrf" + target_dn_overwrite_docs: "aci_vrf.example.id" relation_resource_name: "vrf" static: true diff --git a/gen/generator.go b/gen/generator.go index 72435c33b..ce8f6c097 100644 --- a/gen/generator.go +++ b/gen/generator.go @@ -895,6 +895,7 @@ type TestDependency struct { ParentDnKey string TargetDn string TargetDnRef string + TargetDnOverwriteDocs string TargetResourceName string RelationResourceName string Static bool @@ -2072,10 +2073,14 @@ func getTestDependency(className string, targetMap map[interface{}]interface{}, testDependency.Static = static.(bool) } + if targetDnOverwriteDocs, ok := targetMap["target_dn_overwrite_docs"]; ok { + testDependency.TargetDnOverwriteDocs = targetDnOverwriteDocs.(string) + } + return testDependency } -func GetTestTargetDn(targets []interface{}, resourceName, targetDnValue string, reference bool, targetClasses interface{}, index int) string { +func GetTestTargetDn(targets []interface{}, resourceName, targetDnValue string, reference bool, targetClasses interface{}, index int, overwriteDocs bool) string { var filteredTargets []interface{} targetResourceName := strings.TrimPrefix(resourceName, "relation_to_") @@ -2109,6 +2114,9 @@ func GetTestTargetDn(targets []interface{}, resourceName, targetDnValue string, if reference && !static { return target.(map[interface{}]interface{})["target_dn_ref"].(string) } + if v, ok := target.(map[interface{}]interface{})["target_dn_overwrite_docs"].(string); ok && overwriteDocs && v != "" { + return v + } return target.(map[interface{}]interface{})["target_dn"].(string) } } diff --git a/gen/templates/datasource_example.tf.tmpl b/gen/templates/datasource_example.tf.tmpl index c2e0e9f21..16e323564 100644 --- a/gen/templates/datasource_example.tf.tmpl +++ b/gen/templates/datasource_example.tf.tmpl @@ -7,7 +7,7 @@ data "aci_{{$.ResourceName}}" "example_{{getResourceName $key $.Definitions}}" { {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name {{- else if eq .SnakeCaseName "t_dn" }}{{$attributeKey := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} {{- range $index, $testParent := $.TestVars.parents }} - {{- if eq $index $parentIndex }}{{$attributeVale := getTestTargetDn $.TestVars.targets $.TestVars.resourceName "" true $testParent.target_classes $index | replace "test" "example" | replace "_0" "" | replace "_1" "_2" }} + {{- if eq $index $parentIndex }}{{$attributeVale := getTestTargetDn $.TestVars.targets $.TestVars.resourceName "" true $testParent.target_classes $index true | replace "test" "example" | replace "_0" "" | replace "_1" "_2" }} {{$attributeKey}} = {{if containsString $attributeVale "."}}{{$attributeVale}}{{else}}"{{$attributeVale}}"{{end}} {{- $parentIndex = add $parentIndex 1 }}{{- break}} {{- end}} diff --git a/gen/templates/datasource_test.go.tmpl b/gen/templates/datasource_test.go.tmpl index 4aed774d4..3daec51a0 100644 --- a/gen/templates/datasource_test.go.tmpl +++ b/gen/templates/datasource_test.go.tmpl @@ -26,7 +26,7 @@ func TestAccDataSource{{$.resourceClassName}}With{{capitalize .class_name}} (t * Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := $.datasource_required}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("data.aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), + resource.TestCheckResourceAttr("data.aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), {{- else }} resource.TestCheckResourceAttr("data.aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{$value}}"), {{- end }} @@ -95,7 +95,7 @@ const testConfig{{$.resourceClassName}}DataSourceDependencyWith{{capitalize .cla data "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}" { parent_dn = {{.parent_dn}} {{- range $key, $value := $.datasource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -110,7 +110,7 @@ data "aci_{{$.resourceName}}" "test_non_existing" { parent_dn = {{.parent_dn}} {{- range $key, $value := $.datasource_non_existing}} {{- if and (eq $key "target_dn") (not (hasPrefix $value "topology/")) }} - {{$key}} = "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}_not_existing" + {{$key}} = "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}_not_existing" {{- else }} {{$key}} = "{{$value}}" {{- end }} @@ -122,7 +122,7 @@ data "aci_{{$.resourceName}}" "test_non_existing" { const testConfig{{.resourceClassName}}DataSource = testConfig{{.resourceClassName}}All + ` data "aci_{{$.resourceName}}" "test" { {{- range $key, $value := $.datasource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true nil 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true nil 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -136,7 +136,7 @@ const testConfig{{$.resourceClassName}}NotExisting = testConfig{{.resourceClassN data "aci_{{$.resourceName}}" "test_non_existing" { {{- range $key, $value := $.datasource_non_existing}} {{- if and (eq $key "target_dn") (not (hasPrefix $value "topology/")) }} - {{$key}} = "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}_not_existing" + {{$key}} = "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}_not_existing" {{- else }} {{$key}} = "{{$value}}" {{- end }} diff --git a/gen/templates/resource_example.tf.tmpl b/gen/templates/resource_example.tf.tmpl index de5513c6e..5d28a8350 100644 --- a/gen/templates/resource_example.tf.tmpl +++ b/gen/templates/resource_example.tf.tmpl @@ -7,7 +7,7 @@ resource "aci_{{$.ResourceName}}" "example_{{getResourceName $key $.Definitions} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name {{- else if eq .SnakeCaseName "t_dn" }}{{$attributeKey := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} {{- range $index, $testParent := $.TestVars.parents }} - {{- if eq $index $parentIndex }}{{$attributeValue := getTestTargetDn $.TestVars.targets $.TestVars.resourceName "" true $testParent.target_classes $index | replace "test" "example" | replace "_0" "" | replace "_1" "_2" }} + {{- if eq $index $parentIndex }}{{$attributeValue := getTestTargetDn $.TestVars.targets $.TestVars.resourceName "" true $testParent.target_classes $index true | replace "test" "example" | replace "_0" "" | replace "_1" "_2" }} {{$attributeKey}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- $parentIndex = add $parentIndex 1 }}{{- break}} {{- end}} diff --git a/gen/templates/resource_example_all_attributes.tf.tmpl b/gen/templates/resource_example_all_attributes.tf.tmpl index f7638df0b..b93280c58 100644 --- a/gen/templates/resource_example_all_attributes.tf.tmpl +++ b/gen/templates/resource_example_all_attributes.tf.tmpl @@ -7,7 +7,7 @@ resource "aci_{{$.ResourceName}}" "full_example_{{getResourceName $key $.Definit {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name {{- else if eq .SnakeCaseName "t_dn" }}{{$attributeKey := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} {{- range $index, $testParent := $.TestVars.parents }} - {{- if eq $index $parentIndex }}{{$attributeVale := getTestTargetDn $.TestVars.targets $.TestVars.resourceName "" true $testParent.target_classes $index | replace "test" "example" | replace "_0" "" | replace "_1" "_2" }} + {{- if eq $index $parentIndex }}{{$attributeVale := getTestTargetDn $.TestVars.targets $.TestVars.resourceName "" true $testParent.target_classes $index true | replace "test" "example" | replace "_0" "" | replace "_1" "_2" }} {{$attributeKey}} = {{if containsString $attributeVale "."}}{{$attributeVale}}{{else}}"{{$attributeVale}}"{{end}} {{- $parentIndex = add $parentIndex 1 }}{{- break}} {{- end}} @@ -24,7 +24,7 @@ resource "aci_{{$.ResourceName}}" "full_example_{{getResourceName $key $.Definit { {{- range .Properties}}{{- if not .ReadOnly }}{{- if ne .NamedPropertyClass ""}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name {{- else if eq .SnakeCaseName "t_dn" }} - {{- range $index, $testParent := $.TestVars.parents }}{{$attributeVale := getTestTargetDn $.TestVars.child_targets $ChildResourceName "target_dn_0" true nil 0 | replace "test_0" "example_2" }} + {{- range $index, $testParent := $.TestVars.parents }}{{$attributeVale := getTestTargetDn $.TestVars.child_targets $ChildResourceName "target_dn_0" true nil 0 true | replace "test_0" "example_2" }} target_dn = {{if containsString $attributeVale "."}}{{$attributeVale}}{{else}}"{{$attributeVale}}"{{end}} {{- break}} {{- end}} @@ -52,7 +52,7 @@ resource "aci_{{$.ResourceName}}" "full_example" { {{$ChildResourceName}} = [ { {{- range .Properties}}{{- if not .ReadOnly }}{{- if ne .NamedPropertyClass ""}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = aci_{{getResourceName .NamedPropertyClass $.Definitions}}.example.name - {{- else if eq .SnakeCaseName "t_dn" }}{{$attributeVale := getTestTargetDn $.TestVars.child_targets $ChildResourceName "target_dn_0" true nil 0 | replace "test_0" "example_2" }} + {{- else if eq .SnakeCaseName "t_dn" }}{{$attributeVale := getTestTargetDn $.TestVars.child_targets $ChildResourceName "target_dn_0" true nil 0 true | replace "test_0" "example_2" }} target_dn = {{if containsString $attributeVale "."}}{{$attributeVale}}{{else}}"{{$attributeVale}}"{{end}} {{- else if .IgnoreInTest}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}} = "{{.IgnoreInTestExampleValue}}" diff --git a/gen/templates/resource_test.go.tmpl b/gen/templates/resource_test.go.tmpl index 0d7ee875b..a9f90f768 100644 --- a/gen/templates/resource_test.go.tmpl +++ b/gen/templates/resource_test.go.tmpl @@ -28,8 +28,8 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes {{- range $key, $value := $.resource_required}}{{$contains := definedInMap $key $.default}} {{- if not $contains}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{$value}}"), resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{$value}}"), @@ -83,8 +83,8 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes {{- range $key, $value := $.resource_required}}{{$contains := definedInMap $key $.default}} {{- if not $contains}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{$value}}"), resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{$value}}"), @@ -125,7 +125,7 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes {{- range $key, $value := $.resource_required}}{{$contains := definedInMap $key $.default}} {{- if not $contains}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{$value}}"), {{- end }} @@ -154,7 +154,7 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes {{- range $key, $value := $.resource_required}}{{$contains := definedInMap $key $.all}} {{- if not $contains}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{$value}}"), {{- end }} @@ -182,7 +182,7 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := $.resource_required}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{$value}}"), {{- end }} @@ -212,7 +212,7 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := $.resource_required}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{$value}}"), {{- end }} @@ -248,7 +248,7 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := $.resource_required}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{$value}}"), {{- end }} @@ -272,7 +272,7 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -319,7 +319,7 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -356,7 +356,7 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes {{- else}} {{- range $child_key, $child_value := $child}} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 0 false}}"), {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.0.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -367,7 +367,7 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes {{- $child := index $value 1 }} {{- range $child_key, $child_value := $child}} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1 false}}"), {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}.0.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -420,7 +420,7 @@ func TestAccResource{{$.resourceClassName}}With{{capitalize .class_name}}(t *tes Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := $.customtype}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false $target_classes 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}", "{{$key}}", "{{$value}}"), {{- end }} @@ -446,8 +446,8 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := $.resource_required}}{{$contains := definedInMap $key $.default}} {{- if not $contains}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{$value}}"), resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{$value}}"), @@ -491,8 +491,8 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := $.resource_required}}{{$contains := definedInMap $key $.default}} {{- if not $contains}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test", "{{$key}}", "{{$value}}"), resource.TestCheckResourceAttr("aci_{{$.resourceName}}.allow_test_2", "{{$key}}", "{{$value}}"), @@ -522,7 +522,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := .resource_required}}{{$contains := definedInMap $key $.default}} {{- if not $contains}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{$value}}"), {{- end }} @@ -550,7 +550,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := .resource_required}}{{$contains := definedInMap $key $.all}} {{- if not $contains}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{$value}}"), {{- end }} @@ -578,7 +578,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $key, $value := .resource_required}}{{$contains := definedInMap $key $.all}} {{- if not $contains}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{$value}}"), {{- end }} @@ -613,7 +613,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := $.resource_required}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{$value}}"), {{- end }} @@ -648,7 +648,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := .min}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{$value}}"), {{- end }} @@ -672,7 +672,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -688,7 +688,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := .min}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{$value}}"), {{- end }} @@ -712,7 +712,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- range $child_index, $child := $value}} {{- range $child_key, $child_value := $child}} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil $child_index false}}"), {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.{{$child_index}}.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -728,7 +728,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := .min}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{$value}}"), {{- end }} @@ -755,7 +755,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- else}} {{- range $child_key, $child_value := $child}} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1 false}}"), {{- else if ne $child_key "deletable_child"}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.0.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -766,7 +766,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { {{- $child := index $value 1 }} {{- range $child_key, $child_value := $child}} {{- if eq $child_key "target_dn"}} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.0.{{$child_key}}", "{{getTestTargetDn $.child_targets $key $child_value false nil 1 false}}"), {{- else}} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}.0.{{$child_key}}", "{{$child_value}}"), {{- end}} @@ -782,7 +782,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := .min}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{$value}}"), {{- end }} @@ -828,7 +828,7 @@ func TestAccResource{{.resourceClassName}}(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( {{- range $key, $value := $.customtype}} {{- if eq $key "target_dn" }} - resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0}}"), + resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{getTestTargetDn $.targets $.resourceName $value false nil 0 false}}"), {{- else }} resource.TestCheckResourceAttr("aci_{{$.resourceName}}.test", "{{$key}}", "{{$value}}"), {{- end }} @@ -886,7 +886,7 @@ const testConfig{{$.resourceClassName}}MinDependencyWith{{capitalize .class_name resource "aci_{{$.resourceName}}" "allow_test" { parent_dn = {{.parent_dn}} {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -896,7 +896,7 @@ resource "aci_{{$.resourceName}}" "allow_test" { resource "aci_{{$.resourceName}}" "allow_test_2" { parent_dn = {{.parent_dn}} {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -910,7 +910,7 @@ const testConfig{{$.resourceClassName}}MinDependencyWith{{capitalize .class_name resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}" { parent_dn = {{.parent_dn}} {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -924,7 +924,7 @@ resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClas parent_dn = {{.parent_dn}} {{- range $key, $value := $.resource_required}}{{$contains := definedInMap $key $.all}} {{- if not $contains}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -950,7 +950,7 @@ resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClas parent_dn = {{.parent_dn}} {{- range $key, $value := $.resource_required}}{{$contains := definedInMap $key $.default}} {{- if not $contains}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -976,7 +976,7 @@ const testConfig{{$.resourceClassName}}ChildrenDependencyWith{{capitalize .class resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}" { parent_dn = {{.parent_dn}} {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -987,7 +987,7 @@ resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClas {{- range $child := $value}} { {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index}} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else if ne $child_key "deletable_child"}} {{$child_key}} = "{{$child_value}}" @@ -1004,7 +1004,7 @@ const testConfig{{$.resourceClassName}}ChildrenRemoveFromConfigDependencyWith{{c resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}" { parent_dn = {{.parent_dn}} {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -1017,7 +1017,7 @@ const testConfig{{$.resourceClassName}}ChildrenRemoveOneDependencyWith{{capitali resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}" { parent_dn = {{.parent_dn}} {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -1033,7 +1033,7 @@ resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClas {{$key}} = [ {{$child := index $value 1 }} { {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil 1}} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil 1 false}} {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$child_key}} = "{{$child_value}}" @@ -1050,7 +1050,7 @@ const testConfig{{$.resourceClassName}}ChildrenRemoveAllDependencyWith{{capitali resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}" { parent_dn = {{.parent_dn}} {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -1075,7 +1075,7 @@ const testConfig{{$.resourceClassName}}CustomTypeDependencyWith{{capitalize .cla resource "aci_{{$.resourceName}}" "test{{- if eq $.resourceClassName $parentClassName }}_1{{- end }}" { parent_dn = {{.parent_dn}} {{- range $key, $value := $.customtype}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true $target_classes 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -1155,7 +1155,7 @@ resource "aci_{{$.resourceName}}" "test" { const testConfig{{.resourceClassName}}Children = {{- if $childDependencies }} testChildDependencyConfig{{$.resourceClassName}} + {{- end }}` resource "aci_{{$.resourceName}}" "test" { {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true nil 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true nil 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -1166,7 +1166,7 @@ resource "aci_{{$.resourceName}}" "test" { {{- range $child := $value}} { {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index}} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil $index false}} {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else if ne $child_key "deletable_child"}} {{$child_key}} = "{{$child_value}}" @@ -1182,7 +1182,7 @@ resource "aci_{{$.resourceName}}" "test" { const testConfig{{.resourceClassName}}ChildrenRemoveFromConfig = {{- if $childDependencies }} testChildDependencyConfig{{$.resourceClassName}} + {{- end }}` resource "aci_{{$.resourceName}}" "test" { {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true nil 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true nil 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -1194,7 +1194,7 @@ resource "aci_{{$.resourceName}}" "test" { const testConfig{{.resourceClassName}}ChildrenRemoveOne = {{- if $childDependencies }} testChildDependencyConfig{{$.resourceClassName}} + {{- end }}` resource "aci_{{$.resourceName}}" "test" { {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true nil 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true nil 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" @@ -1210,7 +1210,7 @@ resource "aci_{{$.resourceName}}" "test" { {{$key}} = [ {{$child := index $value 1 }} { {{- range $child_key, $child_value := $child}} - {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil 1}} + {{- if eq $child_key "target_dn"}}{{$attributeValue := getTestTargetDn $.child_targets $key $child_value true nil 1 false}} {{$child_key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$child_key}} = "{{$child_value}}" @@ -1226,7 +1226,7 @@ resource "aci_{{$.resourceName}}" "test" { const testConfig{{.resourceClassName}}ChildrenRemoveAll = {{- if $childDependencies }} testChildDependencyConfig{{$.resourceClassName}} + {{- end }}` resource "aci_{{$.resourceName}}" "test" { {{- range $key, $value := $.resource_required}} - {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true nil 0}} + {{- if eq $key "target_dn" }}{{$attributeValue := getTestTargetDn $.targets $.resourceName $value true nil 0 false}} {{$key}} = {{if containsString $attributeValue "."}}{{$attributeValue}}{{else}}"{{$attributeValue}}"{{end}} {{- else }} {{$key}} = "{{$value}}" diff --git a/gen/templates/testvars.yaml.tmpl b/gen/templates/testvars.yaml.tmpl index 67244dfbf..16b1b35b1 100644 --- a/gen/templates/testvars.yaml.tmpl +++ b/gen/templates/testvars.yaml.tmpl @@ -143,6 +143,7 @@ targets: - class_name: "{{ .ClassName }}" target_dn: "{{ .TargetDn }}" target_dn_ref: "{{ .TargetDnRef }}" + target_dn_overwrite_docs: "{{ .TargetDnOverwriteDocs }}" parent_dependency: "{{ .ParentDependency}}" parent_dependency_dn_ref: "{{.ParentDependencyDnRef}}" target_resource_name: "{{ .TargetResourceName }}" @@ -160,6 +161,7 @@ child_targets: {{- range .ChildTestDependencies }} - class_name: "{{ .ClassName }}" target_dn: "{{ .TargetDn }}" + target_dn_overwrite_docs: "{{ .TargetDnOverwriteDocs }}" relation_resource_name: "{{ .RelationResourceName }}" static: {{ .Static }} {{- if not .Static}} diff --git a/gen/testvars/fvAEPg.yaml b/gen/testvars/fvAEPg.yaml index 0dfc712bc..373ab7a34 100644 --- a/gen/testvars/fvAEPg.yaml +++ b/gen/testvars/fvAEPg.yaml @@ -248,38 +248,47 @@ parents: child_targets: - class_name: "vmmDomP" target_dn: "uni/vmmp-VMware/dom-domain_1" + target_dn_overwrite_docs: "" relation_resource_name: "domain" static: true - class_name: "vmmDomP" target_dn: "uni/vmmp-VMware/dom-domain_2" + target_dn_overwrite_docs: "" relation_resource_name: "domain" static: true - class_name: "fabricPathEp" target_dn: "topology/pod-1/paths-101/pathep-[eth1/1]" + target_dn_overwrite_docs: "" relation_resource_name: "fibre_channel_path" static: true - class_name: "fabricPathEp" target_dn: "topology/pod-1/paths-101/pathep-[eth1/2]" + target_dn_overwrite_docs: "" relation_resource_name: "fibre_channel_path" static: true - class_name: "fabricNode" target_dn: "topology/pod-1/node-101" + target_dn_overwrite_docs: "" relation_resource_name: "static_leaf" static: true - class_name: "fabricNode" target_dn: "topology/pod-1/node-102" + target_dn_overwrite_docs: "" relation_resource_name: "static_leaf" static: true - class_name: "fabricPathEp" target_dn: "topology/pod-1/paths-101/pathep-[eth1/1]" + target_dn_overwrite_docs: "" relation_resource_name: "static_path" static: true - class_name: "fabricPathEp" target_dn: "topology/pod-1/paths-101/pathep-[eth1/2]" + target_dn_overwrite_docs: "" relation_resource_name: "static_path" static: true - class_name: "fvAEPg" target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_2" + target_dn_overwrite_docs: "" relation_resource_name: "contract_master" static: false target_dn_ref: "aci_application_epg.test_application_epg_0.id" @@ -291,6 +300,7 @@ child_targets: name: "epg_2" - class_name: "fvAEPg" target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_3" + target_dn_overwrite_docs: "" relation_resource_name: "contract_master" static: false target_dn_ref: "aci_application_epg.test_application_epg_1.id" diff --git a/gen/testvars/fvESg.yaml b/gen/testvars/fvESg.yaml index b810f0f49..4d0c89a50 100644 --- a/gen/testvars/fvESg.yaml +++ b/gen/testvars/fvESg.yaml @@ -105,6 +105,7 @@ parents: child_targets: - class_name: "fvESg" target_dn: "uni/tn-test_tenant/ap-test_ap/esg-esg_0" + target_dn_overwrite_docs: "" relation_resource_name: "contract_master" static: false target_dn_ref: "aci_endpoint_security_group.test_endpoint_security_group_0.id" @@ -116,6 +117,7 @@ child_targets: name: "esg_0" - class_name: "fvESg" target_dn: "uni/tn-test_tenant/ap-test_ap/esg-esg_1" + target_dn_overwrite_docs: "" relation_resource_name: "contract_master" static: false target_dn_ref: "aci_endpoint_security_group.test_endpoint_security_group_1.id" diff --git a/gen/testvars/fvRsDomAtt.yaml b/gen/testvars/fvRsDomAtt.yaml index fe6e2c78d..3dc9b8323 100644 --- a/gen/testvars/fvRsDomAtt.yaml +++ b/gen/testvars/fvRsDomAtt.yaml @@ -85,6 +85,7 @@ targets: - class_name: "vmmDomP" target_dn: "uni/vmmp-VMware/dom-domain_1" target_dn_ref: "aci_vmm_domain.test_vmm_domain_0.id" + target_dn_overwrite_docs: "" parent_dependency: "" parent_dependency_dn_ref: "" target_resource_name: "vmm_domain" @@ -95,6 +96,7 @@ targets: - class_name: "vmmDomP" target_dn: "uni/vmmp-VMware/dom-domain_2" target_dn_ref: "aci_vmm_domain.test_vmm_domain_1.id" + target_dn_overwrite_docs: "" parent_dependency: "" parent_dependency_dn_ref: "" target_resource_name: "vmm_domain" diff --git a/gen/testvars/fvRsFcPathAtt.yaml b/gen/testvars/fvRsFcPathAtt.yaml index 9a414bb3b..df906036c 100644 --- a/gen/testvars/fvRsFcPathAtt.yaml +++ b/gen/testvars/fvRsFcPathAtt.yaml @@ -49,6 +49,7 @@ targets: - class_name: "fabricPathEp" target_dn: "topology/pod-1/paths-101/pathep-[eth1/1]" target_dn_ref: "aci_.test__0.id" + target_dn_overwrite_docs: "" parent_dependency: "" parent_dependency_dn_ref: "" target_resource_name: "" @@ -59,6 +60,7 @@ targets: - class_name: "fabricPathEp" target_dn: "topology/pod-1/paths-101/pathep-[eth1/2]" target_dn_ref: "aci_.test__1.id" + target_dn_overwrite_docs: "" parent_dependency: "" parent_dependency_dn_ref: "" target_resource_name: "" diff --git a/gen/testvars/fvRsNodeAtt.yaml b/gen/testvars/fvRsNodeAtt.yaml index 547d2734d..eb63e4a40 100644 --- a/gen/testvars/fvRsNodeAtt.yaml +++ b/gen/testvars/fvRsNodeAtt.yaml @@ -52,6 +52,7 @@ targets: - class_name: "fabricNode" target_dn: "topology/pod-1/node-101" target_dn_ref: "aci_.test__0.id" + target_dn_overwrite_docs: "" parent_dependency: "" parent_dependency_dn_ref: "" target_resource_name: "" @@ -62,6 +63,7 @@ targets: - class_name: "fabricNode" target_dn: "topology/pod-1/node-102" target_dn_ref: "aci_.test__1.id" + target_dn_overwrite_docs: "" parent_dependency: "" parent_dependency_dn_ref: "" target_resource_name: "" diff --git a/gen/testvars/fvRsPathAtt.yaml b/gen/testvars/fvRsPathAtt.yaml index b6f771a74..cdd62d8c0 100644 --- a/gen/testvars/fvRsPathAtt.yaml +++ b/gen/testvars/fvRsPathAtt.yaml @@ -54,6 +54,7 @@ targets: - class_name: "fabricPathEp" target_dn: "topology/pod-1/paths-101/pathep-[eth1/1]" target_dn_ref: "aci_.test__0.id" + target_dn_overwrite_docs: "" parent_dependency: "" parent_dependency_dn_ref: "" target_resource_name: "" @@ -64,6 +65,7 @@ targets: - class_name: "fabricPathEp" target_dn: "topology/pod-1/paths-101/pathep-[eth1/2]" target_dn_ref: "aci_.test__1.id" + target_dn_overwrite_docs: "" parent_dependency: "" parent_dependency_dn_ref: "" target_resource_name: "" diff --git a/gen/testvars/fvRsSecInherited.yaml b/gen/testvars/fvRsSecInherited.yaml index 1da67d6d7..aa0c87547 100644 --- a/gen/testvars/fvRsSecInherited.yaml +++ b/gen/testvars/fvRsSecInherited.yaml @@ -49,6 +49,7 @@ targets: - class_name: "fvESg" target_dn: "uni/tn-test_tenant/ap-test_ap/esg-esg_0" target_dn_ref: "aci_endpoint_security_group.test_endpoint_security_group_0.id" + target_dn_overwrite_docs: "" parent_dependency: "fvAp" parent_dependency_dn_ref: "aci_application_profile.test.id" target_resource_name: "endpoint_security_group" @@ -60,6 +61,7 @@ targets: - class_name: "fvESg" target_dn: "uni/tn-test_tenant/ap-test_ap/esg-esg_1" target_dn_ref: "aci_endpoint_security_group.test_endpoint_security_group_1.id" + target_dn_overwrite_docs: "" parent_dependency: "fvAp" parent_dependency_dn_ref: "aci_application_profile.test.id" target_resource_name: "endpoint_security_group" @@ -71,6 +73,7 @@ targets: - class_name: "fvAEPg" target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_2" target_dn_ref: "aci_application_epg.test_application_epg_0.id" + target_dn_overwrite_docs: "" parent_dependency: "fvAp" parent_dependency_dn_ref: "aci_application_profile.test.id" target_resource_name: "application_epg" @@ -82,6 +85,7 @@ targets: - class_name: "fvAEPg" target_dn: "uni/tn-test_tenant/ap-test_ap/epg-epg_3" target_dn_ref: "aci_application_epg.test_application_epg_1.id" + target_dn_overwrite_docs: "" parent_dependency: "fvAp" parent_dependency_dn_ref: "aci_application_profile.test.id" target_resource_name: "application_epg" diff --git a/gen/testvars/infraHPathS.yaml b/gen/testvars/infraHPathS.yaml index 762f04161..a5cd9e753 100644 --- a/gen/testvars/infraHPathS.yaml +++ b/gen/testvars/infraHPathS.yaml @@ -52,9 +52,11 @@ parents: child_targets: - class_name: "fabricPathEp" target_dn: "topology/pod-1/paths-101/pathep-[eth1/1]" + target_dn_overwrite_docs: "" relation_resource_name: "host_path" static: true - class_name: "infraAccPortGrp" target_dn: "uni/infra/funcprof/accportgrp-access_interface_policy_group" + target_dn_overwrite_docs: "" relation_resource_name: "access_interface_policy_group" static: true diff --git a/gen/testvars/l3extRsOutToFBRGroup.yaml b/gen/testvars/l3extRsOutToFBRGroup.yaml index 9cfd276e2..15db2865c 100644 --- a/gen/testvars/l3extRsOutToFBRGroup.yaml +++ b/gen/testvars/l3extRsOutToFBRGroup.yaml @@ -43,6 +43,7 @@ targets: - class_name: "fvFBRGroup" target_dn: "uni/tn-test_tenant/ctx-test_vrf/fbrg-vrf_fallback_route_group_0" target_dn_ref: "aci_vrf_fallback_route_group.test_vrf_fallback_route_group_0.id" + target_dn_overwrite_docs: "" parent_dependency: "fvCtx" parent_dependency_dn_ref: "aci_vrf.test.id" target_resource_name: "vrf_fallback_route_group" diff --git a/gen/testvars/netflowExporterPol.yaml b/gen/testvars/netflowExporterPol.yaml index ed4f6fb22..51d30897d 100644 --- a/gen/testvars/netflowExporterPol.yaml +++ b/gen/testvars/netflowExporterPol.yaml @@ -78,9 +78,11 @@ parents: child_targets: - class_name: "fvCtx" target_dn: "uni/tn-test_tenant/ctx-test_vrf" + target_dn_overwrite_docs: "aci_vrf.example.id" relation_resource_name: "vrf" static: true - class_name: "fvAEPg" target_dn: "uni/tn-test_tenant/ap-test_ap/epg-test_epg" + target_dn_overwrite_docs: "aci_application_epg.example.id" relation_resource_name: "epg" static: true