Skip to content

Commit

Permalink
adding misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RavinderReddyF5 committed Feb 13, 2024
1 parent 0545bc3 commit c17f48d
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 13 deletions.
1 change: 1 addition & 0 deletions bigip/datasource_bigip_waf_entity_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"

bigip "github.com/f5devcentral/go-bigip"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
Expand Down
9 changes: 8 additions & 1 deletion bigip/resource_bigip_ltm_virtual_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,12 @@ func resourceBigipLtmVirtualServerRead(ctx context.Context, d *schema.ResourceDa
_ = d.Set("ip_protocol", vs.IPProtocol)
_ = d.Set("name", name)
_ = d.Set("pool", vs.Pool)
if _, ok := d.GetOk("mask"); !ok {
if vs.Mask != "any" {
_ = d.Set("mask", vs.Mask)
} else {
_ = d.Set("mask", "0.0.0.0")
}
// _ = d.Set("mask", vs.Mask)

// /* Service port is provided by the API in the destination attribute "/partition_name/virtual_server_address[%route_domain]:(port)"
// so we need to extract it
Expand Down Expand Up @@ -555,6 +558,10 @@ func getVirtualServerConfig(d *schema.ResourceData, config *bigip.VirtualServer)
var rules []string
if cfgRules, ok := d.GetOk("irules"); ok {
rules = listToStringSlice(cfgRules.([]interface{}))
} else {
if changed := d.HasChange("irules"); changed {
rules = listToStringSlice(append([]interface{}{}, ""))
}
}

var securityLogProfiles []string
Expand Down
2 changes: 1 addition & 1 deletion bigip/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bigip

// ProviderVersion is set at build-time in the release process
var ProviderVersion = "1.20.2"
var ProviderVersion = "1.20.3"
14 changes: 12 additions & 2 deletions examples/awaf/paramtest.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ data "bigip_waf_entity_parameter" "Param1" {
perform_staging = true
}


data "bigip_waf_entity_parameter" "Param2" {
name = "Param2"
type = "explicit"
Expand All @@ -25,4 +24,15 @@ data "bigip_waf_entity_parameter" "Param3" {
max_value_length = 30
min_value_length = 15
perform_staging = true
}
}

resource "bigip_waf_policy" "github925-awaf" {
name = "github925-awaf"
partition = "Common"
template_name = "POLICY_TEMPLATE_API_SECURITY"
application_language = "utf-8"
enforcement_mode = "blocking"
description = "Rapid Deployment-2"
server_technologies = ["MySQL", "Unix/Linux", "MongoDB"]
parameters = [data.bigip_waf_entity_parameter.Param1.json, data.bigip_waf_entity_parameter.Param2.json,data.bigip_waf_entity_parameter.Param3.json]
}
27 changes: 26 additions & 1 deletion examples/bigip_ltm_virtual_server.tf
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,29 @@ resource "bigip_ltm_virtual_server" "vs_tc6" {
source_address_translation = "none"
vlans_enabled = true
vlans = ["/Common/external"]
}
}

resource "bigip_ltm_irule" "github923" {
name = "/Common/github923-irule"
irule = <<EOF
when CLIENT_ACCEPTED {
log local0. "test"
}
EOF
}

resource "bigip_ltm_virtual_server" "github923" {
name = "/Common/github923vs"
destination = "fe80::11"
description = "VirtualServer-test"
port = 9999
source_address_translation = "automap"
ip_protocol = "tcp"
irules = [bigip_ltm_irule.github923.name]
profiles = ["/Common/http"]
client_profiles = ["/Common/tcp"]
server_profiles = ["/Common/tcp-lan-optimized"]
persistence_profiles = ["/Common/source_addr", "/Common/hash"]
default_persistence_profile = "/Common/hash"
fallback_persistence_profile = "/Common/dest_addr"
}
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ require (
github.com/Azure/azure-storage-blob-go v0.13.0
github.com/Azure/go-autorest/autorest v0.11.18
github.com/Azure/go-autorest/autorest/adal v0.9.13
github.com/f5devcentral/go-bigip v0.0.0-20240212051136-955cd7058e2a
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240212051136-955cd7058e2a
github.com/f5devcentral/go-bigip v0.0.0-20240213064501-035c7f45b94c
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240213064501-035c7f45b94c
github.com/google/uuid v1.3.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0
github.com/stretchr/testify v1.8.4
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/f5devcentral/go-bigip v0.0.0-20240212051136-955cd7058e2a h1:SlNfjnGLTVKCwJzvDrboPtULNBCrejyIXZWiQMea8PU=
github.com/f5devcentral/go-bigip v0.0.0-20240212051136-955cd7058e2a/go.mod h1:0Lkr0fBU6O1yBxF2mt9JFwXpaFbIb/wAY7oM3dMJDdA=
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240212051136-955cd7058e2a h1:VyacdHzWZFC0L570IFoniaV4mXhTyKqzzYQphcYbLwY=
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240212051136-955cd7058e2a/go.mod h1:r7o5I22EvO+fps2u10bz4ZUlTlNHopQSWzVcW19hK3U=
github.com/f5devcentral/go-bigip v0.0.0-20240213064501-035c7f45b94c h1:wWbL9ITo0nsAQr+MCZ1nsdlxDykBrGF8ozhG2ubGiGw=
github.com/f5devcentral/go-bigip v0.0.0-20240213064501-035c7f45b94c/go.mod h1:0Lkr0fBU6O1yBxF2mt9JFwXpaFbIb/wAY7oM3dMJDdA=
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240213064501-035c7f45b94c h1:d1xnDqT9OCxjzI9xr+4rzagzOHCWGrMzGRwIPT198wE=
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240213064501-035c7f45b94c/go.mod h1:r7o5I22EvO+fps2u10bz4ZUlTlNHopQSWzVcW19hK3U=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ github.com/apparentlymart/go-textseg/v13/textseg
# github.com/davecgh/go-spew v1.1.1
## explicit
github.com/davecgh/go-spew/spew
# github.com/f5devcentral/go-bigip v0.0.0-20240212051136-955cd7058e2a
# github.com/f5devcentral/go-bigip v0.0.0-20240213064501-035c7f45b94c
## explicit; go 1.20
github.com/f5devcentral/go-bigip
# github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240212051136-955cd7058e2a
# github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240213064501-035c7f45b94c
## explicit; go 1.13
github.com/f5devcentral/go-bigip/f5teem
# github.com/fatih/color v1.13.0
Expand Down

0 comments on commit c17f48d

Please sign in to comment.