Skip to content

Commit

Permalink
fix(v7.12.2): Change routeros_interface_wireguard_peer schema
Browse files Browse the repository at this point in the history
Changed `allowed_address` from Optional to Required
  • Loading branch information
vaerh committed Mar 31, 2024
1 parent 76824b7 commit 3f937c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion routeros/resource_interface_wireguard_peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func ResourceInterfaceWireguardPeer() *schema.Resource {

"allowed_address": {
Type: schema.TypeList,
Optional: true,
Required: true,
Description: "List of IP (v4 or v6) addresses with CIDR masks from which incoming traffic for this peer " +
"is allowed and to which outgoing traffic for this peer is directed. The catch-all 0.0.0.0/0 may be " +
"specified for matching all IPv4 addresses, and ::/0 may be specified for matching all IPv6 addresses.",
Expand Down
11 changes: 9 additions & 2 deletions routeros/resource_interface_wireguard_peer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ import (
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

const testInterfaceWireguardPeerMinVersion = "7.12"
const testInterfaceWireguardPeerAddress = "routeros_interface_wireguard_peer.wg_peer"

func TestAccInterfaceWireguardPeerTest_basic(t *testing.T) {
if !testCheckMinVersion(t, testInterfaceWireguardPeerMinVersion) {
t.Logf("Test skipped, the minimum required version is %v", testInterfaceWireguardPeerMinVersion)
return
}

for _, name := range testNames {
t.Run(name, func(t *testing.T) {
resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -39,8 +45,9 @@ func testAccInterfaceWireguardPeerConfig() string {
return providerConfig + `
resource "routeros_interface_wireguard_peer" "wg_peer" {
interface = "wg1"
public_key = "QxC+CTcrDdU5+ny0+2ChUH3NegTrwoVCv53TllI5T0I="
allowed_address = ["1.2.3.0/30"]
interface = "wg1"
public_key = "QxC+CTcrDdU5+ny0+2ChUH3NegTrwoVCv53TllI5T0I="
}
`
Expand Down

0 comments on commit 3f937c1

Please sign in to comment.