Skip to content

Commit 5e04391

Browse files
Merge pull request #933 from F5Networks/devel_13022024
merge devel changes
2 parents 8a07dda + b5d5b97 commit 5e04391

File tree

10 files changed

+105
-17
lines changed

10 files changed

+105
-17
lines changed

bigip/datasource_bigip_waf_entity_parameters.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ func dataSourceBigipWafEntityParameter() *schema.Resource {
6060
Optional: true,
6161
Description: "Determines whether a parameter has a restricted minimum length for value.",
6262
},
63+
"max_value_length": {
64+
Type: schema.TypeInt,
65+
Optional: true,
66+
Description: "Maximum length for value.",
67+
},
68+
"min_value_length": {
69+
Type: schema.TypeInt,
70+
Optional: true,
71+
Description: "Minimum length for value.",
72+
},
6373
"data_type": {
6474
Type: schema.TypeString,
6575
Optional: true,
@@ -203,6 +213,16 @@ func getEPConfig(ep *bigip.Parameter, d *schema.ResourceData) {
203213
if d.Get("check_min_value_length") != nil {
204214
ep.CheckMinValueLength = d.Get("check_min_value_length").(bool)
205215
}
216+
if d.Get("max_value_length") != nil {
217+
if d.Get("check_max_value_length").(bool) && d.Get("data_type").(string) == "alpha-numeric" {
218+
ep.MaximumLength = d.Get("max_value_length").(int)
219+
}
220+
}
221+
if d.Get("min_value_length") != nil {
222+
if d.Get("check_min_value_length").(bool) && d.Get("data_type").(string) == "alpha-numeric" {
223+
ep.MinimumLength = d.Get("min_value_length").(int)
224+
}
225+
}
206226
if d.Get("data_type") != nil {
207227
ep.DataType = d.Get("data_type").(string)
208228
}

bigip/resource_bigip_ltm_virtual_server.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,12 @@ func resourceBigipLtmVirtualServerRead(ctx context.Context, d *schema.ResourceDa
363363
_ = d.Set("ip_protocol", vs.IPProtocol)
364364
_ = d.Set("name", name)
365365
_ = d.Set("pool", vs.Pool)
366-
if _, ok := d.GetOk("mask"); !ok {
366+
if vs.Mask != "any" {
367367
_ = d.Set("mask", vs.Mask)
368+
} else {
369+
_ = d.Set("mask", "0.0.0.0")
368370
}
371+
// _ = d.Set("mask", vs.Mask)
369372

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

560567
var securityLogProfiles []string

bigip/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
package bigip
22

33
// ProviderVersion is set at build-time in the release process
4-
var ProviderVersion = "1.20.2"
4+
var ProviderVersion = "1.20.3"

docs/data-sources/bigip_waf_entity_parameters.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ data "bigip_waf_entity_parameter" "EPX" {
3737
* `attack_signatures_check` - Determines whether attack signatures and threat campaigns must be detected in a parameter's value.
3838
* `check_max_value_length` - Determines whether a parameter has a restricted maximum length for value.
3939
* `check_min_value_length` - Determines whether a parameter has a restricted minimum length for value.
40+
* `max_value_length` - Sets maximum length for value. Only applied to JSON when `check_max_value_length` is set to `true` and `data_type` is `alpha-numeric`.
41+
* `min_value_length` - Sets minimum length for value. Only applied to JSON when `check_min_value_length` is set to `true` and `data_type` is `alpha-numeric`.
4042
* `data_type` - Specifies data type of parameter's value.
4143
* `enable_regular_expression` - Determines whether the parameter value includes the pattern defined in regularExpression.
4244
* `is_base64` - Determines whether a parameter’s value contains a Base64 encoded string.

examples/awaf/paramtest.tf

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
data "bigip_waf_entity_parameter" "Param1" {
2+
name = "Param1"
3+
type = "explicit"
4+
data_type = "alpha-numeric"
5+
check_max_value_length = true
6+
check_min_value_length = true
7+
max_value_length = 30
8+
min_value_length = 15
9+
perform_staging = true
10+
}
11+
12+
data "bigip_waf_entity_parameter" "Param2" {
13+
name = "Param2"
14+
type = "explicit"
15+
data_type = "alpha-numeric"
16+
check_max_value_length = true
17+
perform_staging = true
18+
}
19+
20+
data "bigip_waf_entity_parameter" "Param3" {
21+
name = "Param3"
22+
type = "explicit"
23+
data_type = "alpha-numeric"
24+
max_value_length = 30
25+
min_value_length = 15
26+
perform_staging = true
27+
}
28+
29+
resource "bigip_waf_policy" "github925-awaf" {
30+
name = "github925-awaf"
31+
partition = "Common"
32+
template_name = "POLICY_TEMPLATE_API_SECURITY"
33+
application_language = "utf-8"
34+
enforcement_mode = "blocking"
35+
description = "Rapid Deployment-2"
36+
server_technologies = ["MySQL", "Unix/Linux", "MongoDB"]
37+
parameters = [data.bigip_waf_entity_parameter.Param1.json, data.bigip_waf_entity_parameter.Param2.json,data.bigip_waf_entity_parameter.Param3.json]
38+
}

examples/bigip_ltm_virtual_server.tf

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,29 @@ resource "bigip_ltm_virtual_server" "vs_tc6" {
103103
source_address_translation = "none"
104104
vlans_enabled = true
105105
vlans = ["/Common/external"]
106-
}
106+
}
107+
108+
resource "bigip_ltm_irule" "github923" {
109+
name = "/Common/github923-irule"
110+
irule = <<EOF
111+
when CLIENT_ACCEPTED {
112+
log local0. "test"
113+
}
114+
EOF
115+
}
116+
117+
resource "bigip_ltm_virtual_server" "github923" {
118+
name = "/Common/github923vs"
119+
destination = "fe80::11"
120+
description = "VirtualServer-test"
121+
port = 9999
122+
source_address_translation = "automap"
123+
ip_protocol = "tcp"
124+
irules = [bigip_ltm_irule.github923.name]
125+
profiles = ["/Common/http"]
126+
client_profiles = ["/Common/tcp"]
127+
server_profiles = ["/Common/tcp-lan-optimized"]
128+
persistence_profiles = ["/Common/source_addr", "/Common/hash"]
129+
default_persistence_profile = "/Common/hash"
130+
fallback_persistence_profile = "/Common/dest_addr"
131+
}

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ require (
1010
github.com/Azure/azure-storage-blob-go v0.13.0
1111
github.com/Azure/go-autorest/autorest v0.11.18
1212
github.com/Azure/go-autorest/autorest/adal v0.9.13
13-
github.com/f5devcentral/go-bigip v0.0.0-20240212051136-955cd7058e2a
14-
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240212051136-955cd7058e2a
13+
github.com/f5devcentral/go-bigip v0.0.0-20240213064501-035c7f45b94c
14+
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240213064501-035c7f45b94c
1515
github.com/google/uuid v1.3.0
1616
github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0
1717
github.com/stretchr/testify v1.8.4

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
5151
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
5252
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
5353
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
54-
github.com/f5devcentral/go-bigip v0.0.0-20240212051136-955cd7058e2a h1:SlNfjnGLTVKCwJzvDrboPtULNBCrejyIXZWiQMea8PU=
55-
github.com/f5devcentral/go-bigip v0.0.0-20240212051136-955cd7058e2a/go.mod h1:0Lkr0fBU6O1yBxF2mt9JFwXpaFbIb/wAY7oM3dMJDdA=
56-
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240212051136-955cd7058e2a h1:VyacdHzWZFC0L570IFoniaV4mXhTyKqzzYQphcYbLwY=
57-
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240212051136-955cd7058e2a/go.mod h1:r7o5I22EvO+fps2u10bz4ZUlTlNHopQSWzVcW19hK3U=
54+
github.com/f5devcentral/go-bigip v0.0.0-20240213064501-035c7f45b94c h1:wWbL9ITo0nsAQr+MCZ1nsdlxDykBrGF8ozhG2ubGiGw=
55+
github.com/f5devcentral/go-bigip v0.0.0-20240213064501-035c7f45b94c/go.mod h1:0Lkr0fBU6O1yBxF2mt9JFwXpaFbIb/wAY7oM3dMJDdA=
56+
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240213064501-035c7f45b94c h1:d1xnDqT9OCxjzI9xr+4rzagzOHCWGrMzGRwIPT198wE=
57+
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240213064501-035c7f45b94c/go.mod h1:r7o5I22EvO+fps2u10bz4ZUlTlNHopQSWzVcW19hK3U=
5858
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
5959
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
6060
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=

vendor/github.com/f5devcentral/go-bigip/awaf.go

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

vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ github.com/apparentlymart/go-textseg/v13/textseg
4242
# github.com/davecgh/go-spew v1.1.1
4343
## explicit
4444
github.com/davecgh/go-spew/spew
45-
# github.com/f5devcentral/go-bigip v0.0.0-20240212051136-955cd7058e2a
45+
# github.com/f5devcentral/go-bigip v0.0.0-20240213064501-035c7f45b94c
4646
## explicit; go 1.20
4747
github.com/f5devcentral/go-bigip
48-
# github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240212051136-955cd7058e2a
48+
# github.com/f5devcentral/go-bigip/f5teem v0.0.0-20240213064501-035c7f45b94c
4949
## explicit; go 1.13
5050
github.com/f5devcentral/go-bigip/f5teem
5151
# github.com/fatih/color v1.13.0

0 commit comments

Comments
 (0)