From f829cf70d1750270bf9b24a4018fa2cc80022ac6 Mon Sep 17 00:00:00 2001 From: akinross Date: Thu, 2 May 2024 14:37:30 +0200 Subject: [PATCH 1/3] [bugfix] Prevent error by setting flood_on_encap and prio for aci_endpoint_security_group --- aci/resource_aci_fvesg.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/aci/resource_aci_fvesg.go b/aci/resource_aci_fvesg.go index f23866116..1771ff819 100644 --- a/aci/resource_aci_fvesg.go +++ b/aci/resource_aci_fvesg.go @@ -206,13 +206,11 @@ func setEndpointSecurityGroupAttributes(fvESg *models.EndpointSecurityGroup, d * return d, err } d.Set("annotation", fvESgMap["annotation"]) - d.Set("flood_on_encap", fvESgMap["floodOnEncap"]) d.Set("match_t", fvESgMap["matchT"]) d.Set("name", fvESgMap["name"]) d.Set("application_profile_dn", GetParentDn(fvESg.DistinguishedName, fmt.Sprintf("/esg-%s", fvESgMap["name"]))) d.Set("pc_enf_pref", fvESgMap["pcEnfPref"]) d.Set("pref_gr_memb", fvESgMap["prefGrMemb"]) - d.Set("prio", fvESgMap["prio"]) d.Set("name_alias", fvESgMap["nameAlias"]) return d, nil } @@ -251,10 +249,6 @@ func resourceAciEndpointSecurityGroupCreate(ctx context.Context, d *schema.Resou fvESgAttr.Annotation = "{}" } - if FloodOnEncap, ok := d.GetOk("flood_on_encap"); ok { - fvESgAttr.FloodOnEncap = FloodOnEncap.(string) - } - if MatchT, ok := d.GetOk("match_t"); ok { fvESgAttr.MatchT = MatchT.(string) } @@ -271,9 +265,6 @@ func resourceAciEndpointSecurityGroupCreate(ctx context.Context, d *schema.Resou fvESgAttr.PrefGrMemb = PrefGrMemb.(string) } - if Prio, ok := d.GetOk("prio"); ok { - fvESgAttr.Prio = Prio.(string) - } fvESg := models.NewEndpointSecurityGroup(fmt.Sprintf("esg-%s", name), ApplicationProfileDn, desc, nameAlias, fvESgAttr) err := aciClient.Save(fvESg) @@ -450,10 +441,6 @@ func resourceAciEndpointSecurityGroupUpdate(ctx context.Context, d *schema.Resou fvESgAttr.Annotation = "{}" } - if FloodOnEncap, ok := d.GetOk("flood_on_encap"); ok { - fvESgAttr.FloodOnEncap = FloodOnEncap.(string) - } - if MatchT, ok := d.GetOk("match_t"); ok { fvESgAttr.MatchT = MatchT.(string) } @@ -470,9 +457,6 @@ func resourceAciEndpointSecurityGroupUpdate(ctx context.Context, d *schema.Resou fvESgAttr.PrefGrMemb = PrefGrMemb.(string) } - if Prio, ok := d.GetOk("prio"); ok { - fvESgAttr.Prio = Prio.(string) - } fvESg := models.NewEndpointSecurityGroup(fmt.Sprintf("esg-%s", name), ApplicationProfileDn, desc, nameAlias, fvESgAttr) fvESg.Status = "modified" From 72d6e95aed402d67370db356b0589532a09f1465 Mon Sep 17 00:00:00 2001 From: akinross Date: Fri, 3 May 2024 07:59:42 +0200 Subject: [PATCH 2/3] [minor_change] Remove flood_on_encap and prio from schema and change the non required attributes to read-only in aci_endpoint_security datasource --- aci/data_source_aci_fvesg.go | 14 -------------- docs/data-sources/endpoint_security_group.md | 18 +++++++----------- .../d/endpoint_security_group.html.markdown | 18 +++++++----------- 3 files changed, 14 insertions(+), 36 deletions(-) diff --git a/aci/data_source_aci_fvesg.go b/aci/data_source_aci_fvesg.go index 316df3894..5c5fa4dcf 100644 --- a/aci/data_source_aci_fvesg.go +++ b/aci/data_source_aci_fvesg.go @@ -20,17 +20,10 @@ func dataSourceAciEndpointSecurityGroup() *schema.Resource { }, "annotation": { Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "flood_on_encap": { - Type: schema.TypeString, - Optional: true, Computed: true, }, "match_t": { Type: schema.TypeString, - Optional: true, Computed: true, }, "name": { @@ -39,17 +32,10 @@ func dataSourceAciEndpointSecurityGroup() *schema.Resource { }, "pc_enf_pref": { Type: schema.TypeString, - Optional: true, Computed: true, }, "pref_gr_memb": { Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "prio": { - Type: schema.TypeString, - Optional: true, Computed: true, }, })), diff --git a/docs/data-sources/endpoint_security_group.md b/docs/data-sources/endpoint_security_group.md index 41299e415..5fac73001 100644 --- a/docs/data-sources/endpoint_security_group.md +++ b/docs/data-sources/endpoint_security_group.md @@ -32,18 +32,14 @@ data "aci_endpoint_security_group" "example" { ## Argument Reference ## * `application_profile_dn` - (Required) Distinguished name of parent Application Profile object. -* `name` - (Required) name of object Endpoint Security Group. +* `name` - (Required) Name of object Endpoint Security Group. ## Attribute Reference ## * `id` - Attribute id set to the Dn of the Endpoint Security Group. -* `annotation` - (Optional) Annotation of object Endpoint Security Group. -* `description` - (Optional) Description of object Endpoint Security Group. -* `name_alias` - (Optional) Name Alias of object Endpoint Security Group. -* `flood_on_encap` - (Optional) Handles L2 Multicast/Broadcast and Link-Layer traffic at EPG level. It represents Control at EPG level and decides if the traffic L2 Multicast/Broadcast and Link Local Layer should be flooded only on ENCAP, or based on bridge-domain settings. -* `match_t` - (Optional) The provider label match criteria. -* `pc_enf_pref` - (Optional) The preferred policy control. -* `pref_gr_memb` - (Optional) Represents parameter used to determine - if EPg is part of a group that does not - a contract for communication. -* `prio` - (Optional) The QoS priority class identifier. +* `annotation` - (Read-Only) Annotation of object Endpoint Security Group. +* `description` - (Read-Only) Description of object Endpoint Security Group. +* `name_alias` - (Read-Only) Name Alias of object Endpoint Security Group. +* `match_t` - (Read-Only) The provider label match criteria. +* `pc_enf_pref` - (Read-Only) The preferred policy control. +* `pref_gr_memb` - (Read-Only) Represents parameter used to determine if EPg is part of a group that does not a contract for communication. diff --git a/legacy-docs/docs/d/endpoint_security_group.html.markdown b/legacy-docs/docs/d/endpoint_security_group.html.markdown index 41299e415..5fac73001 100644 --- a/legacy-docs/docs/d/endpoint_security_group.html.markdown +++ b/legacy-docs/docs/d/endpoint_security_group.html.markdown @@ -32,18 +32,14 @@ data "aci_endpoint_security_group" "example" { ## Argument Reference ## * `application_profile_dn` - (Required) Distinguished name of parent Application Profile object. -* `name` - (Required) name of object Endpoint Security Group. +* `name` - (Required) Name of object Endpoint Security Group. ## Attribute Reference ## * `id` - Attribute id set to the Dn of the Endpoint Security Group. -* `annotation` - (Optional) Annotation of object Endpoint Security Group. -* `description` - (Optional) Description of object Endpoint Security Group. -* `name_alias` - (Optional) Name Alias of object Endpoint Security Group. -* `flood_on_encap` - (Optional) Handles L2 Multicast/Broadcast and Link-Layer traffic at EPG level. It represents Control at EPG level and decides if the traffic L2 Multicast/Broadcast and Link Local Layer should be flooded only on ENCAP, or based on bridge-domain settings. -* `match_t` - (Optional) The provider label match criteria. -* `pc_enf_pref` - (Optional) The preferred policy control. -* `pref_gr_memb` - (Optional) Represents parameter used to determine - if EPg is part of a group that does not - a contract for communication. -* `prio` - (Optional) The QoS priority class identifier. +* `annotation` - (Read-Only) Annotation of object Endpoint Security Group. +* `description` - (Read-Only) Description of object Endpoint Security Group. +* `name_alias` - (Read-Only) Name Alias of object Endpoint Security Group. +* `match_t` - (Read-Only) The provider label match criteria. +* `pc_enf_pref` - (Read-Only) The preferred policy control. +* `pref_gr_memb` - (Read-Only) Represents parameter used to determine if EPg is part of a group that does not a contract for communication. From 6f0336954fa230238c87ec40a96e47507bb82cba Mon Sep 17 00:00:00 2001 From: akinross Date: Mon, 6 May 2024 18:36:24 +0200 Subject: [PATCH 3/3] [ignore] Documentations updates --- docs/data-sources/endpoint_security_group.md | 10 +++++----- .../docs/d/endpoint_security_group.html.markdown | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/data-sources/endpoint_security_group.md b/docs/data-sources/endpoint_security_group.md index 5fac73001..13bd6200d 100644 --- a/docs/data-sources/endpoint_security_group.md +++ b/docs/data-sources/endpoint_security_group.md @@ -32,14 +32,14 @@ data "aci_endpoint_security_group" "example" { ## Argument Reference ## * `application_profile_dn` - (Required) Distinguished name of parent Application Profile object. -* `name` - (Required) Name of object Endpoint Security Group. +* `name` - (Required) Name of the object Endpoint Security Group. ## Attribute Reference ## * `id` - Attribute id set to the Dn of the Endpoint Security Group. -* `annotation` - (Read-Only) Annotation of object Endpoint Security Group. -* `description` - (Read-Only) Description of object Endpoint Security Group. -* `name_alias` - (Read-Only) Name Alias of object Endpoint Security Group. +* `annotation` - (Read-Only) Annotation of the object Endpoint Security Group. +* `description` - (Read-Only) Description of the object Endpoint Security Group. +* `name_alias` - (Read-Only) Name Alias of the object Endpoint Security Group. * `match_t` - (Read-Only) The provider label match criteria. * `pc_enf_pref` - (Read-Only) The preferred policy control. -* `pref_gr_memb` - (Read-Only) Represents parameter used to determine if EPg is part of a group that does not a contract for communication. +* `pref_gr_memb` - (Read-Only) Represents parameter used to determine if EPG is part of a group that does not a contract for communication. diff --git a/legacy-docs/docs/d/endpoint_security_group.html.markdown b/legacy-docs/docs/d/endpoint_security_group.html.markdown index 5fac73001..13bd6200d 100644 --- a/legacy-docs/docs/d/endpoint_security_group.html.markdown +++ b/legacy-docs/docs/d/endpoint_security_group.html.markdown @@ -32,14 +32,14 @@ data "aci_endpoint_security_group" "example" { ## Argument Reference ## * `application_profile_dn` - (Required) Distinguished name of parent Application Profile object. -* `name` - (Required) Name of object Endpoint Security Group. +* `name` - (Required) Name of the object Endpoint Security Group. ## Attribute Reference ## * `id` - Attribute id set to the Dn of the Endpoint Security Group. -* `annotation` - (Read-Only) Annotation of object Endpoint Security Group. -* `description` - (Read-Only) Description of object Endpoint Security Group. -* `name_alias` - (Read-Only) Name Alias of object Endpoint Security Group. +* `annotation` - (Read-Only) Annotation of the object Endpoint Security Group. +* `description` - (Read-Only) Description of the object Endpoint Security Group. +* `name_alias` - (Read-Only) Name Alias of the object Endpoint Security Group. * `match_t` - (Read-Only) The provider label match criteria. * `pc_enf_pref` - (Read-Only) The preferred policy control. -* `pref_gr_memb` - (Read-Only) Represents parameter used to determine if EPg is part of a group that does not a contract for communication. +* `pref_gr_memb` - (Read-Only) Represents parameter used to determine if EPG is part of a group that does not a contract for communication.