Skip to content

Commit

Permalink
Add support for proxyv2
Browse files Browse the repository at this point in the history
  • Loading branch information
lapson97 committed Feb 23, 2024
1 parent 1d0ce69 commit 92c9756
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/data-sources/lbpool.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ output "view" {
- `health_monitor` (List of Object) Health Monitor settings for defining health state of members inside this pool. (see [below for nested schema](#nestedatt--health_monitor))
- `id` (String) The ID of this resource.
- `lb_algorithm` (String) Available values is 'ROUND_ROBIN', 'LEAST_CONNECTIONS', 'SOURCE_IP', 'SOURCE_IP_PORT'
- `protocol` (String) Available values are 'HTTP', 'HTTPS', 'TCP', 'UDP', 'PROXY'
- `protocol` (String) Available values are 'HTTP', 'HTTPS', 'TCP', 'UDP', 'PROXY', 'PROXYV2'
- `session_persistence` (List of Object) Pool session persistence tells the load balancer to attempt to send future requests from a client to the same backend member as the initial request. (see [below for nested schema](#nestedatt--session_persistence))

<a id="nestedatt--health_monitor"></a>
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/lbpool.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ resource "gcore_lbpool" "proxy_8080" {

- `lb_algorithm` (String) Available values is 'ROUND_ROBIN', 'LEAST_CONNECTIONS', 'SOURCE_IP', 'SOURCE_IP_PORT'
- `name` (String) Pool name.
- `protocol` (String) Available values are 'HTTP', 'HTTPS', 'TCP', 'UDP', 'PROXY'
- `protocol` (String) Available values are 'HTTP', 'HTTPS', 'TCP', 'UDP', 'PROXY', 'PROXYV2'

### Optional

Expand Down
2 changes: 1 addition & 1 deletion gcore/data_source_gcore_lbpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func dataSourceLBPool() *schema.Resource {
"protocol": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: fmt.Sprintf("Available values are '%s', '%s', '%s', '%s', '%s'", types.ProtocolTypeHTTP, types.ProtocolTypeHTTPS, types.ProtocolTypeTCP, types.ProtocolTypeUDP, types.ProtocolTypePROXY),
Description: fmt.Sprintf("Available values are '%s', '%s', '%s', '%s', '%s', '%s'", types.ProtocolTypeHTTP, types.ProtocolTypeHTTPS, types.ProtocolTypeTCP, types.ProtocolTypeUDP, types.ProtocolTypePROXY, types.ProtocolTypePROXYV2),
},
"health_monitor": &schema.Schema{
Type: schema.TypeList,
Expand Down
6 changes: 3 additions & 3 deletions gcore/resource_gcore_lbpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ func resourceLBPool() *schema.Resource {
"protocol": &schema.Schema{
Type: schema.TypeString,
Required: true,
Description: fmt.Sprintf("Available values are '%s', '%s', '%s', '%s', '%s'", types.ProtocolTypeHTTP, types.ProtocolTypeHTTPS, types.ProtocolTypeTCP, types.ProtocolTypeUDP, types.ProtocolTypePROXY),
Description: fmt.Sprintf("Available values are '%s', '%s', '%s', '%s', '%s', '%s'", types.ProtocolTypeHTTP, types.ProtocolTypeHTTPS, types.ProtocolTypeTCP, types.ProtocolTypeUDP, types.ProtocolTypePROXY, types.ProtocolTypePROXYV2),
ValidateDiagFunc: func(val interface{}, key cty.Path) diag.Diagnostics {
v := val.(string)
switch types.ProtocolType(v) {
case types.ProtocolTypeHTTP, types.ProtocolTypeHTTPS, types.ProtocolTypeTCP, types.ProtocolTypeUDP, types.ProtocolTypePROXY:
case types.ProtocolTypeHTTP, types.ProtocolTypeHTTPS, types.ProtocolTypeTCP, types.ProtocolTypeUDP, types.ProtocolTypePROXY, types.ProtocolTypePROXYV2:
return diag.Diagnostics{}
}
return diag.Errorf("wrong type %s, available values are '%s', '%s', '%s', '%s', '%s'", v, types.ProtocolTypeHTTP, types.ProtocolTypeHTTPS, types.ProtocolTypeTCP, types.ProtocolTypeUDP, types.ProtocolTypePROXY)
return diag.Errorf("wrong type %s, available values are '%s', '%s', '%s', '%s', '%s', '%s'", v, types.ProtocolTypeHTTP, types.ProtocolTypeHTTPS, types.ProtocolTypeTCP, types.ProtocolTypeUDP, types.ProtocolTypePROXY, types.ProtocolTypePROXYV2)
},
},
"loadbalancer_id": &schema.Schema{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/G-Core/gcore-dns-sdk-go v0.2.7-0.20230801110428-99ef24b50d4d
github.com/G-Core/gcore-storage-sdk-go v0.1.34
github.com/G-Core/gcorelabscdn-go v1.0.3
github.com/G-Core/gcorelabscloud-go v0.6.33
github.com/G-Core/gcorelabscloud-go v0.6.36
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-sdk/v2 v2.27.0
github.com/mitchellh/mapstructure v1.5.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/G-Core/gcore-storage-sdk-go v0.1.34 h1:0GPQfz1kA6mQi6fiisGsh0Um4H9PZe
github.com/G-Core/gcore-storage-sdk-go v0.1.34/go.mod h1:BUAEZZZJJt/+luRFunqziv3+JnbVMLbQXDWz9kV8Te8=
github.com/G-Core/gcorelabscdn-go v1.0.3 h1:fBIhDNLqfKVQV7ycqhgNeyg4Pzn5LIl5yah556lAlj4=
github.com/G-Core/gcorelabscdn-go v1.0.3/go.mod h1:iSGXaTvZBzDHQW+rKFS918BgFVpONcyLEijwh8WsXpE=
github.com/G-Core/gcorelabscloud-go v0.6.33 h1:yKwclzO1gblEZXUcDGWKYO0KhpSO8sNPKY1pTxdMKhA=
github.com/G-Core/gcorelabscloud-go v0.6.33/go.mod h1:13Z1USxlxPbDFuYQyWqfNexlk4kUvOYTXbnvV/Z1lZo=
github.com/G-Core/gcorelabscloud-go v0.6.36 h1:4o1xdRn9v4joOek+hR7rulTxcMyaRppmMcNZs+5gnd4=
github.com/G-Core/gcorelabscloud-go v0.6.36/go.mod h1:13Z1USxlxPbDFuYQyWqfNexlk4kUvOYTXbnvV/Z1lZo=
github.com/Kunde21/markdownfmt/v3 v3.1.0 h1:KiZu9LKs+wFFBQKhrZJrFZwtLnCCWJahL+S+E/3VnM0=
github.com/Kunde21/markdownfmt/v3 v3.1.0/go.mod h1:tPXN1RTyOzJwhfHoon9wUr4HGYmWgVxSQN6VBJDkrVc=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
Expand Down

0 comments on commit 92c9756

Please sign in to comment.