Skip to content

Commit 7844a28

Browse files
tas50claude
andauthored
⭐ Add BGP, MLAG, ACL resources and extend existing Arista EOS resources (#6559)
New resources: - arista.eos.bgp: BGP configuration with enabled, asNumber, routerId - arista.eos.bgp.vrf: per-VRF BGP state with peers - arista.eos.bgp.peer: BGP neighbor details (state, uptime, prefixes, route maps) - arista.eos.mlag: MLAG configuration (domainId, localInterface, peerAddress, peerLink, shutdown) - arista.eos.mlag.interface: Port-Channel to MLAG ID mappings - arista.eos.acl: standard IP access control lists - arista.eos.acl.entry: ACL rules (sequenceNumber, action, srcAddress, log) New fields on existing resources: - arista.eos.user: locked - arista.eos.interface: enabled, duplex, autoNegotiate - arista.eos.vlan: dynamic, interfaces - arista.eos.route: active BGP and MLAG fields use lazy-loaded computed methods with Internal struct caching to avoid "cannot convert primitive with NO type information" errors when the resource is accessed directly rather than through the parent accessor. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2116076 commit 7844a28

File tree

14 files changed

+2320
-15
lines changed

14 files changed

+2320
-15
lines changed

.github/actions/spelling/expect.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ aad
22
ACCOUNTADMIN
33
ACTIVEMQ
44
advancedthreatprotection
5-
artifactregistry
65
alloydb
76
alpn
87
antispam
98
appslot
109
arp
10+
artifactregistry
1111
atlassian
1212
auditlog
1313
Auths
1414
autoaccept
1515
autoclose
1616
autoexpand
17-
autoreplace
18-
autotrim
1917
autoprovision
18+
autoreplace
2019
Autoscalers
20+
autotrim
2121
awsapps
2222
awslogs
2323
awsvpc
@@ -34,13 +34,13 @@ cdn
3434
certificatechains
3535
ciscocatalyst
3636
clcerts
37-
cname
3837
cloudflare
3938
Clusterwide
4039
cmek
4140
cmnd
42-
cooldown
41+
cname
4342
compressratio
43+
cooldown
4444
copywrite
4545
cpe
4646
cryptokey
@@ -57,12 +57,12 @@ dedupratio
5757
deliverychannel
5858
dfw
5959
directoryservice
60-
documentdb
61-
draid
6260
dlp
6361
dlq
6462
dlv
6563
dnskey
64+
documentdb
65+
draid
6666
dsse
6767
eas
6868
Ecmp
@@ -79,9 +79,9 @@ filestore
7979
filesz
8080
firefox
8181
firestore
82-
fortios
8382
FLEXGROUP
8483
FLEXVOL
84+
fortios
8585
frontmatter
8686
ftps
8787
fumadocs
@@ -114,8 +114,8 @@ ipsetforwardedipconfig
114114
ipsetreferencestatement
115115
istio
116116
jira
117-
junos
118117
jsonbody
118+
junos
119119
kqueue
120120
KSK
121121
labelmatchstatement
@@ -131,17 +131,18 @@ managedzone
131131
maxmemory
132132
mcp
133133
mcr
134-
memorydb
135134
meid
135+
memorydb
136136
messagestoragepolicy
137137
mfs
138138
mgroup
139139
minfree
140140
MINIMALUSER
141141
mkey
142-
MULTIAZ
143-
msk
142+
mlag
144143
Mpim
144+
msk
145+
MULTIAZ
145146
naflags
146147
natgateway
147148
networkfirewall
@@ -186,8 +187,8 @@ pushconfig
186187
Pzi
187188
pzs
188189
querypack
189-
raidz
190190
RABBITMQ
191+
raidz
191192
ratebasedstatement
192193
recaptcha
193194
regexmatchstatement
@@ -234,16 +235,15 @@ toplevel
234235
tpu
235236
transitgateway
236237
udid
237-
UNAVAIL
238238
uefi
239+
UNAVAIL
239240
Uocm
240241
usb
241242
Utc
242243
valkey
243244
VAULTNAME
244245
vdcs
245246
vdev
246-
vdevs
247247
VGeneration
248248
virtualmachine
249249
vlans

providers/arista/resources/arista.lr

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ arista.eos {
3232
routes() []arista.eos.route
3333
// Layer 2 switchport configurations
3434
switchports() []arista.eos.switchport
35+
// BGP configuration and peers
36+
bgp() arista.eos.bgp
37+
// MLAG high-availability configuration
38+
mlag() arista.eos.mlag
39+
// Standard IP access control lists
40+
acls() []arista.eos.acl
3541
}
3642

3743
// Arista EOS system's operating configuration
@@ -64,6 +70,8 @@ arista.eos.user @defaults("name privilege") {
6470
secret string
6571
// User's sshkey
6672
sshkey string
73+
// Whether the account is locked
74+
locked() bool
6775
}
6876

6977
// Arista EOS role resource
@@ -126,6 +134,12 @@ private arista.eos.interface @defaults("name") {
126134
physicalAddress string
127135
// Interface link status, vlan, duplex, speed, and type
128136
status() dict
137+
// Whether the interface is enabled administratively
138+
enabled() bool
139+
// Duplex setting (full, half, auto)
140+
duplex() string
141+
// Auto-negotiation enabled
142+
autoNegotiate() bool
129143
}
130144

131145
// Arista EOS IP interface
@@ -205,6 +219,10 @@ arista.eos.vlan @defaults("id name") {
205219
state string
206220
// Trunk groups associated with the VLAN
207221
trunkGroups []string
222+
// Whether this is a dynamic VLAN
223+
dynamic bool
224+
// Interfaces assigned to this VLAN
225+
interfaces() []string
208226
}
209227

210228
// Arista EOS IP route entry
@@ -227,6 +245,8 @@ arista.eos.route @defaults("destination") {
227245
routeAction string
228246
// Next-hop information (interface, nexthop address)
229247
nextHops []dict
248+
// Whether the route is active
249+
active() bool
230250
}
231251

232252
// Arista EOS Layer 2 switchport configuration
@@ -244,3 +264,101 @@ arista.eos.switchport @defaults("name mode") {
244264
// Trunk groups
245265
trunkGroups []string
246266
}
267+
268+
// Arista EOS BGP configuration
269+
arista.eos.bgp {
270+
// Whether BGP is enabled on this device
271+
enabled() bool
272+
// BGP Autonomous System Number
273+
asNumber() string
274+
// BGP Router ID
275+
routerId() string
276+
// BGP VRFs
277+
vrfs() []arista.eos.bgp.vrf
278+
}
279+
280+
// Arista EOS BGP VRF
281+
private arista.eos.bgp.vrf @defaults("name") {
282+
// VRF name
283+
name string
284+
// BGP Router ID for this VRF
285+
routerId string
286+
// BGP Autonomous System Number for this VRF
287+
asNumber string
288+
// BGP peers in this VRF
289+
peers []arista.eos.bgp.peer
290+
}
291+
292+
// Arista EOS BGP peer
293+
private arista.eos.bgp.peer @defaults("peerAddress") {
294+
// VRF name
295+
vrfName string
296+
// Peer IP address
297+
peerAddress string
298+
// Remote Autonomous System Number
299+
remoteAs string
300+
// Peer state (Established, Idle, Active, etc.)
301+
state string
302+
// Uptime in seconds
303+
uptime int
304+
// Number of prefixes received from peer
305+
prefixesReceived int
306+
// Number of prefixes accepted from peer (after inbound filtering)
307+
prefixesAccepted int
308+
// Inbound route map
309+
inboundRouteMap string
310+
// Outbound route map
311+
outboundRouteMap string
312+
// Peer description
313+
description string
314+
}
315+
316+
// Arista EOS MLAG (Multi-Chassis Link Aggregation) configuration
317+
arista.eos.mlag {
318+
// MLAG domain ID
319+
domainId() string
320+
// Local interface used for MLAG communication (typically a VLAN interface)
321+
localInterface() string
322+
// IP address of the MLAG peer switch
323+
peerAddress() string
324+
// Interface used as the peer-link (typically a Port-Channel)
325+
peerLink() string
326+
// Whether MLAG is administratively shutdown
327+
shutdown() bool
328+
// Port-Channel interfaces configured with MLAG IDs
329+
interfaces() []arista.eos.mlag.interface
330+
}
331+
332+
// Arista EOS MLAG interface (Port-Channel with MLAG ID)
333+
private arista.eos.mlag.interface @defaults("name mlagId") {
334+
// Port-Channel interface name (e.g., "Port-Channel1")
335+
name string
336+
// MLAG ID assigned to this Port-Channel
337+
mlagId string
338+
}
339+
340+
// Arista EOS standard IP access control list
341+
arista.eos.acl @defaults("name") {
342+
// ACL name
343+
name string
344+
// ACL type (currently only "standard" supported by SDK)
345+
type string
346+
// ACL entries (rules)
347+
entries() []arista.eos.acl.entry
348+
}
349+
350+
// Arista EOS ACL entry (rule)
351+
private arista.eos.acl.entry @defaults("sequenceNumber action") {
352+
// ACL name this entry belongs to
353+
aclName string
354+
// Sequence number (determines evaluation order)
355+
sequenceNumber int
356+
// Action: "permit" or "deny"
357+
action string
358+
// Source IP address
359+
srcAddress string
360+
// Source prefix length (CIDR notation, e.g., 24 for /24)
361+
srcPrefixLen int
362+
// Whether logging is enabled for this rule
363+
log bool
364+
}

0 commit comments

Comments
 (0)