Skip to content

Commit ee8e4a2

Browse files
committed
[minor_change] Added name to aci_l3_ext_subnet legacy resource and update aci-go-client files
1 parent dcb4740 commit ee8e4a2

File tree

9 files changed

+28
-11
lines changed

9 files changed

+28
-11
lines changed

aci/data_source_aci_l3extsubnet.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ func dataSourceAciL3ExtSubnet() *schema.Resource {
2626
Type: schema.TypeString,
2727
Required: true,
2828
},
29-
29+
"name": &schema.Schema{
30+
Type: schema.TypeString,
31+
Computed: true,
32+
},
3033
"aggregate": &schema.Schema{
3134
Type: schema.TypeString,
3235
Optional: true,

aci/resource_aci_l3extsubnet.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ func resourceAciL3ExtSubnet() *schema.Resource {
5858
Required: true,
5959
ForceNew: true,
6060
},
61-
61+
"name": &schema.Schema{
62+
Type: schema.TypeString,
63+
Optional: true,
64+
},
6265
"aggregate": &schema.Schema{
6366
Type: schema.TypeString,
6467
Optional: true,
@@ -193,6 +196,7 @@ func setL3ExtSubnetAttributes(l3extSubnet *models.L3ExtSubnet, d *schema.Resourc
193196

194197
d.Set("external_network_instance_profile_dn", GetParentDn(dn, fmt.Sprintf("/extsubnet-[%s]", l3extSubnetMap["ip"])))
195198
d.Set("ip", l3extSubnetMap["ip"])
199+
d.Set("name", l3extSubnetMap["name"])
196200

197201
if l3extSubnetMap["aggregate"] == "" {
198202
d.Set("aggregate", "none")
@@ -201,7 +205,6 @@ func setL3ExtSubnetAttributes(l3extSubnet *models.L3ExtSubnet, d *schema.Resourc
201205
}
202206

203207
d.Set("annotation", l3extSubnetMap["annotation"])
204-
d.Set("ip", l3extSubnetMap["ip"])
205208
d.Set("name_alias", l3extSubnetMap["nameAlias"])
206209

207210
scpGet := make([]string, 0, 1)
@@ -299,6 +302,7 @@ func resourceAciL3ExtSubnetCreate(ctx context.Context, d *schema.ResourceData, m
299302
desc := d.Get("description").(string)
300303

301304
ip := d.Get("ip").(string)
305+
name := d.Get("name").(string)
302306

303307
ExternalNetworkInstanceProfileDn := d.Get("external_network_instance_profile_dn").(string)
304308

@@ -318,6 +322,7 @@ func resourceAciL3ExtSubnetCreate(ctx context.Context, d *schema.ResourceData, m
318322
if Ip, ok := d.GetOk("ip"); ok {
319323
l3extSubnetAttr.Ip = Ip.(string)
320324
}
325+
l3extSubnetAttr.Name = name
321326
if NameAlias, ok := d.GetOk("name_alias"); ok {
322327
l3extSubnetAttr.NameAlias = NameAlias.(string)
323328
}
@@ -329,7 +334,7 @@ func resourceAciL3ExtSubnetCreate(ctx context.Context, d *schema.ResourceData, m
329334
scp := strings.Join(scpList, ",")
330335
l3extSubnetAttr.Scope = scp
331336
}
332-
l3extSubnet := models.NewL3ExtSubnet(fmt.Sprintf("extsubnet-[%s]", ip), ExternalNetworkInstanceProfileDn, desc, l3extSubnetAttr)
337+
l3extSubnet := models.NewL3ExtSubnet(fmt.Sprintf("extsubnet-[%s]", ip), ExternalNetworkInstanceProfileDn, desc, name, l3extSubnetAttr)
333338

334339
err := aciClient.Save(l3extSubnet)
335340
if err != nil {
@@ -384,6 +389,7 @@ func resourceAciL3ExtSubnetUpdate(ctx context.Context, d *schema.ResourceData, m
384389
desc := d.Get("description").(string)
385390

386391
ip := d.Get("ip").(string)
392+
name := d.Get("name").(string)
387393

388394
ExternalNetworkInstanceProfileDn := d.Get("external_network_instance_profile_dn").(string)
389395

@@ -406,6 +412,7 @@ func resourceAciL3ExtSubnetUpdate(ctx context.Context, d *schema.ResourceData, m
406412
if NameAlias, ok := d.GetOk("name_alias"); ok {
407413
l3extSubnetAttr.NameAlias = NameAlias.(string)
408414
}
415+
l3extSubnetAttr.Name = name
409416
if Scope, ok := d.GetOk("scope"); ok {
410417
scpList := make([]string, 0, 1)
411418
for _, val := range Scope.([]interface{}) {
@@ -414,7 +421,7 @@ func resourceAciL3ExtSubnetUpdate(ctx context.Context, d *schema.ResourceData, m
414421
scp := strings.Join(scpList, ",")
415422
l3extSubnetAttr.Scope = scp
416423
}
417-
l3extSubnet := models.NewL3ExtSubnet(fmt.Sprintf("extsubnet-[%s]", ip), ExternalNetworkInstanceProfileDn, desc, l3extSubnetAttr)
424+
l3extSubnet := models.NewL3ExtSubnet(fmt.Sprintf("extsubnet-[%s]", ip), ExternalNetworkInstanceProfileDn, desc, name, l3extSubnetAttr)
418425

419426
l3extSubnet.Status = "modified"
420427

examples/l3_ext_subnet/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ resource "aci_l3_ext_subnet" "foo_subnet" {
7373
external_network_instance_profile_dn = aci_external_network_instance_profile.foo_external_network_instance_profile.id
7474
description = "Sample L3 External subnet"
7575
ip = "10.0.3.28/27"
76+
name = "l3_ext_subnet"
7677
aggregate = "shared-rtctrl"
7778
annotation = "tag_ext_subnet"
7879
name_alias = "alias_ext_subnet"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.23.0
55
toolchain go1.24.0
66

77
require (
8-
github.com/ciscoecosystem/aci-go-client/v2 v2.31.2
8+
github.com/ciscoecosystem/aci-go-client/v2 v2.32.0
99
github.com/ghodss/yaml v1.0.0
1010
github.com/hashicorp/go-cty v1.5.0
1111
github.com/hashicorp/go-version v1.7.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew
1111
github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4=
1212
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
1313
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
14-
github.com/ciscoecosystem/aci-go-client/v2 v2.31.2 h1:NDFyOrFo/K9U5cuK+AER4uXDtC5QqGvaSaOa/Zlrll8=
15-
github.com/ciscoecosystem/aci-go-client/v2 v2.31.2/go.mod h1:j6/l+P1/hqfkzZxKQTel82xLsLYEgbgSyZNxLglgukk=
14+
github.com/ciscoecosystem/aci-go-client/v2 v2.32.0 h1:io2CIG8QDWqu5bhNoKIKYMNf4myCaNjZezY47gTVepo=
15+
github.com/ciscoecosystem/aci-go-client/v2 v2.32.0/go.mod h1:j6/l+P1/hqfkzZxKQTel82xLsLYEgbgSyZNxLglgukk=
1616
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
1717
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
1818
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=

legacy-docs/docs/d/l3_ext_subnet.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ data "aci_l3_ext_subnet" "example" {
3939
## Attribute Reference ##
4040

4141
* `id` - Attribute id set to the Dn of the External EPG Subnet object.
42+
* `name` - (Read-Only) Name of the External EPG Subnet object.
4243
* `aggregate` - (Optional) Aggregate Routes of the External EPG Subnet object.
4344
* `annotation` - (Optional) Annotation of the External EPG Subnet object.
4445
* `description` - (Optional) Description of the External EPG Subnet object.

legacy-docs/docs/r/l3_ext_subnet.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Manages ACI External EPG Subnet
2828
external_network_instance_profile_dn = aci_external_network_instance_profile.example.id
2929
description = "Sample L3 External subnet"
3030
ip = "10.0.3.28/27"
31+
name = "l3_ext_subnet"
3132
aggregate = "shared-rtctrl"
3233
annotation = "tag_ext_subnet"
3334
name_alias = "alias_ext_subnet"
@@ -48,6 +49,7 @@ Manages ACI External EPG Subnet
4849

4950
* `external_network_instance_profile_dn` - (Required) Distinguished name of the parent External Network Instance Profile object.
5051
* `ip` - (Required) ip of the External EPG Subnet object.
52+
* `name` - (Optional) Name of the External EPG Subnet object.
5153
* `aggregate` - (Optional) Aggregate Routes of the External EPG Subnet object. Allowed values are "import-rtctrl", "export-rtctrl", "shared-rtctrl" and "none".
5254
* `annotation` - (Optional) annotation of the External EPG Subnet object.
5355
* `description` - (Optional) Description of the External EPG Subnet object.

vendor/github.com/ciscoecosystem/aci-go-client/v2/models/l3ext_subnet.go

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ github.com/agext/levenshtein
2828
# github.com/apparentlymart/go-textseg/v15 v15.0.0
2929
## explicit; go 1.16
3030
github.com/apparentlymart/go-textseg/v15/textseg
31-
# github.com/ciscoecosystem/aci-go-client/v2 v2.31.2
31+
# github.com/ciscoecosystem/aci-go-client/v2 v2.32.0
3232
## explicit; go 1.21
3333
github.com/ciscoecosystem/aci-go-client/v2/client
3434
github.com/ciscoecosystem/aci-go-client/v2/container

0 commit comments

Comments
 (0)