diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f2a8d72..b66b1ba4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [1.59.3](https://github.com/terraform-routeros/terraform-provider-routeros/compare/v1.59.2...v1.59.3) (2024-08-12) + + +### Bug Fixes + +* Add missing attributes, add fields to ignore. Fix wrong `new_dst_ports` type ([c570002](https://github.com/terraform-routeros/terraform-provider-routeros/commit/c570002b40171054b85b62a1e59b2dc907791100)), closes [#538](https://github.com/terraform-routeros/terraform-provider-routeros/issues/538) +* **netwatch:** Add `http_codes` attribute to skip fields. ([e7d0356](https://github.com/terraform-routeros/terraform-provider-routeros/commit/e7d03563143c4a70e7052cb8652513f375e4bfb3)) + ## [1.59.2](https://github.com/terraform-routeros/terraform-provider-routeros/compare/v1.59.1...v1.59.2) (2024-08-07) diff --git a/docs/resources/interface_ethernet_switch.md b/docs/resources/interface_ethernet_switch.md index cc153ab2..c33a8fcf 100644 --- a/docs/resources/interface_ethernet_switch.md +++ b/docs/resources/interface_ethernet_switch.md @@ -20,6 +20,7 @@ resource "routeros_interface_ethernet_switch" "sw0" { - `cpu_flow_control` (Boolean) All switch chips have a special port that is called switchX-cpu, this is the CPU port for a switch chip, it is meant to forward traffic from a switch chip to the CPU, such a port is required for management traffic and for routing features. By default the switch chip ensures that this special CPU port is not congested and sends out Pause Frames when link capacity is exceeded to make sure the port is not oversaturated, this feature is called CPU Flow Control. Without this feature packets that might be crucial for routing or management purposes might get dropped. - `l3_hw_offloading` (Boolean) Layer 3 Hardware Offloading (L3HW, otherwise known as IP switching or HW routing) allows to offload some router features onto the switch chip. This allows reaching wire speeds when routing packets, which simply would not be possible with the CPU. +- `mirror_egress_target` (String) Selects a single mirroring egress target port, only available on 88E6393X, 88E6191X and 88E6190 switch chips. Mirrored packets from `mirror-egress` (see the property in port menu) will be sent to the selected port. - `mirror_source` (String) Selects a single mirroring source port. Ingress and egress traffic will be sent to the mirror-target port. Note that mirror-target port has to belong to the same switch (see which port belongs to which switch in /interface ethernet menu). - `mirror_target` (String) Selects a single mirroring target port. Mirrored packets from mirror-source and mirror (see the property in rule and host table) will be sent to the selected port. - `switch_id` (String) Switch-chip id. Default .id = *0 diff --git a/docs/resources/interface_ethernet_switch_port.md b/docs/resources/interface_ethernet_switch_port.md index 07475298..d88b9ea1 100644 --- a/docs/resources/interface_ethernet_switch_port.md +++ b/docs/resources/interface_ethernet_switch_port.md @@ -19,6 +19,9 @@ resource "routeros_interface_ethernet_switch_port" "test" { ### Optional - `default_vlan_id` (String) Adds a VLAN tag with the specified VLAN ID on all untagged ingress traffic on a port, should be used with ```vlan-header``` set to ```always-strip``` on a port to configure the port to be the access port. For hybrid ports ```default-vlan-id``` is used to tag untagged traffic. If two ports have the same ```default-vlan-id```, then VLAN tag is not added since the switch chip assumes that traffic is being forwarded between access ports. +- `mirror_egress` (Boolean) Whether to send egress packet copy to the `mirror-egress-target` port, only available on 88E6393X, 88E6191X and 88E6190 switch chips. +- `mirror_ingress` (Boolean) Whether to send ingress packet copy to the `mirror-ingress-target` port, only available on 88E6393X, 88E6191X and 88E6190 switch chips. +- `mirror_ingress_target` (String) Selects a single mirroring ingress target port, only available on 88E6393X, 88E6191X and 88E6190 switch chips. Mirrored packets from `mirror-ingress` will be sent to the selected port. - `vlan_header` (String) Sets action which is performed on the port for egress traffic. - `vlan_mode` (String) Changes the VLAN lookup mechanism against the VLAN Table for ingress traffic. @@ -26,6 +29,7 @@ resource "routeros_interface_ethernet_switch_port" "test" { - `id` (String) The ID of this resource. - `invalid` (Boolean) +- `running` (Boolean) - `switch` (String) Name of the switch. ## Import diff --git a/docs/resources/interface_ethernet_switch_rule.md b/docs/resources/interface_ethernet_switch_rule.md index a12bb7c5..a6ca6304 100644 --- a/docs/resources/interface_ethernet_switch_rule.md +++ b/docs/resources/interface_ethernet_switch_rule.md @@ -31,7 +31,8 @@ resource "routeros_interface_ethernet_switch_rule" "test" { - `flow_label` (Number) Matching IPv6 flow label. - `mac_protocol` (String) Matching particular MAC protocol specified by protocol name or number (skips VLAN tags if any). - `mirror` (Boolean) Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address (matching destination or source address for CRS3xx series switches). -- `new_dst_ports` (String) Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted. +- `mirror_ports` (Set of String) Selects multiple mirroring target ports, only available on 88E6393X switch chip. Matched packets in the ACL rule will be copied and sent to selected ports. +- `new_dst_ports` (Set of String) Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty setting will drop the packet. When the parameter is not used, the packet will be accepted. - `new_vlan_id` (Number) Changes the VLAN ID to the specified value or adds a new VLAN tag if one was not already present (the property only applies to the Atheros8316, and 88E6393X switch chips). - `new_vlan_priority` (Number) Changes the VLAN priority field (priority code point, the property only applies to Atheros8327, QCA8337 and Atheros8316 switch chips). - `protocol` (String) Matching particular IP protocol specified by protocol name or number. diff --git a/docs/resources/tool_bandwidth_server.md b/docs/resources/tool_bandwidth_server.md index 5884b24f..35d0e76c 100644 --- a/docs/resources/tool_bandwidth_server.md +++ b/docs/resources/tool_bandwidth_server.md @@ -3,7 +3,7 @@ ## Example Usage ```terraform -resource "routeros_tool_bandwidth_test_server" "test" { +resource "routeros_tool_bandwidth_server" "test" { enabled = true authenticate = false max_sessions = 100 diff --git a/examples/resources/routeros_tool_bandwidth_server/resource.tf b/examples/resources/routeros_tool_bandwidth_server/resource.tf index 0259f69c..47081eb3 100644 --- a/examples/resources/routeros_tool_bandwidth_server/resource.tf +++ b/examples/resources/routeros_tool_bandwidth_server/resource.tf @@ -1,6 +1,6 @@ -resource "routeros_tool_bandwidth_test_server" "test" { +resource "routeros_tool_bandwidth_server" "test" { enabled = true authenticate = false max_sessions = 100 allocate_udp_ports_from = 2000 -} \ No newline at end of file +} diff --git a/go.mod b/go.mod index d2286c20..10059377 100644 --- a/go.mod +++ b/go.mod @@ -19,6 +19,7 @@ require ( github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/hashicorp/cli v1.1.6 // indirect + github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect @@ -51,13 +52,13 @@ require ( github.com/hashicorp/go-plugin v1.6.0 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.7.0 // indirect - github.com/hashicorp/hc-install v0.7.0 // indirect + github.com/hashicorp/hc-install v0.8.0 // indirect github.com/hashicorp/hcl/v2 v2.21.0 // indirect github.com/hashicorp/logutils v1.0.0 // indirect github.com/hashicorp/terraform-exec v0.21.0 // indirect github.com/hashicorp/terraform-json v0.22.1 // indirect github.com/hashicorp/terraform-plugin-go v0.23.0 // indirect - github.com/hashicorp/terraform-plugin-testing v1.9.0 + github.com/hashicorp/terraform-plugin-testing v1.10.0 github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect @@ -75,9 +76,9 @@ require ( github.com/shopspring/decimal v1.3.1 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/zclconf/go-cty v1.14.4 // indirect + github.com/zclconf/go-cty v1.15.0 // indirect golang.org/x/crypto v0.26.0 - golang.org/x/mod v0.17.0 // indirect + golang.org/x/mod v0.19.0 // indirect golang.org/x/net v0.25.0 // indirect golang.org/x/sys v0.23.0 // indirect golang.org/x/text v0.17.0 // indirect diff --git a/go.sum b/go.sum index 986bf314..5a734561 100644 --- a/go.sum +++ b/go.sum @@ -84,13 +84,15 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.6.0 h1:wgd4KxHJTVGGqWBq4QPB1i5BZNEx9BR8+OFmHDmTk8A= github.com/hashicorp/go-plugin v1.6.0/go.mod h1:lBS5MtSSBZk0SHc66KACcjjlU6WzEVP/8pwz68aMkCI= +github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= +github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hc-install v0.7.0 h1:Uu9edVqjKQxxuD28mR5TikkKDd/p55S8vzPC1659aBk= -github.com/hashicorp/hc-install v0.7.0/go.mod h1:ELmmzZlGnEcqoUMKUuykHaPCIR1sYLYX+KSggWSKZuA= +github.com/hashicorp/hc-install v0.8.0 h1:LdpZeXkZYMQhoKPCecJHlKvUkQFixN/nvyR1CdfOLjI= +github.com/hashicorp/hc-install v0.8.0/go.mod h1:+MwJYjDfCruSD/udvBmRB22Nlkwwkwf5sAB6uTIhSaU= github.com/hashicorp/hcl/v2 v2.21.0 h1:lve4q/o/2rqwYOgUg3y3V2YPyD1/zkCLGjIV74Jit14= github.com/hashicorp/hcl/v2 v2.21.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= @@ -107,8 +109,8 @@ github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9T github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow= github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0 h1:kJiWGx2kiQVo97Y5IOGR4EMcZ8DtMswHhUuFibsCQQE= github.com/hashicorp/terraform-plugin-sdk/v2 v2.34.0/go.mod h1:sl/UoabMc37HA6ICVMmGO+/0wofkVIRxf+BMb/dnoIg= -github.com/hashicorp/terraform-plugin-testing v1.9.0 h1:xOsQRqqlHKXpFq6etTxih3ubdK3HVDtfE1IY7Rpd37o= -github.com/hashicorp/terraform-plugin-testing v1.9.0/go.mod h1:fhhVx/8+XNJZTD5o3b4stfZ6+q7z9+lIWigIYdT6/44= +github.com/hashicorp/terraform-plugin-testing v1.10.0 h1:2+tmRNhvnfE4Bs8rB6v58S/VpqzGC6RCh9Y8ujdn+aw= +github.com/hashicorp/terraform-plugin-testing v1.10.0/go.mod h1:iWRW3+loP33WMch2P/TEyCxxct/ZEcCGMquSLSCVsrc= github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI= github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM= github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ= @@ -197,8 +199,8 @@ github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U= github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= github.com/yuin/goldmark-meta v1.1.0 h1:pWw+JLHGZe8Rk0EGsMVssiNb/AaPMHfSRszZeUeiOUc= github.com/yuin/goldmark-meta v1.1.0/go.mod h1:U4spWENafuA7Zyg+Lj5RqK/MF+ovMYtBvXi1lBb2VP0= -github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= -github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= +github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw= @@ -211,8 +213,8 @@ golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn5 golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U= golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= diff --git a/package.json b/package.json index e29891df..35f9aa61 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "terraform-provider-routeros", - "version": "1.59.2", + "version": "1.59.3", "repository": { "type": "git", "url": "https://github.com/terraform-routeros/terraform-provider-routeros" diff --git a/routeros/resource_interface_ethernet_switch.go b/routeros/resource_interface_ethernet_switch.go index 3569e433..420921a8 100644 --- a/routeros/resource_interface_ethernet_switch.go +++ b/routeros/resource_interface_ethernet_switch.go @@ -118,17 +118,25 @@ func ResourceInterfaceEthernetSwitch() *schema.Resource { "mirror_source": { Type: schema.TypeString, Optional: true, - Default: "none", Description: "Selects a single mirroring source port. Ingress and egress traffic will be sent to the " + "mirror-target port. Note that mirror-target port has to belong to the same switch (see which port " + "belongs to which switch in /interface ethernet menu).", + DiffSuppressFunc: AlwaysPresentNotUserProvided, }, "mirror_target": { Type: schema.TypeString, Optional: true, - Default: "none", Description: "Selects a single mirroring target port. Mirrored packets from mirror-source and mirror " + "(see the property in rule and host table) will be sent to the selected port.", + DiffSuppressFunc: AlwaysPresentNotUserProvided, + }, + "mirror_egress_target": { + Type: schema.TypeString, + Optional: true, + Description: "Selects a single mirroring egress target port, only available on 88E6393X, 88E6191X and " + + "88E6190 switch chips. Mirrored packets from `mirror-egress` (see the property in port menu) will be sent " + + "to the selected port.", + DiffSuppressFunc: AlwaysPresentNotUserProvided, }, KeyName: PropName("Name of the switch."), "switch_id": { diff --git a/routeros/resource_interface_ethernet_switch_port.go b/routeros/resource_interface_ethernet_switch_port.go index b28f75e8..4b3cde79 100644 --- a/routeros/resource_interface_ethernet_switch_port.go +++ b/routeros/resource_interface_ethernet_switch_port.go @@ -70,7 +70,10 @@ func ResourceInterfaceEthernetSwitchPort() *schema.Resource { "rx_pause", "rx_too_long", "rx_too_short", "tx_1024_1518", "tx_128_255", "tx_1519_max", "tx_256_511", "tx_512_1023", "tx_64", "tx_65_127", "tx_broadcast", "tx_bytes", "tx_collision", "tx_deferred", "tx_excessive_collision", "tx_excessive_deferred", "tx_late_collision", "tx_multicast", "tx_multiple_collision", "tx_pause", "tx_single_collision", "tx_too_long", "tx_underrun", - "driver_tx_byte", "driver_rx_packet", "driver_rx_byte", "driver_tx_packet", "tx_carrier_sense_error"), + "driver_tx_byte", "driver_rx_packet", "driver_rx_byte", "driver_tx_packet", "tx_carrier_sense_error", + "rx_jabber", "tx_rx_65_127", "tx_rx_512_1023", "rx_unicast", "tx_fcs_error", "tx_rx_128_255", "tx_unicast", + "tx_rx_1024_max", "tx_rx_256_511", "rx_error_events", "tx_rx_64", + ), "default_vlan_id": { Type: schema.TypeString, @@ -83,7 +86,27 @@ func ResourceInterfaceEthernetSwitchPort() *schema.Resource { DiffSuppressFunc: AlwaysPresentNotUserProvided, }, KeyInvalid: PropInvalidRo, + "mirror_egress": { + Type: schema.TypeBool, + Optional: true, + Description: "Whether to send egress packet copy to the `mirror-egress-target` port, only available on " + + "88E6393X, 88E6191X and 88E6190 switch chips.", + }, + "mirror_ingress": { + Type: schema.TypeBool, + Optional: true, + Description: "Whether to send ingress packet copy to the `mirror-ingress-target` port, only available on " + + "88E6393X, 88E6191X and 88E6190 switch chips.", + }, + "mirror_ingress_target": { + Type: schema.TypeString, + Optional: true, + Description: "Selects a single mirroring ingress target port, only available on 88E6393X, 88E6191X and " + + "88E6190 switch chips. Mirrored packets from `mirror-ingress` will be sent to the selected port.", + DiffSuppressFunc: AlwaysPresentNotUserProvided, + }, KeyName: PropName("Port name."), + KeyRunning: PropRunningRo, "switch": { Type: schema.TypeString, Computed: true, diff --git a/routeros/resource_interface_ethernet_switch_rule.go b/routeros/resource_interface_ethernet_switch_rule.go index 30fc42bc..397fa85f 100644 --- a/routeros/resource_interface_ethernet_switch_rule.go +++ b/routeros/resource_interface_ethernet_switch_rule.go @@ -70,8 +70,17 @@ func ResourceInterfaceEthernetSwitchRule() *schema.Resource { Description: "Whether to send a frame copy to mirror-target port from a frame with matching MAC destination address " + "(matching destination or source address for CRS3xx series switches).", }, + "mirror_ports": { + Type: schema.TypeSet, + Optional: true, + Description: "Selects multiple mirroring target ports, only available on 88E6393X switch chip. " + + "Matched packets in the ACL rule will be copied and sent to selected ports.", + Elem: &schema.Schema{ + Type: schema.TypeString, + DiffSuppressFunc: AlwaysPresentNotUserProvided, + }}, "new_dst_ports": { - Type: schema.TypeString, + Type: schema.TypeSet, Optional: true, Description: "Changes the destination port as specified, multiple ports allowed, including a switch CPU port. An empty " + "setting will drop the packet. When the parameter is not used, the packet will be accepted.", diff --git a/routeros/resource_tool_netwatch.go b/routeros/resource_tool_netwatch.go index ac3cca85..153f7bd1 100644 --- a/routeros/resource_tool_netwatch.go +++ b/routeros/resource_tool_netwatch.go @@ -34,7 +34,7 @@ func ResourceToolNetwatch() *schema.Resource { // TCP "tcp_connect_time", // HTTP, HTTPS - "http_status_code", + "http_status_code", "http_codes", // DNS "ip", "ip6", "mail_servers", "name_servers", ),