diff --git a/gen/templates/resource_test.go.tmpl b/gen/templates/resource_test.go.tmpl index 789be270b..b0a05ee5a 100644 --- a/gen/templates/resource_test.go.tmpl +++ b/gen/templates/resource_test.go.tmpl @@ -613,7 +613,10 @@ resource "aci_{{$.resourceName}}" "test" { {{- range $child := $value}} { {{- range $child_key, $child_value := $child}} - {{- if ne $child_key "deletable_child"}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildren" $newCtx }} + {{- else if ne $child_key "deletable_child"}} {{$child_key}} = "{{$child_value}}" {{- end}} {{- end}} @@ -648,21 +651,23 @@ resource "aci_{{$.resourceName}}" "test" { {{- end }} {{- end}} {{- range $key, $value := $.children}} - {{- if eq (len $value) 1}} - {{- $child := index $value 0}} - {{- if $child.deletable_child}} - {{$key}} = [] - {{- end}} - {{- else}} - {{$key}} = [ {{$child := index $value 1 }} - { - {{- range $child_key, $child_value := $child}} + {{$key}} = [ + {{- range $index, $child := $value}} + {{- if or (ne $index 0) (and (eq $index 0) (not $child.deletable_child)) }} + { + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildrenRemoveOne" $newCtx }} + {{- else if ne $child_key "deletable_child"}} {{$child_key}} = "{{$child_value}}" {{- end}} - }, + {{- end}} + }, + {{- end}} + {{- end}} ] - {{- end}} - {{- end}} +{{- end}} } ` @@ -677,15 +682,23 @@ resource "aci_{{$.resourceName}}" "test" { {{- end }} {{- end}} {{- range $key, $value := $.children}} - {{- if eq (len $value) 1}} - {{- $child := index $value 0}} - {{- if $child.deletable_child}} - {{$key}} = [] - {{- end}} - {{- else}} - {{$key}} = [] + {{$key}} = [ + {{- range $index, $child := $value}} + {{- if not $child.deletable_child }} + { + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildrenRemoveAll" $newCtx }} + {{- else if ne $child_key "deletable_child"}} + {{$child_key}} = "{{$child_value}}" {{- end}} - {{- end}} + {{- end}} + }, + {{- end}} + {{- end}} + ] + {{- end}} } ` {{- end}} @@ -765,14 +778,20 @@ resource "aci_{{$.resourceName}}" "test" { {{- end}} {{- range $key, $value := $.children}} {{$key}} = [ - {{- if gt (len $value) 1}} - {{$child := index $value 1}} + {{- range $index, $child := $value}} + {{- if or (ne $index 0) (and (eq $index 0) (not $child.deletable_child)) }} { {{- range $child_key, $child_value := $child}} - {{$child_key}} = "{{$child_value}}" + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildrenRemoveOne" $newCtx }} + {{- else if ne $child_key "deletable_child"}} + {{$child_key}} = "{{$child_value}}" + {{- end}} {{- end}} }, - {{- end}} + {{- end}} + {{- end}} ] {{- end}} } @@ -784,8 +803,23 @@ resource "aci_{{$.resourceName}}" "test" { {{$key}} = "{{$value}}" {{- end}} {{- range $key, $value := $.children}} - {{$key}} = [] - {{- end}} + {{$key}} = [ + {{- range $index, $child := $value}} + {{- if not $child.deletable_child }} + { + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" " " -}} + {{- template "nestedChildrenRemoveAll" $newCtx }} + {{- else if ne $child_key "deletable_child"}} + {{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + }, + {{- end}} + {{- end}} + ] + {{- end}} } ` @@ -812,4 +846,50 @@ resource "aci_{{$.resourceName}}" "test" { {{- end}} {{$indent}}] {{- end}} +{{- end}} + +{{/* A sub template for including nested children by removing only one child that is deletable. */}} +{{- define "nestedChildrenRemoveOne" -}} + {{- $indent := .TemplateProperties.Indent -}} + {{- range $key, $value := .childValue}} + {{$indent}}{{$key}} = [ + {{- range $index, $child := $value}} + {{- if or (ne $index 0) (and (eq $index 0) (not $child.deletable_child)) }} + {{$indent}}{ + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" (print $indent " ") -}} + {{- template "nestedChildrenRemoveOne" $newCtx }} + {{- else if ne $child_key "deletable_child"}} + {{$indent}}{{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{$indent}}}, + {{- end}} + {{- end}} + {{$indent}}] +{{- end}} +{{- end}} + +{{/* A sub template for including nested children by removing all deletable children. */}} +{{- define "nestedChildrenRemoveAll" -}} + {{- $indent := .TemplateProperties.Indent -}} + {{- range $key, $value := .childValue}} + {{$indent}}{{$key}} = [ + {{- range $index, $child := $value}} + {{- if not $child.deletable_child }} + {{$indent}}{ + {{- range $child_key, $child_value := $child}} + {{- if eq $child_key "children"}} + {{- $newCtx := addToChild $child_value "Indent" (print $indent " ") -}} + {{- template "nestedChildrenRemoveAll" $newCtx }} + {{- else if ne $child_key "deletable_child"}} + {{$indent}}{{$child_key}} = "{{$child_value}}" + {{- end}} + {{- end}} + {{$indent}}}, + {{- end}} + {{- end}} + {{$indent}}] +{{- end}} {{- end}} \ No newline at end of file diff --git a/gen/templates/testvars.yaml.tmpl b/gen/templates/testvars.yaml.tmpl index 95ae78494..dd10ff2cd 100644 --- a/gen/templates/testvars.yaml.tmpl +++ b/gen/templates/testvars.yaml.tmpl @@ -113,9 +113,20 @@ targets: {{- $enteredPropertiesZone1 := false }} {{ $indent }}- {{ range .Properties}}{{- if $enteredPropertiesZone1 }}{{ $indent }}{{- else}}{{- $enteredPropertiesZone1 = true }}{{- end}}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: {{$length := len .ValidValues}}{{if ne $length 0}}"{{ index .ValidValues 0 }}"{{else if not .IsNaming}}"{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}_1"{{- else}}"{{lookupChildTestValue .PkgName $.ResourceName .SnakeCaseName $.TestVars 0 $.Definitions}}"{{- end}} {{ end}} + {{- if $child_deletable -}} + {{ $indent }}deletable_child: true + {{- else -}} + {{ $indent }}deletable_child: false + {{ end}} {{- $enteredPropertiesZone2 := false }} {{ $indent }}- {{ range .Properties}}{{- if $enteredPropertiesZone2 }}{{ $indent }}{{- else}}{{- $enteredPropertiesZone2 = true }}{{- end}}{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: {{$length := len .ValidValues}}{{if ge $length 2}}"{{ index .ValidValues 1 }}"{{else if not .IsNaming}}"{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}_2"{{- else}}"{{lookupChildTestValue .PkgName $.ResourceName .SnakeCaseName $.TestVars 1 $.Definitions}}"{{- end}} - {{ end}}{{- end}} + {{ end}} + {{- if $child_deletable -}} + {{ $indent }}deletable_child: true + {{- else -}} + {{ $indent }}deletable_child: false + {{ end}} + {{- end}} {{- $enteredGrandChildZone := false }} {{- range .Children}} {{- if not $enteredGrandChildZone }} diff --git a/gen/testvars/commPol.yaml b/gen/testvars/commPol.yaml index e2ef9c941..f4d5678b6 100644 --- a/gen/testvars/commPol.yaml +++ b/gen/testvars/commPol.yaml @@ -62,17 +62,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true key_ring: - annotation: "annotation_1" tn_pki_key_ring_name: "tn_pki_key_ring_name_1" @@ -82,45 +82,45 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true diff --git a/gen/testvars/fvEpIpTag.yaml b/gen/testvars/fvEpIpTag.yaml index ddf3a5b44..095a2670c 100644 --- a/gen/testvars/fvEpIpTag.yaml +++ b/gen/testvars/fvEpIpTag.yaml @@ -30,17 +30,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "fvTenant" parent_dependency: "" diff --git a/gen/testvars/fvEpMacTag.yaml b/gen/testvars/fvEpMacTag.yaml index d86a849d4..0cbf94c56 100644 --- a/gen/testvars/fvEpMacTag.yaml +++ b/gen/testvars/fvEpMacTag.yaml @@ -30,17 +30,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "fvTenant" parent_dependency: "" diff --git a/gen/testvars/fvFBRGroup.yaml b/gen/testvars/fvFBRGroup.yaml index d76ad44a4..4014b0043 100644 --- a/gen/testvars/fvFBRGroup.yaml +++ b/gen/testvars/fvFBRGroup.yaml @@ -28,42 +28,42 @@ children: name: "name_1" name_alias: "name_alias_1" fallback_member: "2.2.2.2" - + deletable_child: true - annotation: "annotation_2" description: "description_2" name: "name_2" name_alias: "name_alias_2" fallback_member: "2.2.2.3" - + deletable_child: true children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "fvCtx" parent_dependency: "fvTenant" diff --git a/gen/testvars/fvFBRMember.yaml b/gen/testvars/fvFBRMember.yaml index 2e5ab882f..74b03e842 100644 --- a/gen/testvars/fvFBRMember.yaml +++ b/gen/testvars/fvFBRMember.yaml @@ -27,17 +27,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "fvFBRGroup" parent_dependency: "fvCtx" diff --git a/gen/testvars/l3extConsLbl.yaml b/gen/testvars/l3extConsLbl.yaml index fa89a9f82..fbc2dbb2c 100644 --- a/gen/testvars/l3extConsLbl.yaml +++ b/gen/testvars/l3extConsLbl.yaml @@ -33,17 +33,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "l3extOut" parent_dependency: "" diff --git a/gen/testvars/l3extProvLbl.yaml b/gen/testvars/l3extProvLbl.yaml index cf5d6be02..a1d05a147 100644 --- a/gen/testvars/l3extProvLbl.yaml +++ b/gen/testvars/l3extProvLbl.yaml @@ -31,17 +31,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "l3extOut" parent_dependency: "fvTenant" diff --git a/gen/testvars/l3extRsOutToFBRGroup.yaml b/gen/testvars/l3extRsOutToFBRGroup.yaml index 4aa03a0ed..1c4e1f32d 100644 --- a/gen/testvars/l3extRsOutToFBRGroup.yaml +++ b/gen/testvars/l3extRsOutToFBRGroup.yaml @@ -21,17 +21,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "l3extOut" parent_dependency: "fvTenant" diff --git a/gen/testvars/l3extRsRedistributePol.yaml b/gen/testvars/l3extRsRedistributePol.yaml index 775eb2974..b0938f28b 100644 --- a/gen/testvars/l3extRsRedistributePol.yaml +++ b/gen/testvars/l3extRsRedistributePol.yaml @@ -26,17 +26,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "l3extOut" parent_dependency: "fvTenant" diff --git a/gen/testvars/mgmtInstP.yaml b/gen/testvars/mgmtInstP.yaml index 559715152..e0766074e 100644 --- a/gen/testvars/mgmtInstP.yaml +++ b/gen/testvars/mgmtInstP.yaml @@ -28,40 +28,40 @@ children: - annotation: "annotation_1" priority: "level1" out_of_band_contract_name: "out_of_band_contract_name_0" - + deletable_child: true - annotation: "annotation_2" priority: "level2" out_of_band_contract_name: "out_of_band_contract_name_1" - + deletable_child: true children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true diff --git a/gen/testvars/mgmtRsOoBCons.yaml b/gen/testvars/mgmtRsOoBCons.yaml index cc689e5c0..44ef3bca5 100644 --- a/gen/testvars/mgmtRsOoBCons.yaml +++ b/gen/testvars/mgmtRsOoBCons.yaml @@ -23,17 +23,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "mgmtInstP" parent_dependency: "" diff --git a/gen/testvars/mgmtSubnet.yaml b/gen/testvars/mgmtSubnet.yaml index 034b37134..7fa94d6d8 100644 --- a/gen/testvars/mgmtSubnet.yaml +++ b/gen/testvars/mgmtSubnet.yaml @@ -27,17 +27,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "mgmtInstP" parent_dependency: "" diff --git a/gen/testvars/mplsNodeSidP.yaml b/gen/testvars/mplsNodeSidP.yaml index 7c5473c56..7e033a56c 100644 --- a/gen/testvars/mplsNodeSidP.yaml +++ b/gen/testvars/mplsNodeSidP.yaml @@ -29,17 +29,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "l3extLoopBackIfP" parent_dependency: "l3extRsNodeL3OutAtt" diff --git a/gen/testvars/netflowMonitorPol.yaml b/gen/testvars/netflowMonitorPol.yaml index 37f9e3a02..dac799c08 100644 --- a/gen/testvars/netflowMonitorPol.yaml +++ b/gen/testvars/netflowMonitorPol.yaml @@ -29,25 +29,25 @@ children: relation_to_netflow_exporters: - annotation: "annotation_1" netflow_exporter_policy_name: "netflow_exporter_policy_name_0" - + deletable_child: true - annotation: "annotation_2" netflow_exporter_policy_name: "netflow_exporter_policy_name_1" - + deletable_child: true children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true relation_to_netflow_record: - annotation: "annotation_1" netflow_record_policy_name: "netflow_record_policy_name_1" @@ -57,31 +57,31 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "fvTenant" parent_dependency: "" diff --git a/gen/testvars/netflowRsMonitorToExporter.yaml b/gen/testvars/netflowRsMonitorToExporter.yaml index d429e297f..900f1a246 100644 --- a/gen/testvars/netflowRsMonitorToExporter.yaml +++ b/gen/testvars/netflowRsMonitorToExporter.yaml @@ -21,17 +21,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "netflowMonitorPol" parent_dependency: "fvTenant" diff --git a/gen/testvars/pimRouteMapEntry.yaml b/gen/testvars/pimRouteMapEntry.yaml index 4b4d055d9..0a6122f7e 100644 --- a/gen/testvars/pimRouteMapEntry.yaml +++ b/gen/testvars/pimRouteMapEntry.yaml @@ -35,17 +35,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "pimRouteMapPol" parent_dependency: "fvTenant" diff --git a/gen/testvars/pimRouteMapPol.yaml b/gen/testvars/pimRouteMapPol.yaml index 560c67e84..78b362ce0 100644 --- a/gen/testvars/pimRouteMapPol.yaml +++ b/gen/testvars/pimRouteMapPol.yaml @@ -29,17 +29,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true parents: - class_name: "fvTenant" parent_dependency: "" diff --git a/gen/testvars/vzOOBBrCP.yaml b/gen/testvars/vzOOBBrCP.yaml index 4c6d23c3f..16820b042 100644 --- a/gen/testvars/vzOOBBrCP.yaml +++ b/gen/testvars/vzOOBBrCP.yaml @@ -37,17 +37,17 @@ children: annotations: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true tags: - key: "key_0" value: "value_1" - + deletable_child: true - key: "key_1" value: "value_2" - + deletable_child: true diff --git a/internal/provider/resource_aci_communication_policy_test.go b/internal/provider/resource_aci_communication_policy_test.go index 6d49e19e6..db3752da7 100644 --- a/internal/provider/resource_aci_communication_policy_test.go +++ b/internal/provider/resource_aci_communication_policy_test.go @@ -102,7 +102,7 @@ func TestAccResourceCommPol(t *testing.T) { resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.access_control_allow_origins", "access_control_allow_origins_1"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.admin_st", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] key_ring:[map[annotation:annotation_1 children:map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]] deletable_child:false tn_pki_key_ring_name:tn_pki_key_ring_name_1]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tp:[map[annotation:annotation_1 children:map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]] deletable_child:true target_dn:target_dn_1]]]"), + resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] key_ring:[map[annotation:annotation_1 children:map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]] deletable_child:false tn_pki_key_ring_name:tn_pki_key_ring_name_1]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tp:[map[annotation:annotation_1 children:map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]] deletable_child:true target_dn:target_dn_1]]]"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.cli_only_mode", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.client_cert_auth_state", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.description", "description_1"), @@ -148,7 +148,7 @@ func TestAccResourceCommPol(t *testing.T) { resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.access_control_allow_origins", "access_control_allow_origins_1"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.admin_st", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] key_ring:[map[annotation:annotation_1 children:map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]] deletable_child:false tn_pki_key_ring_name:tn_pki_key_ring_name_1]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tp:[map[annotation:annotation_1 children:map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]] deletable_child:true target_dn:target_dn_1]]]"), + resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] key_ring:[map[annotation:annotation_1 children:map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]] deletable_child:false tn_pki_key_ring_name:tn_pki_key_ring_name_1]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tp:[map[annotation:annotation_1 children:map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]] deletable_child:true target_dn:target_dn_1]]]"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.cli_only_mode", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.client_cert_auth_state", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.description", "description_1"), @@ -185,6 +185,7 @@ func TestAccResourceCommPol(t *testing.T) { resource.TestCheckResourceAttr("aci_communication_policy.test", "owner_key", ""), resource.TestCheckResourceAttr("aci_communication_policy.test", "owner_tag", ""), resource.TestCheckResourceAttr("aci_communication_policy.test", "strict_security_on_apic_oob_subnet", "false"), + resource.TestCheckResourceAttr("aci_communication_policy.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_communication_policy.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_communication_policy.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_communication_policy.test", "annotations.#", "1"), @@ -192,7 +193,7 @@ func TestAccResourceCommPol(t *testing.T) { resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.access_control_allow_origins", "access_control_allow_origins_1"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.admin_st", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] key_ring:[map[annotation:annotation_1 children:map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]] deletable_child:false tn_pki_key_ring_name:tn_pki_key_ring_name_1]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tp:[map[annotation:annotation_1 children:map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]] deletable_child:true target_dn:target_dn_1]]]"), + resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] key_ring:[map[annotation:annotation_1 children:map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]] deletable_child:false tn_pki_key_ring_name:tn_pki_key_ring_name_1]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tp:[map[annotation:annotation_1 children:map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]] deletable_child:true target_dn:target_dn_1]]]"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.cli_only_mode", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.client_cert_auth_state", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.description", "description_1"), @@ -212,6 +213,7 @@ func TestAccResourceCommPol(t *testing.T) { resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.throttle_st", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.visore_access", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.#", "1"), + resource.TestCheckResourceAttr("aci_communication_policy.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_communication_policy.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_communication_policy.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_communication_policy.test", "tags.#", "1"), @@ -232,7 +234,7 @@ func TestAccResourceCommPol(t *testing.T) { resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.access_control_allow_origins", "access_control_allow_origins_1"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.admin_st", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] key_ring:[map[annotation:annotation_1 children:map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]] deletable_child:false tn_pki_key_ring_name:tn_pki_key_ring_name_1]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tp:[map[annotation:annotation_1 children:map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]] deletable_child:true target_dn:target_dn_1]]]"), + resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] key_ring:[map[annotation:annotation_1 children:map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]] deletable_child:false tn_pki_key_ring_name:tn_pki_key_ring_name_1]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tp:[map[annotation:annotation_1 children:map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]] deletable_child:true target_dn:target_dn_1]]]"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.cli_only_mode", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.client_cert_auth_state", "disabled"), resource.TestCheckResourceAttr("aci_communication_policy.test", "http_ssl_configuration.0.description", "description_1"), @@ -422,19 +424,73 @@ const testConfigCommPolChildrenRemoveOne = ` resource "aci_communication_policy" "test" { name = "test_name" annotations = [ - { - key = "key_1" - value = "value_2" + key = "key_1" + value = "value_2" }, ] http_ssl_configuration = [ + { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_st = "disabled" + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "value_2" + }, + ] + key_ring = [ + { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "value_2" + }, + ] + tags = [ + { + key = "key_1" + value = "value_2" + }, + ] + tn_pki_key_ring_name = "tn_pki_key_ring_name_1" + }, + ] + tags = [ + { + key = "key_1" + value = "value_2" + }, + ] + tp = [ + ] + cli_only_mode = "disabled" + client_cert_auth_state = "disabled" + description = "description_1" + dh_param = "1024" + global_throttle_rate = "global_throttle_rate_1" + global_throttle_st = "disabled" + global_throttle_unit = "global_throttle_unit_1" + max_request_status_count = "max_request_status_count_1" + name = "name_1" + name_alias = "name_alias_1" + node_exporter = "disabled" + port = "port_1" + referer = "referer_1" + server_header = "disabled" + ssl_protocols = "TLSv1" + throttle_rate = "throttle_rate_1" + throttle_st = "disabled" + visore_access = "disabled" + }, ] tags = [ - { - key = "key_1" - value = "value_2" + key = "key_1" + value = "value_2" }, ] } @@ -443,8 +499,51 @@ resource "aci_communication_policy" "test" { const testConfigCommPolChildrenRemoveAll = ` resource "aci_communication_policy" "test" { name = "test_name" - annotations = [] - http_ssl_configuration = [] - tags = [] + annotations = [ + ] + http_ssl_configuration = [ + { + access_control_allow_credential = "disabled" + access_control_allow_origins = "access_control_allow_origins_1" + admin_st = "disabled" + annotation = "annotation_1" + annotations = [ + ] + key_ring = [ + { + annotation = "annotation_1" + annotations = [ + ] + tags = [ + ] + tn_pki_key_ring_name = "tn_pki_key_ring_name_1" + }, + ] + tags = [ + ] + tp = [ + ] + cli_only_mode = "disabled" + client_cert_auth_state = "disabled" + description = "description_1" + dh_param = "1024" + global_throttle_rate = "global_throttle_rate_1" + global_throttle_st = "disabled" + global_throttle_unit = "global_throttle_unit_1" + max_request_status_count = "max_request_status_count_1" + name = "name_1" + name_alias = "name_alias_1" + node_exporter = "disabled" + port = "port_1" + referer = "referer_1" + server_header = "disabled" + ssl_protocols = "TLSv1" + throttle_rate = "throttle_rate_1" + throttle_st = "disabled" + visore_access = "disabled" + }, + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_endpoint_tag_ip_test.go b/internal/provider/resource_aci_endpoint_tag_ip_test.go index ca8f2a19f..433ddc625 100644 --- a/internal/provider/resource_aci_endpoint_tag_ip_test.go +++ b/internal/provider/resource_aci_endpoint_tag_ip_test.go @@ -143,9 +143,11 @@ func TestAccResourceFvEpIpTagWithFvTenant(t *testing.T) { Config: testConfigFvEpIpTagChildrenRemoveOneDependencyWithFvTenant, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_endpoint_tag_ip.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_endpoint_tag_ip.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_endpoint_tag_ip.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_endpoint_tag_ip.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_endpoint_tag_ip.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_endpoint_tag_ip.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_endpoint_tag_ip.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_endpoint_tag_ip.test", "tags.#", "1"), @@ -236,17 +238,17 @@ resource "aci_endpoint_tag_ip" "test" { parent_dn = aci_tenant.test.id ip = "10.0.0.2" vrf_name = "test_ctx_name" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -256,7 +258,9 @@ resource "aci_endpoint_tag_ip" "test" { parent_dn = aci_tenant.test.id ip = "10.0.0.2" vrf_name = "test_ctx_name" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_endpoint_tag_mac_test.go b/internal/provider/resource_aci_endpoint_tag_mac_test.go index 5dd5781ef..c8d3bb6a3 100644 --- a/internal/provider/resource_aci_endpoint_tag_mac_test.go +++ b/internal/provider/resource_aci_endpoint_tag_mac_test.go @@ -143,9 +143,11 @@ func TestAccResourceFvEpMacTagWithFvTenant(t *testing.T) { Config: testConfigFvEpMacTagChildrenRemoveOneDependencyWithFvTenant, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_endpoint_tag_mac.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_endpoint_tag_mac.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_endpoint_tag_mac.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_endpoint_tag_mac.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_endpoint_tag_mac.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_endpoint_tag_mac.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_endpoint_tag_mac.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_endpoint_tag_mac.test", "tags.#", "1"), @@ -236,17 +238,17 @@ resource "aci_endpoint_tag_mac" "test" { parent_dn = aci_tenant.test.id bd_name = "test_bd_name" mac = "00:00:00:00:00:01" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -256,7 +258,9 @@ resource "aci_endpoint_tag_mac" "test" { parent_dn = aci_tenant.test.id bd_name = "test_bd_name" mac = "00:00:00:00:00:01" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_external_management_network_instance_profile_test.go b/internal/provider/resource_aci_external_management_network_instance_profile_test.go index 521e16644..7eaaa5115 100644 --- a/internal/provider/resource_aci_external_management_network_instance_profile_test.go +++ b/internal/provider/resource_aci_external_management_network_instance_profile_test.go @@ -90,7 +90,7 @@ func TestAccResourceMgmtInstP(t *testing.T) { resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.out_of_band_contract_name", "out_of_band_contract_name_0"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.priority", "level1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.out_of_band_contract_name", "out_of_band_contract_name_1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.#", "2"), @@ -118,7 +118,7 @@ func TestAccResourceMgmtInstP(t *testing.T) { resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.out_of_band_contract_name", "out_of_band_contract_name_0"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.priority", "level1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.out_of_band_contract_name", "out_of_band_contract_name_1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.1.priority", "level2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.#", "2"), @@ -137,14 +137,17 @@ func TestAccResourceMgmtInstP(t *testing.T) { resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "description", ""), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "name_alias", ""), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "priority", "unspecified"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "annotations.#", "1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.out_of_band_contract_name", "out_of_band_contract_name_1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.0.priority", "level2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "relation_to_consumed_out_of_band_contracts.#", "1"), + resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_external_management_network_instance_profile.test", "tags.#", "1"), @@ -260,26 +263,34 @@ const testConfigMgmtInstPChildrenRemoveOne = ` resource "aci_external_management_network_instance_profile" "test" { name = "test_name" annotations = [ - { - key = "key_1" - value = "value_2" + key = "key_1" + value = "value_2" }, ] relation_to_consumed_out_of_band_contracts = [ - { - annotation = "annotation_2" - children = "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]" - out_of_band_contract_name = "out_of_band_contract_name_1" - priority = "level2" + annotation = "annotation_2" + annotations = [ + { + key = "key_1" + value = "value_2" + }, + ] + tags = [ + { + key = "key_1" + value = "value_2" + }, + ] + out_of_band_contract_name = "out_of_band_contract_name_1" + priority = "level2" }, ] tags = [ - { - key = "key_1" - value = "value_2" + key = "key_1" + value = "value_2" }, ] } @@ -288,8 +299,11 @@ resource "aci_external_management_network_instance_profile" "test" { const testConfigMgmtInstPChildrenRemoveAll = ` resource "aci_external_management_network_instance_profile" "test" { name = "test_name" - annotations = [] - relation_to_consumed_out_of_band_contracts = [] - tags = [] + annotations = [ + ] + relation_to_consumed_out_of_band_contracts = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_external_management_network_subnet_test.go b/internal/provider/resource_aci_external_management_network_subnet_test.go index 6bdd85a8f..cc0167271 100644 --- a/internal/provider/resource_aci_external_management_network_subnet_test.go +++ b/internal/provider/resource_aci_external_management_network_subnet_test.go @@ -136,9 +136,11 @@ func TestAccResourceMgmtSubnetWithMgmtInstP(t *testing.T) { Config: testConfigMgmtSubnetChildrenRemoveOneDependencyWithMgmtInstP, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_external_management_network_subnet.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_external_management_network_subnet.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_external_management_network_subnet.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_external_management_network_subnet.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_external_management_network_subnet.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_external_management_network_subnet.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_external_management_network_subnet.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_external_management_network_subnet.test", "tags.#", "1"), @@ -223,17 +225,17 @@ const testConfigMgmtSubnetChildrenRemoveOneDependencyWithMgmtInstP = testConfigM resource "aci_external_management_network_subnet" "test" { parent_dn = aci_external_management_network_instance_profile.test.id ip = "1.1.1.0/24" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -242,7 +244,9 @@ const testConfigMgmtSubnetChildrenRemoveAllDependencyWithMgmtInstP = testConfigM resource "aci_external_management_network_subnet" "test" { parent_dn = aci_external_management_network_instance_profile.test.id ip = "1.1.1.0/24" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_l3out_consumer_label_test.go b/internal/provider/resource_aci_l3out_consumer_label_test.go index 01a8459da..97e1962cc 100644 --- a/internal/provider/resource_aci_l3out_consumer_label_test.go +++ b/internal/provider/resource_aci_l3out_consumer_label_test.go @@ -154,9 +154,11 @@ func TestAccResourceL3extConsLblWithL3extOut(t *testing.T) { Config: testConfigL3extConsLblChildrenRemoveOneDependencyWithL3extOut, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_l3out_consumer_label.test", "tags.#", "1"), @@ -247,17 +249,17 @@ const testConfigL3extConsLblChildrenRemoveOneDependencyWithL3extOut = testConfig resource "aci_l3out_consumer_label" "test" { parent_dn = aci_l3_outside.test.id name = "test_name" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -266,7 +268,9 @@ const testConfigL3extConsLblChildrenRemoveAllDependencyWithL3extOut = testConfig resource "aci_l3out_consumer_label" "test" { parent_dn = aci_l3_outside.test.id name = "test_name" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_l3out_node_sid_profile_test.go b/internal/provider/resource_aci_l3out_node_sid_profile_test.go index 553f66076..c479d6712 100644 --- a/internal/provider/resource_aci_l3out_node_sid_profile_test.go +++ b/internal/provider/resource_aci_l3out_node_sid_profile_test.go @@ -142,9 +142,11 @@ func TestAccResourceMplsNodeSidPWithL3extLoopBackIfP(t *testing.T) { Config: testConfigMplsNodeSidPChildrenRemoveOneDependencyWithL3extLoopBackIfP, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_l3out_node_sid_profile.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_l3out_node_sid_profile.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_l3out_node_sid_profile.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_l3out_node_sid_profile.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_l3out_node_sid_profile.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_l3out_node_sid_profile.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_l3out_node_sid_profile.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_l3out_node_sid_profile.test", "tags.#", "1"), @@ -231,17 +233,17 @@ const testConfigMplsNodeSidPChildrenRemoveOneDependencyWithL3extLoopBackIfP = te resource "aci_l3out_node_sid_profile" "test" { parent_dn = aci_l3out_loopback_interface_profile.test.id segment_id = "1" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -250,7 +252,9 @@ const testConfigMplsNodeSidPChildrenRemoveAllDependencyWithL3extLoopBackIfP = te resource "aci_l3out_node_sid_profile" "test" { parent_dn = aci_l3out_loopback_interface_profile.test.id segment_id = "1" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_l3out_provider_label_test.go b/internal/provider/resource_aci_l3out_provider_label_test.go index 62a576782..bf14e99ea 100644 --- a/internal/provider/resource_aci_l3out_provider_label_test.go +++ b/internal/provider/resource_aci_l3out_provider_label_test.go @@ -148,9 +148,11 @@ func TestAccResourceL3extProvLblWithL3extOut(t *testing.T) { Config: testConfigL3extProvLblChildrenRemoveOneDependencyWithL3extOut, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_l3out_provider_label.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_l3out_provider_label.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_l3out_provider_label.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_l3out_provider_label.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_l3out_provider_label.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_l3out_provider_label.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_l3out_provider_label.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_l3out_provider_label.test", "tags.#", "1"), @@ -239,17 +241,17 @@ const testConfigL3extProvLblChildrenRemoveOneDependencyWithL3extOut = testConfig resource "aci_l3out_provider_label" "test" { parent_dn = aci_l3_outside.test.id name = "prov_label" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -258,7 +260,9 @@ const testConfigL3extProvLblChildrenRemoveAllDependencyWithL3extOut = testConfig resource "aci_l3out_provider_label" "test" { parent_dn = aci_l3_outside.test.id name = "prov_label" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_l3out_redistribute_policy_test.go b/internal/provider/resource_aci_l3out_redistribute_policy_test.go index dae8b08af..b2dd12b85 100644 --- a/internal/provider/resource_aci_l3out_redistribute_policy_test.go +++ b/internal/provider/resource_aci_l3out_redistribute_policy_test.go @@ -125,9 +125,11 @@ func TestAccResourceL3extRsRedistributePolWithL3extOut(t *testing.T) { Config: testConfigL3extRsRedistributePolChildrenRemoveOneDependencyWithL3extOut, ExpectNonEmptyPlan: true, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_l3out_redistribute_policy.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_l3out_redistribute_policy.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_l3out_redistribute_policy.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_l3out_redistribute_policy.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_l3out_redistribute_policy.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_l3out_redistribute_policy.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_l3out_redistribute_policy.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_l3out_redistribute_policy.test", "tags.#", "1"), @@ -212,17 +214,17 @@ resource "aci_l3out_redistribute_policy" "test" { parent_dn = aci_l3_outside.test.id route_control_profile_name = "test_tn_rtctrl_profile_name" source = "direct" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -232,7 +234,9 @@ resource "aci_l3out_redistribute_policy" "test" { parent_dn = aci_l3_outside.test.id route_control_profile_name = "test_tn_rtctrl_profile_name" source = "direct" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_netflow_monitor_policy_test.go b/internal/provider/resource_aci_netflow_monitor_policy_test.go index 586f5f195..c055b9fd1 100644 --- a/internal/provider/resource_aci_netflow_monitor_policy_test.go +++ b/internal/provider/resource_aci_netflow_monitor_policy_test.go @@ -95,10 +95,10 @@ func TestAccResourceNetflowMonitorPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.netflow_exporter_policy_name", "netflow_exporter_policy_name_0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.netflow_exporter_policy_name", "netflow_exporter_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.netflow_record_policy_name", "netflow_record_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.key", "key_0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.value", "value_1"), @@ -125,10 +125,10 @@ func TestAccResourceNetflowMonitorPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.netflow_exporter_policy_name", "netflow_exporter_policy_name_0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.netflow_exporter_policy_name", "netflow_exporter_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.netflow_record_policy_name", "netflow_record_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.key", "key_0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.value", "value_1"), @@ -149,11 +149,11 @@ func TestAccResourceNetflowMonitorPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.netflow_exporter_policy_name", "netflow_exporter_policy_name_0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.1.netflow_exporter_policy_name", "netflow_exporter_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.#", "2"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.netflow_record_policy_name", "netflow_record_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.#", "1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.key", "key_0"), @@ -168,17 +168,20 @@ func TestAccResourceNetflowMonitorPolWithFvTenant(t *testing.T) { Config: testConfigNetflowMonitorPolChildrenRemoveOneDependencyWithFvTenant, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.#", "1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.0.netflow_exporter_policy_name", "netflow_exporter_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.#", "1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.netflow_record_policy_name", "netflow_record_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.#", "1"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.#", "1"), @@ -192,7 +195,7 @@ func TestAccResourceNetflowMonitorPolWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_exporters.#", "0"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.annotation", "annotation_1"), - resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.0.netflow_record_policy_name", "netflow_record_policy_name_1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "relation_to_netflow_record.#", "1"), resource.TestCheckResourceAttr("aci_netflow_monitor_policy.test", "tags.#", "0"), @@ -253,14 +256,52 @@ resource "aci_netflow_monitor_policy" "test" { }, { annotation = "annotation_2" - children = "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "value_2" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "value_2" + }, + ] netflow_exporter_policy_name = "netflow_exporter_policy_name_1" }, ] relation_to_netflow_record = [ { annotation = "annotation_1" - children = "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "value_2" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "value_2" + }, + ] netflow_record_policy_name = "netflow_record_policy_name_1" }, ] @@ -288,24 +329,53 @@ const testConfigNetflowMonitorPolChildrenRemoveOneDependencyWithFvTenant = testC resource "aci_netflow_monitor_policy" "test" { parent_dn = aci_tenant.test.id name = "netfow_monitor" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - relation_to_netflow_exporters = [ - { + relation_to_netflow_exporters = [ + { annotation = "annotation_2" - children = "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]" + annotations = [ + { + key = "key_1" + value = "value_2" + }, + ] + tags = [ + { + key = "key_1" + value = "value_2" + }, + ] netflow_exporter_policy_name = "netflow_exporter_policy_name_1" - }, + }, ] - tags = [ - { + relation_to_netflow_record = [ + { + annotation = "annotation_1" + annotations = [ + { + key = "key_1" + value = "value_2" + }, + ] + tags = [ + { + key = "key_1" + value = "value_2" + }, + ] + netflow_record_policy_name = "netflow_record_policy_name_1" + }, + ] + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -314,8 +384,21 @@ const testConfigNetflowMonitorPolChildrenRemoveAllDependencyWithFvTenant = testC resource "aci_netflow_monitor_policy" "test" { parent_dn = aci_tenant.test.id name = "netfow_monitor" - annotations = [] - relation_to_netflow_exporters = [] - tags = [] + annotations = [ + ] + relation_to_netflow_exporters = [ + ] + relation_to_netflow_record = [ + { + annotation = "annotation_1" + annotations = [ + ] + tags = [ + ] + netflow_record_policy_name = "netflow_record_policy_name_1" + }, + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_out_of_band_contract_test.go b/internal/provider/resource_aci_out_of_band_contract_test.go index 45ff9312e..cf25dd6f1 100644 --- a/internal/provider/resource_aci_out_of_band_contract_test.go +++ b/internal/provider/resource_aci_out_of_band_contract_test.go @@ -161,9 +161,11 @@ func TestAccResourceVzOOBBrCP(t *testing.T) { resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "priority", "unspecified"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "scope", "context"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "target_dscp", "unspecified"), + resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_out_of_band_contract.test", "tags.#", "1"), @@ -261,17 +263,15 @@ const testConfigVzOOBBrCPChildrenRemoveOne = ` resource "aci_out_of_band_contract" "test" { name = "test_name" annotations = [ - { - key = "key_1" - value = "value_2" + key = "key_1" + value = "value_2" }, ] tags = [ - { - key = "key_1" - value = "value_2" + key = "key_1" + value = "value_2" }, ] } @@ -280,7 +280,9 @@ resource "aci_out_of_band_contract" "test" { const testConfigVzOOBBrCPChildrenRemoveAll = ` resource "aci_out_of_band_contract" "test" { name = "test_name" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_pim_route_map_entry_test.go b/internal/provider/resource_aci_pim_route_map_entry_test.go index 162dade9a..0fe836ccb 100644 --- a/internal/provider/resource_aci_pim_route_map_entry_test.go +++ b/internal/provider/resource_aci_pim_route_map_entry_test.go @@ -160,9 +160,11 @@ func TestAccResourcePimRouteMapEntryWithPimRouteMapPol(t *testing.T) { Config: testConfigPimRouteMapEntryChildrenRemoveOneDependencyWithPimRouteMapPol, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_pim_route_map_entry.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_pim_route_map_entry.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_pim_route_map_entry.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_pim_route_map_entry.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_pim_route_map_entry.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_pim_route_map_entry.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_pim_route_map_entry.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_pim_route_map_entry.test", "tags.#", "1"), @@ -255,17 +257,17 @@ const testConfigPimRouteMapEntryChildrenRemoveOneDependencyWithPimRouteMapPol = resource "aci_pim_route_map_entry" "test" { parent_dn = aci_pim_route_map_policy.test.id order = "1" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -274,7 +276,9 @@ const testConfigPimRouteMapEntryChildrenRemoveAllDependencyWithPimRouteMapPol = resource "aci_pim_route_map_entry" "test" { parent_dn = aci_pim_route_map_policy.test.id order = "1" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_pim_route_map_policy_test.go b/internal/provider/resource_aci_pim_route_map_policy_test.go index aff79ff65..f20c802d1 100644 --- a/internal/provider/resource_aci_pim_route_map_policy_test.go +++ b/internal/provider/resource_aci_pim_route_map_policy_test.go @@ -142,9 +142,11 @@ func TestAccResourcePimRouteMapPolWithFvTenant(t *testing.T) { Config: testConfigPimRouteMapPolChildrenRemoveOneDependencyWithFvTenant, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_pim_route_map_policy.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_pim_route_map_policy.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_pim_route_map_policy.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_pim_route_map_policy.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_pim_route_map_policy.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_pim_route_map_policy.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_pim_route_map_policy.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_pim_route_map_policy.test", "tags.#", "1"), @@ -231,17 +233,17 @@ const testConfigPimRouteMapPolChildrenRemoveOneDependencyWithFvTenant = testConf resource "aci_pim_route_map_policy" "test" { parent_dn = aci_tenant.test.id name = "test_name" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -250,7 +252,9 @@ const testConfigPimRouteMapPolChildrenRemoveAllDependencyWithFvTenant = testConf resource "aci_pim_route_map_policy" "test" { parent_dn = aci_tenant.test.id name = "test_name" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract_test.go b/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract_test.go index 14bf7e258..10e870da1 100644 --- a/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract_test.go +++ b/internal/provider/resource_aci_relation_to_consumed_out_of_band_contract_test.go @@ -124,9 +124,11 @@ func TestAccResourceMgmtRsOoBConsWithMgmtInstP(t *testing.T) { Config: testConfigMgmtRsOoBConsChildrenRemoveOneDependencyWithMgmtInstP, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_relation_to_consumed_out_of_band_contract.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_relation_to_consumed_out_of_band_contract.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_relation_to_consumed_out_of_band_contract.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_relation_to_consumed_out_of_band_contract.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_relation_to_consumed_out_of_band_contract.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_relation_to_consumed_out_of_band_contract.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_relation_to_consumed_out_of_band_contract.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_relation_to_consumed_out_of_band_contract.test", "tags.#", "1"), @@ -207,17 +209,17 @@ const testConfigMgmtRsOoBConsChildrenRemoveOneDependencyWithMgmtInstP = testConf resource "aci_relation_to_consumed_out_of_band_contract" "test" { parent_dn = aci_external_management_network_instance_profile.test.id out_of_band_contract_name = "test_tn_vz_oob_br_cp_name" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -226,7 +228,9 @@ const testConfigMgmtRsOoBConsChildrenRemoveAllDependencyWithMgmtInstP = testConf resource "aci_relation_to_consumed_out_of_band_contract" "test" { parent_dn = aci_external_management_network_instance_profile.test.id out_of_band_contract_name = "test_tn_vz_oob_br_cp_name" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_relation_to_fallback_route_group_test.go b/internal/provider/resource_aci_relation_to_fallback_route_group_test.go index 6d59993bf..ce7241e82 100644 --- a/internal/provider/resource_aci_relation_to_fallback_route_group_test.go +++ b/internal/provider/resource_aci_relation_to_fallback_route_group_test.go @@ -118,9 +118,11 @@ func TestAccResourceL3extRsOutToFBRGroupWithL3extOut(t *testing.T) { Config: testConfigL3extRsOutToFBRGroupChildrenRemoveOneDependencyWithL3extOut, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_relation_to_fallback_route_group.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_relation_to_fallback_route_group.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_relation_to_fallback_route_group.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_relation_to_fallback_route_group.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_relation_to_fallback_route_group.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_relation_to_fallback_route_group.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_relation_to_fallback_route_group.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_relation_to_fallback_route_group.test", "tags.#", "1"), @@ -206,17 +208,17 @@ const testConfigL3extRsOutToFBRGroupChildrenRemoveOneDependencyWithL3extOut = te resource "aci_relation_to_fallback_route_group" "test" { parent_dn = aci_l3_outside.test.id target_dn = aci_vrf_fallback_route_group.test.id - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -225,7 +227,9 @@ const testConfigL3extRsOutToFBRGroupChildrenRemoveAllDependencyWithL3extOut = te resource "aci_relation_to_fallback_route_group" "test" { parent_dn = aci_l3_outside.test.id target_dn = aci_vrf_fallback_route_group.test.id - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_relation_to_netflow_exporter_test.go b/internal/provider/resource_aci_relation_to_netflow_exporter_test.go index d913e16f1..ef070a87d 100644 --- a/internal/provider/resource_aci_relation_to_netflow_exporter_test.go +++ b/internal/provider/resource_aci_relation_to_netflow_exporter_test.go @@ -118,9 +118,11 @@ func TestAccResourceNetflowRsMonitorToExporterWithNetflowMonitorPol(t *testing.T Config: testConfigNetflowRsMonitorToExporterChildrenRemoveOneDependencyWithNetflowMonitorPol, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_relation_to_netflow_exporter.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_relation_to_netflow_exporter.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_relation_to_netflow_exporter.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_relation_to_netflow_exporter.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_relation_to_netflow_exporter.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_relation_to_netflow_exporter.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_relation_to_netflow_exporter.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_relation_to_netflow_exporter.test", "tags.#", "1"), @@ -199,17 +201,17 @@ const testConfigNetflowRsMonitorToExporterChildrenRemoveOneDependencyWithNetflow resource "aci_relation_to_netflow_exporter" "test" { parent_dn = aci_netflow_monitor_policy.test.id netflow_exporter_policy_name = "test_tn_netflow_exporter_pol_name" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -218,7 +220,9 @@ const testConfigNetflowRsMonitorToExporterChildrenRemoveAllDependencyWithNetflow resource "aci_relation_to_netflow_exporter" "test" { parent_dn = aci_netflow_monitor_policy.test.id netflow_exporter_policy_name = "test_tn_netflow_exporter_pol_name" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_vrf_fallback_route_group_member_test.go b/internal/provider/resource_aci_vrf_fallback_route_group_member_test.go index 109e716b9..d9e64d4af 100644 --- a/internal/provider/resource_aci_vrf_fallback_route_group_member_test.go +++ b/internal/provider/resource_aci_vrf_fallback_route_group_member_test.go @@ -136,9 +136,11 @@ func TestAccResourceFvFBRMemberWithFvFBRGroup(t *testing.T) { Config: testConfigFvFBRMemberChildrenRemoveOneDependencyWithFvFBRGroup, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group_member.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group_member.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group_member.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group_member.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group_member.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group_member.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group_member.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group_member.test", "tags.#", "1"), @@ -223,17 +225,17 @@ const testConfigFvFBRMemberChildrenRemoveOneDependencyWithFvFBRGroup = testConfi resource "aci_vrf_fallback_route_group_member" "test" { parent_dn = aci_vrf_fallback_route_group.test.id fallback_member = "2.2.2.3" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] } ` @@ -242,7 +244,9 @@ const testConfigFvFBRMemberChildrenRemoveAllDependencyWithFvFBRGroup = testConfi resource "aci_vrf_fallback_route_group_member" "test" { parent_dn = aci_vrf_fallback_route_group.test.id fallback_member = "2.2.2.3" - annotations = [] - tags = [] + annotations = [ + ] + tags = [ + ] } ` diff --git a/internal/provider/resource_aci_vrf_fallback_route_group_test.go b/internal/provider/resource_aci_vrf_fallback_route_group_test.go index aff4e0ed0..a3f024340 100644 --- a/internal/provider/resource_aci_vrf_fallback_route_group_test.go +++ b/internal/provider/resource_aci_vrf_fallback_route_group_test.go @@ -92,7 +92,7 @@ func TestAccResourceFvFBRGroupWithFvCtx(t *testing.T) { resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.name", "name_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.description", "description_2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.fallback_member", "2.2.2.3"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.name", "name_2"), @@ -123,7 +123,7 @@ func TestAccResourceFvFBRGroupWithFvCtx(t *testing.T) { resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.name", "name_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.description", "description_2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.fallback_member", "2.2.2.3"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.name", "name_2"), @@ -151,7 +151,7 @@ func TestAccResourceFvFBRGroupWithFvCtx(t *testing.T) { resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.name", "name_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.name_alias", "name_alias_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.description", "description_2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.fallback_member", "2.2.2.3"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.1.name", "name_2"), @@ -164,14 +164,17 @@ func TestAccResourceFvFBRGroupWithFvCtx(t *testing.T) { Config: testConfigFvFBRGroupChildrenRemoveOneDependencyWithFvCtx, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "annotations.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "annotations.0.value", "value_2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "annotations.#", "1"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.0.key", "key_1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.0.value", "value_2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "tags.#", "1"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.annotation", "annotation_2"), - resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.children", "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.children", "map[annotations:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]] tags:[map[deletable_child:true key:key_0 value:value_1] map[deletable_child:true key:key_1 value:value_2]]]"), + resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.deletable_child", "true"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.description", "description_2"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.fallback_member", "2.2.2.3"), resource.TestCheckResourceAttr("aci_vrf_fallback_route_group.test", "vrf_fallback_route_group_members.0.name", "name_2"), @@ -253,7 +256,26 @@ resource "aci_vrf_fallback_route_group" "test" { }, { annotation = "annotation_2" - children = "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]" + annotations = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "value_2" + }, + ] + tags = [ + { + key = "key_0" + value = "value_1" + }, + { + key = "key_1" + value = "value_2" + }, + ] description = "description_2" fallback_member = "2.2.2.3" name = "name_2" @@ -274,27 +296,38 @@ const testConfigFvFBRGroupChildrenRemoveOneDependencyWithFvCtx = testConfigFvCtx resource "aci_vrf_fallback_route_group" "test" { parent_dn = aci_vrf.test.id name = "fallback_route_group" - annotations = [ - { + annotations = [ + { key = "key_1" value = "value_2" - }, + }, ] - tags = [ - { + tags = [ + { key = "key_1" value = "value_2" - }, + }, ] - vrf_fallback_route_group_members = [ - { + vrf_fallback_route_group_members = [ + { annotation = "annotation_2" - children = "map[annotations:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]] tags:[map[key:key_0 value:value_1] map[key:key_1 value:value_2]]]" + annotations = [ + { + key = "key_1" + value = "value_2" + }, + ] + tags = [ + { + key = "key_1" + value = "value_2" + }, + ] description = "description_2" fallback_member = "2.2.2.3" name = "name_2" name_alias = "name_alias_2" - }, + }, ] } ` @@ -303,8 +336,11 @@ const testConfigFvFBRGroupChildrenRemoveAllDependencyWithFvCtx = testConfigFvCtx resource "aci_vrf_fallback_route_group" "test" { parent_dn = aci_vrf.test.id name = "fallback_route_group" - annotations = [] - tags = [] - vrf_fallback_route_group_members = [] + annotations = [ + ] + tags = [ + ] + vrf_fallback_route_group_members = [ + ] } `