From e16e534416fb3160a705388bb4c87e69210dc6ba Mon Sep 17 00:00:00 2001 From: akinross Date: Fri, 20 Dec 2024 08:58:56 +0100 Subject: [PATCH 1/4] [ignore] add path check to avoid index errors for make string required validation --- internal/provider/utils.go | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/internal/provider/utils.go b/internal/provider/utils.go index 075d80c2b..ea7a11655 100644 --- a/internal/provider/utils.go +++ b/internal/provider/utils.go @@ -219,14 +219,23 @@ func (v MakeStringRequiredValidator) ValidateString(ctx context.Context, req val return } - setName := req.Path.String()[0:strings.Index(req.Path.String(), "[")] - attributeName := req.Path.String()[strings.Index(req.Path.String(), "]")+2:] - - resp.Diagnostics.AddAttributeError( - req.Path, - "Incorrect attribute value type", - fmt.Sprintf("Inappropriate value for attribute \"%s\": attribute \"%s\" is required.", setName, attributeName), - ) + path := req.Path.String() + if strings.Contains(path, "[") { + setName := path[0:strings.Index(path, "[")] + attributeName := path[strings.Index(path, "]")+2:] + resp.Diagnostics.AddAttributeError( + req.Path, + "Incorrect attribute value type", + fmt.Sprintf("Inappropriate value for attribute \"%s\": attribute \"%s\" is required.", setName, attributeName), + ) + } else { + resp.Diagnostics.AddAttributeError( + req.Path, + "Incorrect attribute value type", + fmt.Sprintf("Attribute is required for path: %s", path), + ) + } + } // StringNotNull returns an validator which ensures that the string attribute is From e11be5f4559b939be9e4d06938ad02ad08fa1369 Mon Sep 17 00:00:00 2001 From: akinross Date: Fri, 20 Dec 2024 08:59:32 +0100 Subject: [PATCH 2/4] [ignore] add ignore conditional of read-only attributes to defaults and all in testvars --- gen/templates/testvars.yaml.tmpl | 221 ++++++++++++++++--------------- 1 file changed, 115 insertions(+), 106 deletions(-) diff --git a/gen/templates/testvars.yaml.tmpl b/gen/templates/testvars.yaml.tmpl index 26df919ad..3edbccc20 100644 --- a/gen/templates/testvars.yaml.tmpl +++ b/gen/templates/testvars.yaml.tmpl @@ -4,8 +4,10 @@ {{ $versionMismatch := .VersionMismatched}} default: - {{- $versionMismatchExists := false}} - {{- range .Properties}}{{- if keyExists $versionMismatch .RawVersion}}{{$versionMismatchExists = true}}{{- end}}{{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} +{{- $versionMismatchExists := false}} +{{- range .Properties}} + {{- if keyExists $versionMismatch .RawVersion}}{{$versionMismatchExists = true}}{{- end}} + {{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} {{- if .DefaultValue}} {{- if eq .ValueType "bitmask"}} {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "default" 0 $.Definitions))}} @@ -31,57 +33,59 @@ default: {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: "{{overwritePropertyValue .PkgName $overwritePropertyName "" "default" 0 $.Definitions}}" {{- end}} {{- end}} - {{- end}}{{- end}} - {{- if $versionMismatchExists}} - {{- $properties := .Properties }} + {{- end}} +{{- end}} +{{- if $versionMismatchExists}}{{- $properties := .Properties }} version_mismatch: - {{- range $versionMismatchNumber, $propertyNames := $versionMismatch }} - {{- $printedVersionMismatchNumberAll := false }} - {{- range $propertyNames }} - {{- $propertyInMismatch := .}} - {{- range $properties}} - {{- if eq .PropertyName $propertyInMismatch}} - {{- if not $printedVersionMismatchNumberAll }} - {{- $printedVersionMismatchNumberAll = true }} + {{- range $versionMismatchNumber, $propertyNames := $versionMismatch }}{{- $printedVersionMismatchNumberAll := false }} + {{- range $propertyNames }}{{- $propertyInMismatch := .}} + {{- range $properties}} + {{- if and (not .IgnoreInTest) (not .ReadOnly)}} + {{- if eq .PropertyName $propertyInMismatch}} + {{- if not $printedVersionMismatchNumberAll }}{{- $printedVersionMismatchNumberAll = true }} {{ $versionMismatchNumber }}: - {{- end }} + {{- end }} {{- $overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - {{- if .DefaultValue}} - {{- if eq .ValueType "bitmask"}} - {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "default" 0 $.Definitions))}} + {{- if .DefaultValue}} + {{- if eq .ValueType "bitmask"}} + {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "default" 0 $.Definitions))}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: {{range $index, $value := (overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "default" 0 $.Definitions)}} - "{{ $value}}" - {{- end}} - {{- else}} + {{- end}} + {{- else}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: [] - {{- end}} - {{- else}} + {{- end}} + {{- else}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: "{{overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "default" 0 $.Definitions}}" - {{- end}} - {{- else if not .IsNaming}} - {{- if eq .ValueType "bitmask"}} - {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName "" "default" 0 $.Definitions))}} + {{- end}} + {{- else if not .IsNaming}} + {{- if eq .ValueType "bitmask"}} + {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName "" "default" 0 $.Definitions))}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: {{range $index, $value := (overwritePropertyValue .PkgName $overwritePropertyName "" "default" 0 $.Definitions)}} - "{{ $value}}" - {{- end}} - {{- else}} + {{- end}} + {{- else}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: [] - {{- end}} - {{- else}} + {{- end}} + {{- else}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: "{{overwritePropertyValue .PkgName $overwritePropertyName "" "default" 0 $.Definitions}}" + {{- end}} + {{- end}} {{- end}} {{- end}} - {{- end}}{{- end}} {{- end}} - {{- end}} - {{- end}} + {{- end}} + {{- end}} +{{- end}} {{ if .HasNaming }} datasource_non_existing: - {{- range .Properties}}{{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$testValue := createNonExistingValue .SnakeCaseName}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - {{- if .IsNaming }} + {{- range .Properties}} + {{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$testValue := createNonExistingValue .SnakeCaseName}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} + {{- if .IsNaming }} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: "{{overwritePropertyValue .PkgName $overwritePropertyName $testValue "datasource_non_existing" 0 $.Definitions}}" + {{- end}} {{- end}} - {{- end}}{{- end}} + {{- end}} datasource_required: {{- range .Properties}}{{$testValue := createTestValue .SnakeCaseName}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} @@ -101,7 +105,7 @@ resource_required: custom_type: {{- range .Properties}}{{$testValue := createTestValue .SnakeCaseName}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} {{- if .HasCustomType}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: {{$validValuesMap := .ValidValuesMap}}{{range $key, $value := $validValuesMap}}{{if or (ne $value "unspecified") (eq (len $validValuesMap) 1)}}"{{$key}}"{{break}}{{end}}{{end}} + {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: {{$validValuesMap := .ValidValuesMap}}{{range $key, $value := $validValuesMap}}{{- if or (ne $value "unspecified") (eq (len $validValuesMap) 1)}}"{{$key}}"{{break}}{{end}}{{end}} {{- else if or .IsNaming (or .IsRequired (isRequiredInTestValue .PkgName $overwritePropertyName $.Definitions "resource_required"))}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: "{{overwritePropertyValue .PkgName $overwritePropertyName $testValue "resource_required" 0 $.Definitions}}" {{- end}} @@ -111,19 +115,23 @@ custom_type: {{- if .HasReadOnlyProperties}} read_only: - {{- range .Properties}}{{- if .ReadOnly}} + {{- range .Properties}} + {{- if .ReadOnly}} - "{{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}" - {{- end}}{{- end}} + {{- end}} + {{- end}} {{- end}} all: - {{- $versionMismatchExists = false}} - {{- range .Properties}}{{- if keyExists $versionMismatch .RawVersion}}{{$versionMismatchExists = true}}{{- end}}{{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - {{- if overwriteProperty .PkgName .SnakeCaseName $.Definitions | eq "annotation"}} +{{- $versionMismatchExists = false}} +{{- range .Properties}} + {{- if keyExists $versionMismatch .RawVersion}}{{$versionMismatchExists = true}}{{- end}} + {{- if and (not (keyExists $versionMismatch .RawVersion)) (not .IgnoreInTest) (not .ReadOnly)}}{{$overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} + {{- if overwriteProperty .PkgName .SnakeCaseName $.Definitions | eq "annotation"}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: "annotation" - {{- else if .DefaultValue}}{{$length := len .ValidValues}} - {{- if eq .ValueType "bitmask"}} - {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "all" 0 $.Definitions))}} + {{- else if .DefaultValue}}{{$length := len .ValidValues}} + {{- if eq .ValueType "bitmask"}} + {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "all" 0 $.Definitions))}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: {{range $index, $value := (overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "all" 0 $.Definitions)}} - "{{ $value}}" {{- end}} @@ -148,62 +156,63 @@ all: {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: "{{overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions}}" {{- end}} {{- end}} - {{- end}}{{- end}} - {{- if $versionMismatchExists}} - {{- $properties := .Properties }} + {{- end}} +{{- end}} +{{- if $versionMismatchExists}}{{- $properties := .Properties }} version_mismatch: - {{- range $versionMismatchNumber, $propertyNames := $versionMismatch }} - {{- $printedVersionMismatchNumberAll := false }} - {{- range $propertyNames }} - {{- $propertyInMismatch := .}} - {{- range $properties}} - {{- if eq .PropertyName $propertyInMismatch}} - {{- if not $printedVersionMismatchNumberAll }} - {{- $printedVersionMismatchNumberAll = true }} + {{- range $versionMismatchNumber, $propertyNames := $versionMismatch }}{{- $printedVersionMismatchNumberAll := false }} + {{- range $propertyNames }}{{- $propertyInMismatch := .}} + {{- range $properties}} + {{- if and (not .IgnoreInTest) (not .ReadOnly)}} + {{- if eq .PropertyName $propertyInMismatch}} + {{- if not $printedVersionMismatchNumberAll }}{{- $printedVersionMismatchNumberAll = true }} {{ $versionMismatchNumber }}: - {{- end }} - {{- $overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} - {{- if .DefaultValue}}{{$length := len .ValidValues}} - {{- if eq .ValueType "bitmask"}} - {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "all" 0 $.Definitions))}} + {{- end }} + {{- $overwritePropertyName := overwriteProperty .PkgName .SnakeCaseName $.Definitions}} + {{- if .DefaultValue}}{{$length := len .ValidValues}} + {{- if eq .ValueType "bitmask"}} + {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "all" 0 $.Definitions))}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: {{range $index, $value := (overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "all" 0 $.Definitions)}} - "{{ $value}}" - {{- end}} - {{- else}} + {{- end}} + {{- else}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: [] - {{- end}} - {{- else if eq $length 0}} + {{- end}} + {{- else if eq $length 0}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: "{{overwritePropertyValue .PkgName $overwritePropertyName .DefaultValue "all" 0 $.Definitions}}" - {{- else }}{{$testValue := index .ValidValues 0 }} + {{- else }}{{$testValue := index .ValidValues 0 }} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: "{{overwritePropertyValue .PkgName $overwritePropertyName $testValue "all" 0 $.Definitions}}" - {{- end}} - {{- else if not .IsNaming}} - {{- if eq .ValueType "bitmask"}} - {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions))}} + {{- end}} + {{- else if not .IsNaming}} + {{- if eq .ValueType "bitmask"}} + {{- if lt 0 (len (overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions))}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: {{range $index, $value := (overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions)}} - "{{ $value}}" + {{- end}} + {{- else}} + {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: [] {{- end}} {{- else}} - {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: [] - {{- end}} - {{- else}} {{overwriteProperty .PkgName .SnakeCaseName $.Definitions}}: "{{overwritePropertyValue .PkgName $overwritePropertyName $overwritePropertyName "all" 0 $.Definitions}}" + {{- end}} + {{- end}} + {{- end}} + {{- end}} {{- end}} {{- end}} - {{- end}} - {{- end}} - {{- end}} - {{- end}} {{- end}} +{{- end}} {{ if .Children}} children: {{- range $key, $value := .Children}} {{- $newCtx := addToTemplateProperties . "Indent" "" -}} {{- template "nestedChildren" $newCtx }} - {{- end}}{{- end}} + {{- end}} +{{- end}} {{- if and .ContainedBy (not .MultiParentFormats)}} parents: - {{- $index := 0}}{{- range $key := .DocumentationExamples}}{{$parentDependency := getParentTestDependencies $.PkgName $index $.Definitions}}{{$index = add $index 1}} + {{- $index := 0}} + {{- range $key := .DocumentationExamples}}{{$parentDependency := getParentTestDependencies $.PkgName $index $.Definitions}}{{$index = add $index 1}} - class_name: "{{ $key }}" parent_dependency: "{{$parentDependency.parent_dependency}}" parent_dn: "{{createParentDnValue $key "test" $.Definitions}}" @@ -219,15 +228,15 @@ parents: {{- end }} test_type: {{$.TestType}} {{- end}} - {{- if .TestDependencies}} + {{- if .TestDependencies}} targets: - {{- range .TestDependencies }} + {{- range .TestDependencies }} - class_name: "{{ .ClassName }}" target_dn: "{{ .TargetDn }}" target_dn_ref: "{{ .TargetDnRef }}" - {{- if .TargetDnOverwriteDocs}} + {{- if .TargetDnOverwriteDocs}} target_dn_overwrite_docs: "{{ .TargetDnOverwriteDocs }}" - {{- end}} + {{- end}} parent_dependency: "{{ .ParentDependency}}" parent_dependency_dn_ref: "{{.ParentDependencyDnRef}}" target_resource_name: "{{ .TargetResourceName }}" @@ -235,34 +244,34 @@ targets: parent_dn_key: "{{ .ParentDnKey }}" static: {{ .Static }} properties: - {{- range $key, $value := .Properties}} + {{- range $key, $value := .Properties}} {{ $key }}: "{{ $value }}" - {{- end }} {{- end }} + {{- end }} {{- end }} - {{- if .ChildTestDependencies}} + {{- if .ChildTestDependencies}} child_targets: - {{- range .ChildTestDependencies }} + {{- range .ChildTestDependencies }} - class_name: "{{ .ClassName }}" target_dn: "{{ .TargetDn }}" - {{- if .TargetDnOverwriteDocs}} + {{- if .TargetDnOverwriteDocs}} target_dn_overwrite_docs: "{{ .TargetDnOverwriteDocs }}" - {{- end}} + {{- end}} relation_resource_name: "{{ .RelationResourceName }}" static: {{ .Static }} - {{- if not .Static}} + {{- if not .Static}} target_dn_ref: "{{ .TargetDnRef }}" parent_dependency: "{{ .ParentDependency}}" parent_dependency_dn_ref: "{{.ParentDependencyDnRef}}" target_resource_name: "{{ .TargetResourceName }}" parent_dn_key: "{{ .ParentDnKey }}" properties: - {{- range $key, $value := .Properties}} + {{- range $key, $value := .Properties}} {{ $key }}: "{{ $value }}" - {{- end }} {{- end }} + {{- end }} {{- end }} - {{- end}} + {{- end}} {{- end}} {{- if .MultiParentFormats}} @@ -283,9 +292,9 @@ parents: {{- else }} test_type: both {{- end }} -{{- end }} + {{- end }} -{{- if .TestDependencies}} + {{- if .TestDependencies}} targets: {{- range .TestDependencies }} - class_name: "{{ .ClassName }}" @@ -297,37 +306,37 @@ targets: relation_resource_name: "{{ .RelationResourceName }}" parent_dn_key: "{{ .ParentDnKey }}" properties: - {{- range $key, $value := .Properties}} + {{- range $key, $value := .Properties}} {{ $key }}: "{{ $value }}" - {{- end }} - {{- end }} -{{- end }} + {{- end }} + {{- end }} + {{- end }} {{- end }} {{- if or (and (not .ContainedBy) (not .MultiParentFormats)) (and (.ContainedBy) (not .DocumentationExamples) (not .MultiParentFormats)) }} -{{- if .ChildTestDependencies}} + {{- if .ChildTestDependencies}} child_targets: - {{- range .ChildTestDependencies }} + {{- range .ChildTestDependencies }} - class_name: "{{ .ClassName }}" target_dn: "{{ .TargetDn }}" - {{- if .TargetDnOverwriteDocs}} + {{- if .TargetDnOverwriteDocs}} target_dn_overwrite_docs: "{{ .TargetDnOverwriteDocs }}" - {{- end}} + {{- end}} relation_resource_name: "{{ .RelationResourceName }}" static: {{ .Static }} - {{- if not .Static}} + {{- if not .Static}} target_dn_ref: "{{ .TargetDnRef }}" parent_dependency: "{{ .ParentDependency}}" parent_dependency_dn_ref: "{{.ParentDependencyDnRef}}" target_resource_name: "{{ .TargetResourceName }}" parent_dn_key: "{{ .ParentDnKey }}" properties: - {{- range $key, $value := .Properties}} + {{- range $key, $value := .Properties}} {{ $key }}: "{{ $value }}" - {{- end }} {{- end }} + {{- end }} {{- end }} - {{- end}} + {{- end}} test_type: {{ .TestType }} {{- end }} From 8f7cd5c08ccd0b3459e4a3cae41711aa24790ea0 Mon Sep 17 00:00:00 2001 From: akinross Date: Fri, 20 Dec 2024 08:59:47 +0100 Subject: [PATCH 3/4] [minor_change] Add read-only pcTag, scope and segment attributes to aci_bridge_domain resource and datasource and add scope to aci_endpoint_security_group and aci_application_epg resources and datasources --- docs/data-sources/application_epg.md | 1 + docs/data-sources/bridge_domain.md | 3 + docs/data-sources/endpoint_security_group.md | 1 + docs/resources/application_epg.md | 2 + docs/resources/bridge_domain.md | 4 + docs/resources/endpoint_security_group.md | 2 + gen/definitions/properties.yaml | 14 + gen/testvars/fvAEPg.yaml | 1 + gen/testvars/fvBD.yaml | 5 + gen/testvars/fvESg.yaml | 1 + .../data_source_aci_application_epg.go | 4 + .../data_source_aci_application_epg_test.go | 1 + .../provider/data_source_aci_bridge_domain.go | 12 + .../data_source_aci_bridge_domain_test.go | 3 + ...data_source_aci_endpoint_security_group.go | 4 + ...source_aci_endpoint_security_group_test.go | 1 + .../provider/resource_aci_application_epg.go | 10 + .../resource_aci_application_epg_test.go | 11 + .../provider/resource_aci_bridge_domain.go | 421 +++++++++++++++--- .../resource_aci_bridge_domain_test.go | 33 ++ .../resource_aci_endpoint_security_group.go | 10 + ...source_aci_endpoint_security_group_test.go | 11 + 22 files changed, 495 insertions(+), 60 deletions(-) diff --git a/docs/data-sources/application_epg.md b/docs/data-sources/application_epg.md index 6cd1421a4..cf4e50743 100644 --- a/docs/data-sources/application_epg.md +++ b/docs/data-sources/application_epg.md @@ -61,6 +61,7 @@ data "aci_application_epg" "example_application_profile" { * `pc_tag` (pcTag) - (string) The classification tag used for policy enforcement and zoning. * `preferred_group_member` (prefGrMemb) - (string) Parameter used to determine whether the EPG is part of the preferred group. Members of this group are allowed to communicate without contracts. * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Application EPG object. * `admin_state` (shutdown) - (string) Withdraw AEPg Configuration from all Nodes in the Fabric. * `epg_useg_block_statement` - (map) A map of EPG uSeg Block Statement (ACI object [fvCrtrn](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCrtrn/overview)). This attribute is supported in ACI versions: 1.1(1j) and later. * `annotation` (annotation) - (string) The annotation of the EPG uSeg Block Statement object. diff --git a/docs/data-sources/bridge_domain.md b/docs/data-sources/bridge_domain.md index dc654d46c..06988e0c9 100644 --- a/docs/data-sources/bridge_domain.md +++ b/docs/data-sources/bridge_domain.md @@ -69,6 +69,9 @@ data "aci_bridge_domain" "example_tenant" { * `name_alias` (nameAlias) - (string) The name alias of the Bridge Domain object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. +* `pc_tag` (pcTag) - (string) The classification tag used for policy enforcement and zoning. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Bridge Domain object. +* `segment` (seg) - (string) The segment ID (L2-VNI) of the Bridge Domain object. * `bridge_domain_type` (type) - (string) The domain type of the Bridge Domain object. * `unicast_routing` (unicastRoute) - (string) Enables L3 routing and endpoint IP learning for the Bridge Domain object. * `l2_unknown_unicast_flooding` (unkMacUcastAct) - (string) The forwarding method for unknown layer 2 destinations. diff --git a/docs/data-sources/endpoint_security_group.md b/docs/data-sources/endpoint_security_group.md index 254d89604..af60a9adc 100644 --- a/docs/data-sources/endpoint_security_group.md +++ b/docs/data-sources/endpoint_security_group.md @@ -56,6 +56,7 @@ data "aci_endpoint_security_group" "example_application_profile" { * `intra_esg_isolation` (pcEnfPref) - (string) Parameter used to determine whether communication between endpoints within the ESG is blocked. * `pc_tag` (pcTag) - (string) The classification tag used for policy enforcement and zoning. * `preferred_group_member` (prefGrMemb) - (string) Parameter used to determine whether the ESG is part of the preferred group. Members of this group are allowed to communicate without contracts. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Endpoint Security Group object. * `admin_state` (shutdown) - (string) Withdraw the ESG configuration from all nodes in the fabric. * `relation_to_consumed_contracts` - (list) A list of Relation To Consumed Contracts (ACI object [fvRsCons](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvRsCons/overview)) pointing to Contract (ACI Object [vzBrCP](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/vzBrCP/overview)). This attribute is supported in ACI versions: 1.0(1e) and later. * `annotation` (annotation) - (string) The annotation of the Relation To Consumed Contract object. diff --git a/docs/resources/application_epg.md b/docs/resources/application_epg.md index 01b0f102d..1995338ca 100644 --- a/docs/resources/application_epg.md +++ b/docs/resources/application_epg.md @@ -446,6 +446,8 @@ All examples for the Application EPG resource can be found in the [examples](htt * `priority` (prio) - (string) The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles. - Default: `unspecified` - Valid Values: `level1`, `level2`, `level3`, `level4`, `level5`, `level6`, `unspecified`. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Application EPG object. + - Default: `0` * `admin_state` (shutdown) - (string) Withdraw AEPg Configuration from all Nodes in the Fabric. - Default: `no` - Valid Values: `no`, `yes`. diff --git a/docs/resources/bridge_domain.md b/docs/resources/bridge_domain.md index 390af04bf..0b47a085a 100644 --- a/docs/resources/bridge_domain.md +++ b/docs/resources/bridge_domain.md @@ -383,6 +383,10 @@ All examples for the Bridge Domain resource can be found in the [examples](https * `name_alias` (nameAlias) - (string) The name alias of the Bridge Domain object. * `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation. * `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object. +* `pc_tag` (pcTag) - (string) The classification tag used for policy enforcement and zoning. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Bridge Domain object. + - Default: `0` +* `segment` (seg) - (string) The segment ID (L2-VNI) of the Bridge Domain object. * `bridge_domain_type` (type) - (string) The domain type of the Bridge Domain object. - Default: `regular` - Valid Values: `fc`, `regular`. diff --git a/docs/resources/endpoint_security_group.md b/docs/resources/endpoint_security_group.md index 03805e419..444dbbe75 100644 --- a/docs/resources/endpoint_security_group.md +++ b/docs/resources/endpoint_security_group.md @@ -214,6 +214,8 @@ All examples for the Endpoint Security Group resource can be found in the [examp * `preferred_group_member` (prefGrMemb) - (string) Parameter used to determine whether the ESG is part of the preferred group. Members of this group are allowed to communicate without contracts. - Default: `exclude` - Valid Values: `exclude`, `include`. +* `scope` (scope) - (string) The scope ID (L3-VNI) of the Endpoint Security Group object. + - Default: `0` * `admin_state` (shutdown) - (string) Withdraw the ESG configuration from all nodes in the fabric. - Default: `no` - Valid Values: `no`, `yes`. diff --git a/gen/definitions/properties.yaml b/gen/definitions/properties.yaml index d2cce95c0..f3fd5d088 100644 --- a/gen/definitions/properties.yaml +++ b/gen/definitions/properties.yaml @@ -24,6 +24,8 @@ global: lastMbrIntvl: "The last member interval (seconds) of the %s object. The group state is removed when no host responds before the timeout" startQueryCnt: "The start query count of the %s object." startQueryIntvl: "The query interval (seconds) of the %s object at start-up." + seg: "The segment ID (L2-VNI) of the %s object." + pcTag: "The classification tag used for policy enforcement and zoning." overwrites: count: "apic_count" # count is a terraform reserved schema entry provider: "prov" # provider is a terraform reserved schema entry @@ -44,6 +46,7 @@ global: netflow_pref: "enable_netflow" num_ports: "number_of_ports" class_pref: "class_preference" + seg: "segment" resource_name_doc_overwrite: Vrf: "VRF" Sid: "SR-MPLS Segment ID" @@ -429,6 +432,7 @@ netflowRecordPol: fvESg: read_only_properties: - "pcTag" + - "scope" remove_valid_values: pcTag: - "any" @@ -442,6 +446,7 @@ fvESg: prefGrMemb: "Parameter used to determine whether the ESG is part of the preferred group. Members of this group are allowed to communicate without contracts." pcEnfPref: "Parameter used to determine whether communication between endpoints within the ESG is blocked." shutdown: "Withdraw the ESG configuration from all nodes in the fabric." + scope: "The scope ID (L3-VNI) of the %s object." parents: - class_name: "fvAp" parent_dependency: "fvTenant" @@ -717,6 +722,7 @@ fvIpAttr: fvAEPg: read_only_properties: - "pcTag" + - "scope" remove_valid_values: pcTag: - "any" @@ -745,6 +751,7 @@ fvAEPg: isAttrBasedEPg: "The %s object is microsegmented (uSeg)." pcEnfPref: "Parameter used to determine whether communication between endpoints within the EPG is blocked." prefGrMemb: "Parameter used to determine whether the EPG is part of the preferred group. Members of this group are allowed to communicate without contracts." + scope: "The scope ID (L3-VNI) of the %s object." test_values: default: forwarding_control: "none" @@ -1317,9 +1324,15 @@ pkiKeyRing: certificate_authority: "test_name" fvBD: + read_only_properties: + - "pcTag" + - "seg" + - "scope" remove_valid_values: vmac: - "not-applicable" + pcTag: + - "any" add_valid_values: epMoveDetectMode: - "" @@ -1372,6 +1385,7 @@ fvBD: unkMcastAct: "The forwarding method for unknown layer 3 multicast destinations." v6unkMcastAct: "The forwarding method for unknown IPv6 multicast destinations." vmac: "The virtual MAC address of the %s object. This is used when the the BD/SVI is extended to multiple sites using a L2 Outside." + scope: "The scope ID (L3-VNI) of the %s object." type_overwrites: epMoveDetectMode: "string" test_values: diff --git a/gen/testvars/fvAEPg.yaml b/gen/testvars/fvAEPg.yaml index 072832892..a048261aa 100644 --- a/gen/testvars/fvAEPg.yaml +++ b/gen/testvars/fvAEPg.yaml @@ -35,6 +35,7 @@ custom_type: read_only: - "pc_tag" + - "scope" all: annotation: "annotation" diff --git a/gen/testvars/fvBD.yaml b/gen/testvars/fvBD.yaml index 2f5a503e7..c0f5e9124 100644 --- a/gen/testvars/fvBD.yaml +++ b/gen/testvars/fvBD.yaml @@ -45,6 +45,11 @@ datasource_required: resource_required: name: "test_name" +read_only: + - "pc_tag" + - "scope" + - "segment" + all: optimize_wan_bandwidth: "no" annotation: "annotation" diff --git a/gen/testvars/fvESg.yaml b/gen/testvars/fvESg.yaml index d17f2e7a8..6307cd0c2 100644 --- a/gen/testvars/fvESg.yaml +++ b/gen/testvars/fvESg.yaml @@ -26,6 +26,7 @@ resource_required: read_only: - "pc_tag" + - "scope" all: annotation: "annotation" diff --git a/internal/provider/data_source_aci_application_epg.go b/internal/provider/data_source_aci_application_epg.go index 33b51356d..d52f35a4a 100644 --- a/internal/provider/data_source_aci_application_epg.go +++ b/internal/provider/data_source_aci_application_epg.go @@ -218,6 +218,10 @@ func (d *FvAEPgDataSource) Schema(ctx context.Context, req datasource.SchemaRequ Computed: true, MarkdownDescription: `The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles.`, }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Application EPG object.`, + }, "admin_state": schema.StringAttribute{ Computed: true, MarkdownDescription: `Withdraw AEPg Configuration from all Nodes in the Fabric.`, diff --git a/internal/provider/data_source_aci_application_epg_test.go b/internal/provider/data_source_aci_application_epg_test.go index e8d592126..828dc3dc1 100644 --- a/internal/provider/data_source_aci_application_epg_test.go +++ b/internal/provider/data_source_aci_application_epg_test.go @@ -37,6 +37,7 @@ func TestAccDataSourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("data.aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("data.aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("data.aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("data.aci_application_epg.test", "scope"), ), }, { diff --git a/internal/provider/data_source_aci_bridge_domain.go b/internal/provider/data_source_aci_bridge_domain.go index a19d8bd7e..f086dc7b6 100644 --- a/internal/provider/data_source_aci_bridge_domain.go +++ b/internal/provider/data_source_aci_bridge_domain.go @@ -249,6 +249,18 @@ func (d *FvBDDataSource) Schema(ctx context.Context, req datasource.SchemaReques Computed: true, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, + "pc_tag": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The classification tag used for policy enforcement and zoning.`, + }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Bridge Domain object.`, + }, + "segment": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The segment ID (L2-VNI) of the Bridge Domain object.`, + }, "bridge_domain_type": schema.StringAttribute{ Computed: true, MarkdownDescription: `The domain type of the Bridge Domain object.`, diff --git a/internal/provider/data_source_aci_bridge_domain_test.go b/internal/provider/data_source_aci_bridge_domain_test.go index d4d6d3953..9b016bab4 100644 --- a/internal/provider/data_source_aci_bridge_domain_test.go +++ b/internal/provider/data_source_aci_bridge_domain_test.go @@ -52,6 +52,9 @@ func TestAccDataSourceFvBDWithFvTenant(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("data.aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("data.aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("data.aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("data.aci_bridge_domain.test", "segment"), ), }, { diff --git a/internal/provider/data_source_aci_endpoint_security_group.go b/internal/provider/data_source_aci_endpoint_security_group.go index 7bb530f56..083ea3603 100644 --- a/internal/provider/data_source_aci_endpoint_security_group.go +++ b/internal/provider/data_source_aci_endpoint_security_group.go @@ -127,6 +127,10 @@ func (d *FvESgDataSource) Schema(ctx context.Context, req datasource.SchemaReque Computed: true, MarkdownDescription: `Parameter used to determine whether the ESG is part of the preferred group. Members of this group are allowed to communicate without contracts.`, }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Endpoint Security Group object.`, + }, "admin_state": schema.StringAttribute{ Computed: true, MarkdownDescription: `Withdraw the ESG configuration from all nodes in the fabric.`, diff --git a/internal/provider/data_source_aci_endpoint_security_group_test.go b/internal/provider/data_source_aci_endpoint_security_group_test.go index 406d35735..c73541f5a 100644 --- a/internal/provider/data_source_aci_endpoint_security_group_test.go +++ b/internal/provider/data_source_aci_endpoint_security_group_test.go @@ -32,6 +32,7 @@ func TestAccDataSourceFvESgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("data.aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("data.aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("data.aci_endpoint_security_group.test", "scope"), ), }, { diff --git a/internal/provider/resource_aci_application_epg.go b/internal/provider/resource_aci_application_epg.go index 9b368b01f..ca4fb350f 100644 --- a/internal/provider/resource_aci_application_epg.go +++ b/internal/provider/resource_aci_application_epg.go @@ -62,6 +62,7 @@ type FvAEPgResourceModel struct { PcTag types.String `tfsdk:"pc_tag"` PrefGrMemb types.String `tfsdk:"preferred_group_member"` Prio customTypes.FvAEPgPrioStringValue `tfsdk:"priority"` + Scope types.String `tfsdk:"scope"` Shutdown types.String `tfsdk:"admin_state"` FvCrtrn types.Object `tfsdk:"epg_useg_block_statement"` FvRsAEPgMonPol types.Object `tfsdk:"relation_to_application_epg_monitoring_policy"` @@ -127,6 +128,7 @@ func getEmptyFvAEPgResourceModel() *FvAEPgResourceModel { PcTag: basetypes.NewStringNull(), PrefGrMemb: basetypes.NewStringNull(), Prio: customTypes.NewFvAEPgPrioStringNull(), + Scope: basetypes.NewStringNull(), Shutdown: basetypes.NewStringNull(), FvCrtrn: types.ObjectNull(map[string]attr.Type{ "annotation": types.StringType, @@ -1994,6 +1996,7 @@ func (r *FvAEPgResource) UpgradeState(ctx context.Context) map[int64]resource.St PcTag: basetypes.NewStringNull(), PrefGrMemb: priorStateData.PrefGrMemb, Prio: customTypes.FvAEPgPrioStringValue{StringValue: priorStateData.Prio}, + Scope: basetypes.NewStringNull(), Shutdown: priorStateData.Shutdown, DeprecatedExceptionTag: priorStateData.ExceptionTag, DeprecatedFloodOnEncap: priorStateData.FloodOnEncap, @@ -4002,6 +4005,10 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `The Quality of Service (QoS) priority class ID. QoS refers to the capability of a network to provide better service to selected network traffic over various technologies. The primary goal of QoS is to provide priority including dedicated bandwidth, controlled jitter and latency (required by some real-time and interactive traffic), and improved loss characteristics. You can configure the bandwidth of each QoS level using QoS profiles.`, }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Application EPG object.`, + }, "admin_state": schema.StringAttribute{ Optional: true, Computed: true, @@ -6556,6 +6563,9 @@ func getAndSetFvAEPgAttributes(ctx context.Context, diags *diag.Diagnostics, cli if attributeName == "prio" { readData.Prio = customTypes.NewFvAEPgPrioStringValue(attributeValue.(string)) } + if attributeName == "scope" { + readData.Scope = basetypes.NewStringValue(attributeValue.(string)) + } if attributeName == "shutdown" { readData.Shutdown = basetypes.NewStringValue(attributeValue.(string)) } diff --git a/internal/provider/resource_aci_application_epg_test.go b/internal/provider/resource_aci_application_epg_test.go index 0a54c0421..3c510fc01 100644 --- a/internal/provider/resource_aci_application_epg_test.go +++ b/internal/provider/resource_aci_application_epg_test.go @@ -55,6 +55,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.allow_test", "has_multicast_source", "no"), resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "scope"), ), }, }, @@ -114,6 +115,8 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.allow_test_2", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "pc_tag"), resource.TestCheckResourceAttrSet("aci_application_epg.allow_test_2", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.allow_test", "scope"), + resource.TestCheckResourceAttrSet("aci_application_epg.allow_test_2", "scope"), ), }, }, @@ -144,6 +147,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), ), }, // Update with all config and verify default APIC values @@ -167,6 +171,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), ), }, // Update with minimum config and verify config is unchanged @@ -176,6 +181,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("aci_application_epg.test", "name", "test_name"), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), ), }, // Update with empty strings config or default value @@ -199,6 +205,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), ), }, // Import testing @@ -228,6 +235,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_application_epg.test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_application_epg.test", "has_multicast_source", "no")), resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.1.key", "key_1"), @@ -391,6 +399,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.1.key", "key_1"), @@ -815,6 +824,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "1"), @@ -1026,6 +1036,7 @@ func TestAccResourceFvAEPgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_application_epg.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_application_epg.test", "scope"), resource.TestCheckResourceAttr("aci_application_epg.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_application_epg.test", "relation_to_bridge_domain.bridge_domain_name", "bridge_domain_name_1"), diff --git a/internal/provider/resource_aci_bridge_domain.go b/internal/provider/resource_aci_bridge_domain.go index 07dd05f4d..74fb8c445 100644 --- a/internal/provider/resource_aci_bridge_domain.go +++ b/internal/provider/resource_aci_bridge_domain.go @@ -68,6 +68,9 @@ type FvBDResourceModel struct { NameAlias types.String `tfsdk:"name_alias"` OwnerKey types.String `tfsdk:"owner_key"` OwnerTag types.String `tfsdk:"owner_tag"` + PcTag types.String `tfsdk:"pc_tag"` + Scope types.String `tfsdk:"scope"` + Seg types.String `tfsdk:"segment"` Type types.String `tfsdk:"bridge_domain_type"` UnicastRoute types.String `tfsdk:"unicast_routing"` UnkMacUcastAct types.String `tfsdk:"l2_unknown_unicast_flooding"` @@ -145,6 +148,9 @@ func getEmptyFvBDResourceModel() *FvBDResourceModel { NameAlias: basetypes.NewStringNull(), OwnerKey: basetypes.NewStringNull(), OwnerTag: basetypes.NewStringNull(), + PcTag: basetypes.NewStringNull(), + Scope: basetypes.NewStringNull(), + Seg: basetypes.NewStringNull(), Type: basetypes.NewStringNull(), UnicastRoute: basetypes.NewStringNull(), UnkMacUcastAct: basetypes.NewStringNull(), @@ -1633,6 +1639,9 @@ func (r *FvBDResource) UpgradeState(ctx context.Context) map[int64]resource.Stat NameAlias: priorStateData.NameAlias, OwnerKey: basetypes.NewStringNull(), OwnerTag: basetypes.NewStringNull(), + PcTag: basetypes.NewStringNull(), + Scope: basetypes.NewStringNull(), + Seg: basetypes.NewStringNull(), Type: priorStateData.Type, UnicastRoute: priorStateData.UnicastRoute, UnkMacUcastAct: priorStateData.UnkMacUcastAct, @@ -3300,6 +3309,18 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r }, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, + "pc_tag": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The classification tag used for policy enforcement and zoning.`, + }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Bridge Domain object.`, + }, + "segment": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The segment ID (L2-VNI) of the Bridge Domain object.`, + }, "bridge_domain_type": schema.StringAttribute{ Optional: true, Computed: true, @@ -3387,6 +3408,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Legacy Mode object.`, }, "description": schema.StringAttribute{ @@ -3395,6 +3417,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The description of the Legacy Mode object.`, }, "encapsulation": schema.StringAttribute{ @@ -3403,6 +3426,9 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The VLAN or VXLAN encapsulation of the Legacy Mode object.`, }, "name": schema.StringAttribute{ @@ -3411,6 +3437,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Legacy Mode object.`, }, "name_alias": schema.StringAttribute{ @@ -3419,6 +3446,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name alias of the Legacy Mode object.`, }, "owner_key": schema.StringAttribute{ @@ -3427,6 +3455,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The key for enabling clients to own their data for entity correlation.`, }, "owner_tag": schema.StringAttribute{ @@ -3435,6 +3464,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3447,17 +3477,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3473,17 +3511,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3506,6 +3552,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Rogue Coop Exception object.`, }, "description": schema.StringAttribute{ @@ -3514,13 +3561,18 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The description of the Rogue Coop Exception object.`, }, "mac": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The MAC address of the Rogue Coop Exception object.`, }, "name": schema.StringAttribute{ @@ -3529,6 +3581,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Rogue Coop Exception object.`, }, "name_alias": schema.StringAttribute{ @@ -3537,6 +3590,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name alias of the Rogue Coop Exception object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3549,17 +3603,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3575,17 +3637,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3608,6 +3678,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Monitoring Policy object.`, }, "monitoring_policy_name": schema.StringAttribute{ @@ -3616,6 +3687,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Monitoring Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3628,17 +3700,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3654,17 +3734,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3686,6 +3774,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To First Hop Security Policy object.`, }, "first_hop_security_policy_name": schema.StringAttribute{ @@ -3694,6 +3783,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the First Hop Security Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3706,17 +3796,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3732,17 +3830,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3764,6 +3870,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Neighbor Discovery Interface Policy object.`, }, "neighbor_discovery_interface_policy_name": schema.StringAttribute{ @@ -3772,6 +3879,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Neighbor Discovery Interface Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3784,17 +3892,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3810,17 +3926,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3843,10 +3967,12 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To NetFlow Monitor Policy object.`, }, "filter_type": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, @@ -3857,10 +3983,14 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r MarkdownDescription: `The filter type of the NetFlow Monitor Policy object.`, }, "netflow_monitor_policy_name": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The name of the NetFlow Monitor Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3873,17 +4003,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3899,17 +4037,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3933,13 +4079,18 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To L3 Outside object.`, }, "l3_outside_name": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The name of the L3 Outside object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3952,17 +4103,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -3978,17 +4137,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4011,6 +4178,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Route Control Profile object.`, }, "l3_outside_name": schema.StringAttribute{ @@ -4019,6 +4187,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the L3 Outside object.`, }, "route_control_profile_name": schema.StringAttribute{ @@ -4027,6 +4196,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Route Control Profile object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4039,17 +4209,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4065,17 +4243,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4097,6 +4283,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Dhcp Relay Policy object.`, }, "dhcp_relay_policy_name": schema.StringAttribute{ @@ -4105,6 +4292,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the DHCP Relay Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4117,17 +4305,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4143,17 +4339,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4175,6 +4379,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To End Point Retention Policy object.`, }, "resolve_action": schema.StringAttribute{ @@ -4194,6 +4399,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the Endpoint Retention Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4206,17 +4412,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4232,17 +4446,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4264,6 +4486,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To VRF object.`, }, "vrf_name": schema.StringAttribute{ @@ -4272,6 +4495,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the VRF object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4284,17 +4508,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4310,17 +4542,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4342,6 +4582,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To IGMP Snooping Policy object.`, }, "igmp_snooping_policy_name": schema.StringAttribute{ @@ -4350,6 +4591,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the IGMP Snooping Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4362,17 +4604,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4388,17 +4638,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4420,6 +4678,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To MLD Snooping Policy object.`, }, "mld_snooping_policy_name": schema.StringAttribute{ @@ -4428,6 +4687,7 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{}, MarkdownDescription: `The name of the MLD Snooping Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4440,17 +4700,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4466,17 +4734,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4494,17 +4770,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4520,17 +4804,25 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "key": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The key used to uniquely identify this configuration object.`, }, "value": schema.StringAttribute{ - Required: true, + Optional: true, + Computed: true, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, + Validators: []validator.String{ + MakeStringRequired(), + }, MarkdownDescription: `The value of the property.`, }, }, @@ -4944,6 +5236,15 @@ func getAndSetFvBDAttributes(ctx context.Context, diags *diag.Diagnostics, clien if attributeName == "ownerTag" { readData.OwnerTag = basetypes.NewStringValue(attributeValue.(string)) } + if attributeName == "pcTag" { + readData.PcTag = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "scope" { + readData.Scope = basetypes.NewStringValue(attributeValue.(string)) + } + if attributeName == "seg" { + readData.Seg = basetypes.NewStringValue(attributeValue.(string)) + } if attributeName == "type" { readData.Type = basetypes.NewStringValue(attributeValue.(string)) } diff --git a/internal/provider/resource_aci_bridge_domain_test.go b/internal/provider/resource_aci_bridge_domain_test.go index dff02c20a..facb2b5a1 100644 --- a/internal/provider/resource_aci_bridge_domain_test.go +++ b/internal/provider/resource_aci_bridge_domain_test.go @@ -83,6 +83,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "virtual_mac_address", "not-applicable"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "segment"), ), }, }, @@ -169,6 +172,12 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test", "virtual_mac_address", "not-applicable"), resource.TestCheckResourceAttr("aci_bridge_domain.allow_test_2", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test_2", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test_2", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test", "segment"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.allow_test_2", "segment"), ), }, }, @@ -214,6 +223,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), ), }, // Update with all config and verify default APIC values @@ -252,6 +264,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "no")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "00:22:BD:F8:19:FB"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), ), }, // Update with minimum config and verify config is unchanged @@ -260,6 +275,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("aci_bridge_domain.test", "name", "test_name"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), ), }, // Update with empty strings config or default value @@ -298,6 +316,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), ), }, // Import testing @@ -342,6 +363,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(5c)", ">=", resource.TestCheckResourceAttr("aci_bridge_domain.test", "drop_arp_with_multicast_smac", "yes")), resource.TestCheckResourceAttr("aci_bridge_domain.test", "virtual_mac_address", "not-applicable"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.1.key", "key_1"), @@ -415,6 +439,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { Config: testConfigFvBDChildrenRemoveFromConfigDependencyWithFvTenant + testConfigDataSourceSystem, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.1.key", "key_1"), @@ -642,6 +669,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { Config: testConfigFvBDChildrenRemoveOneDependencyWithFvTenant + testConfigDataSourceSystem, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "1"), @@ -790,6 +820,9 @@ func TestAccResourceFvBDWithFvTenant(t *testing.T) { Config: testConfigFvBDChildrenRemoveAllDependencyWithFvTenant + testConfigDataSourceSystem, ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "scope"), + resource.TestCheckResourceAttrSet("aci_bridge_domain.test", "segment"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotation", "annotation_1"), resource.TestCheckResourceAttr("aci_bridge_domain.test", "relation_to_end_point_retention_policy.annotations.#", "0"), diff --git a/internal/provider/resource_aci_endpoint_security_group.go b/internal/provider/resource_aci_endpoint_security_group.go index d5ef1ef78..8a82993fa 100644 --- a/internal/provider/resource_aci_endpoint_security_group.go +++ b/internal/provider/resource_aci_endpoint_security_group.go @@ -57,6 +57,7 @@ type FvESgResourceModel struct { PcEnfPref types.String `tfsdk:"intra_esg_isolation"` PcTag types.String `tfsdk:"pc_tag"` PrefGrMemb types.String `tfsdk:"preferred_group_member"` + Scope types.String `tfsdk:"scope"` Shutdown types.String `tfsdk:"admin_state"` FvRsCons types.Set `tfsdk:"relation_to_consumed_contracts"` FvRsConsIf types.Set `tfsdk:"relation_to_imported_contracts"` @@ -93,6 +94,7 @@ func getEmptyFvESgResourceModel() *FvESgResourceModel { PcEnfPref: basetypes.NewStringNull(), PcTag: basetypes.NewStringNull(), PrefGrMemb: basetypes.NewStringNull(), + Scope: basetypes.NewStringNull(), Shutdown: basetypes.NewStringNull(), FvRsCons: types.SetNull(types.ObjectType{ AttrTypes: map[string]attr.Type{ @@ -895,6 +897,7 @@ func (r *FvESgResource) UpgradeState(ctx context.Context) map[int64]resource.Sta PcEnfPref: priorStateData.PcEnfPref, PcTag: basetypes.NewStringNull(), PrefGrMemb: priorStateData.PrefGrMemb, + Scope: basetypes.NewStringNull(), Shutdown: basetypes.NewStringNull(), DeprecatedMatchT: priorStateData.MatchT, DeprecatedParentDn: priorStateData.ParentDn, @@ -1763,6 +1766,10 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, }, MarkdownDescription: `Parameter used to determine whether the ESG is part of the preferred group. Members of this group are allowed to communicate without contracts.`, }, + "scope": schema.StringAttribute{ + Computed: true, + MarkdownDescription: `The scope ID (L3-VNI) of the Endpoint Security Group object.`, + }, "admin_state": schema.StringAttribute{ Optional: true, Computed: true, @@ -2860,6 +2867,9 @@ func getAndSetFvESgAttributes(ctx context.Context, diags *diag.Diagnostics, clie if attributeName == "prefGrMemb" { readData.PrefGrMemb = basetypes.NewStringValue(attributeValue.(string)) } + if attributeName == "scope" { + readData.Scope = basetypes.NewStringValue(attributeValue.(string)) + } if attributeName == "shutdown" { readData.Shutdown = basetypes.NewStringValue(attributeValue.(string)) } diff --git a/internal/provider/resource_aci_endpoint_security_group_test.go b/internal/provider/resource_aci_endpoint_security_group_test.go index 2a79ac864..734522701 100644 --- a/internal/provider/resource_aci_endpoint_security_group_test.go +++ b/internal/provider/resource_aci_endpoint_security_group_test.go @@ -42,6 +42,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test", "admin_state", "no"), resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test_2", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test", "scope"), ), }, }, @@ -91,6 +92,8 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { resource.TestCheckResourceAttr("aci_endpoint_security_group.allow_test_2", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test", "pc_tag"), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test_2", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test", "scope"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.allow_test_2", "scope"), ), }, }, @@ -116,6 +119,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), ), }, // Update with all config and verify default APIC values @@ -134,6 +138,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), ), }, // Update with minimum config and verify config is unchanged @@ -143,6 +148,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "name", "test_name"), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), ), }, // Update with empty strings config or default value @@ -161,6 +167,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), ), }, // Import testing @@ -185,6 +192,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { composeAggregateTestCheckFuncWithVersion(t, "5.2(1g)", ">=", resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "admin_state", "no")), resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.1.key", "key_1"), @@ -242,6 +250,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.key", "key_0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.value", "value_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.1.key", "key_1"), @@ -405,6 +414,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.key", "key_1"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.0.value", "test_value"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "1"), @@ -476,6 +486,7 @@ func TestAccResourceFvESgWithFvAp(t *testing.T) { ExpectNonEmptyPlan: false, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "pc_tag"), + resource.TestCheckResourceAttrSet("aci_endpoint_security_group.test", "scope"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "annotations.#", "0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_consumed_contracts.#", "0"), resource.TestCheckResourceAttr("aci_endpoint_security_group.test", "relation_to_contract_masters.#", "0"), From 5db788383138bdeeb5de41f2b85691a43de48c75 Mon Sep 17 00:00:00 2001 From: akinross Date: Fri, 20 Dec 2024 12:05:40 +0100 Subject: [PATCH 4/4] [ignore] remove make string required for required attributes in single nested attributes --- gen/templates/resource.go.tmpl | 7 +---- .../provider/resource_aci_application_epg.go | 17 ----------- .../provider/resource_aci_bridge_domain.go | 28 ------------------- .../resource_aci_endpoint_security_group.go | 2 -- 4 files changed, 1 insertion(+), 53 deletions(-) diff --git a/gen/templates/resource.go.tmpl b/gen/templates/resource.go.tmpl index a8c24d345..a2003e526 100644 --- a/gen/templates/resource.go.tmpl +++ b/gen/templates/resource.go.tmpl @@ -2621,14 +2621,9 @@ var {{.ResourceClassName}}{{.ParentHierarchy}}Type = types.ObjectType{ stringplanmodifier.UseStateForUnknown(), }, {{- end}} - {{- if or .ValidValues $.TemplateProperties.HasReadOnlyProperties}} + {{- if or .ValidValues }} Validators: []validator.String{ - {{- if .ValidValues}} stringvalidator.OneOf({{- validatorString .ValidValues}}), - {{- end}} - {{- if or .IsNaming .IsRequired}} - MakeStringRequired(), - {{- end}} }, {{- end}} MarkdownDescription: `{{.Comment}}`, diff --git a/internal/provider/resource_aci_application_epg.go b/internal/provider/resource_aci_application_epg.go index ca4fb350f..459c36299 100644 --- a/internal/provider/resource_aci_application_epg.go +++ b/internal/provider/resource_aci_application_epg.go @@ -4035,7 +4035,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the EPG uSeg Block Statement object.`, }, "description": schema.StringAttribute{ @@ -4044,7 +4043,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The description of the EPG uSeg Block Statement object.`, }, "match": schema.StringAttribute{ @@ -4064,7 +4062,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the EPG uSeg Block Statement object.`, }, "name_alias": schema.StringAttribute{ @@ -4073,7 +4070,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name alias of the EPG uSeg Block Statement object.`, }, "owner_key": schema.StringAttribute{ @@ -4082,7 +4078,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The key for enabling clients to own their data for entity correlation.`, }, "owner_tag": schema.StringAttribute{ @@ -4091,7 +4086,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, "precedence": schema.StringAttribute{ @@ -4100,7 +4094,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The precedence of the EPG uSeg Block Statement object.`, }, "scope": schema.StringAttribute{ @@ -4198,7 +4191,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To Application EPG Monitoring Policy object.`, }, "monitoring_policy_name": schema.StringAttribute{ @@ -4207,7 +4199,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the monitoring policy.`, }, "annotations": schema.SetNestedAttribute{ @@ -4294,7 +4285,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To Bridge Domain object.`, }, "bridge_domain_name": schema.StringAttribute{ @@ -4303,7 +4293,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the bridge domain associated with this EPG.`, }, "annotations": schema.SetNestedAttribute{ @@ -4620,7 +4609,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To Custom Qos Policy object.`, }, "custom_qos_policy_name": schema.StringAttribute{ @@ -4629,7 +4617,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The Custom QoS traffic policy name.`, }, "annotations": schema.SetNestedAttribute{ @@ -5049,7 +5036,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To Data Plane Policing Policy object.`, }, "data_plane_policing_policy_name": schema.StringAttribute{ @@ -5058,7 +5044,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `Name.`, }, "annotations": schema.SetNestedAttribute{ @@ -6000,7 +5985,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To Trust Control Policy object.`, }, "trust_control_policy_name": schema.StringAttribute{ @@ -6009,7 +5993,6 @@ func (r *FvAEPgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `Name.`, }, "annotations": schema.SetNestedAttribute{ diff --git a/internal/provider/resource_aci_bridge_domain.go b/internal/provider/resource_aci_bridge_domain.go index 74fb8c445..ed2ec4a91 100644 --- a/internal/provider/resource_aci_bridge_domain.go +++ b/internal/provider/resource_aci_bridge_domain.go @@ -3408,7 +3408,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Legacy Mode object.`, }, "description": schema.StringAttribute{ @@ -3417,7 +3416,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The description of the Legacy Mode object.`, }, "encapsulation": schema.StringAttribute{ @@ -3426,9 +3424,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{ - MakeStringRequired(), - }, MarkdownDescription: `The VLAN or VXLAN encapsulation of the Legacy Mode object.`, }, "name": schema.StringAttribute{ @@ -3437,7 +3432,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the Legacy Mode object.`, }, "name_alias": schema.StringAttribute{ @@ -3446,7 +3440,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name alias of the Legacy Mode object.`, }, "owner_key": schema.StringAttribute{ @@ -3455,7 +3448,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The key for enabling clients to own their data for entity correlation.`, }, "owner_tag": schema.StringAttribute{ @@ -3464,7 +3456,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `A tag for enabling clients to add their own data. For example, to indicate who created this object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3678,7 +3669,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Monitoring Policy object.`, }, "monitoring_policy_name": schema.StringAttribute{ @@ -3687,7 +3677,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the Monitoring Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3774,7 +3763,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To First Hop Security Policy object.`, }, "first_hop_security_policy_name": schema.StringAttribute{ @@ -3783,7 +3771,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the First Hop Security Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -3870,7 +3857,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Neighbor Discovery Interface Policy object.`, }, "neighbor_discovery_interface_policy_name": schema.StringAttribute{ @@ -3879,7 +3865,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the Neighbor Discovery Interface Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4178,7 +4163,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Route Control Profile object.`, }, "l3_outside_name": schema.StringAttribute{ @@ -4187,7 +4171,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the L3 Outside object.`, }, "route_control_profile_name": schema.StringAttribute{ @@ -4196,7 +4179,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the Route Control Profile object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4283,7 +4265,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To Dhcp Relay Policy object.`, }, "dhcp_relay_policy_name": schema.StringAttribute{ @@ -4292,7 +4273,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the DHCP Relay Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4379,7 +4359,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation From Bridge Domain To End Point Retention Policy object.`, }, "resolve_action": schema.StringAttribute{ @@ -4399,7 +4378,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the Endpoint Retention Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4486,7 +4464,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To VRF object.`, }, "vrf_name": schema.StringAttribute{ @@ -4495,7 +4472,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the VRF object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4582,7 +4558,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To IGMP Snooping Policy object.`, }, "igmp_snooping_policy_name": schema.StringAttribute{ @@ -4591,7 +4566,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the IGMP Snooping Policy object.`, }, "annotations": schema.SetNestedAttribute{ @@ -4678,7 +4652,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To MLD Snooping Policy object.`, }, "mld_snooping_policy_name": schema.StringAttribute{ @@ -4687,7 +4660,6 @@ func (r *FvBDResource) Schema(ctx context.Context, req resource.SchemaRequest, r PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the MLD Snooping Policy object.`, }, "annotations": schema.SetNestedAttribute{ diff --git a/internal/provider/resource_aci_endpoint_security_group.go b/internal/provider/resource_aci_endpoint_security_group.go index 8a82993fa..ece943402 100644 --- a/internal/provider/resource_aci_endpoint_security_group.go +++ b/internal/provider/resource_aci_endpoint_security_group.go @@ -2256,7 +2256,6 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The annotation of the Relation To VRF object.`, }, "vrf_name": schema.StringAttribute{ @@ -2265,7 +2264,6 @@ func (r *FvESgResource) Schema(ctx context.Context, req resource.SchemaRequest, PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, - Validators: []validator.String{}, MarkdownDescription: `The name of the VRF object.`, }, "annotations": schema.SetNestedAttribute{