Skip to content

Commit ea43fe1

Browse files
authored
Merge pull request #132 from DamienJ-wiza/master
Feat/add redirect location to ovh_iploadbalancing_http_frontend
2 parents bccbf87 + f278e78 commit ea43fe1

File tree

3 files changed

+36
-28
lines changed

3 files changed

+36
-28
lines changed

ovh/resource_ovh_iploadbalancing_http_frontend.go

+22-14
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ func resourceIpLoadbalancingHttpFrontend() *schema.Resource {
6666
Default: false,
6767
Optional: true,
6868
},
69+
"redirect_location": {
70+
Type: schema.TypeString,
71+
Optional: true,
72+
ForceNew: false,
73+
},
6974
"display_name": {
7075
Type: schema.TypeString,
7176
Optional: true,
@@ -110,13 +115,14 @@ func resourceIpLoadbalancingHttpFrontendCreate(d *schema.ResourceData, meta inte
110115
}
111116

112117
frontend := &IpLoadbalancingHttpFrontend{
113-
Port: d.Get("port").(string),
114-
Zone: d.Get("zone").(string),
115-
AllowedSource: allowedSources,
116-
DedicatedIpFo: dedicatedIpFo,
117-
Disabled: d.Get("disabled").(bool),
118-
Ssl: d.Get("ssl").(bool),
119-
DisplayName: d.Get("display_name").(string),
118+
Port: d.Get("port").(string),
119+
Zone: d.Get("zone").(string),
120+
AllowedSource: allowedSources,
121+
DedicatedIpFo: dedicatedIpFo,
122+
Disabled: d.Get("disabled").(bool),
123+
Ssl: d.Get("ssl").(bool),
124+
RedirectLocation: d.Get("redirect_location").(string),
125+
DisplayName: d.Get("display_name").(string),
120126
}
121127

122128
frontend.DefaultFarmId = helpers.GetNilIntPointerFromData(d, "default_farm_id")
@@ -164,6 +170,7 @@ func resourceIpLoadbalancingHttpFrontendRead(d *schema.ResourceData, meta interf
164170
d.Set("port", r.Port)
165171
d.Set("ssl", r.Ssl)
166172
d.Set("zone", r.Zone)
173+
d.Set("redirect_location", r.RedirectLocation)
167174

168175
return nil
169176
}
@@ -189,13 +196,14 @@ func resourceIpLoadbalancingHttpFrontendUpdate(d *schema.ResourceData, meta inte
189196
}
190197

191198
frontend := &IpLoadbalancingHttpFrontend{
192-
Port: d.Get("port").(string),
193-
Zone: d.Get("zone").(string),
194-
AllowedSource: allowedSources,
195-
DedicatedIpFo: dedicatedIpFo,
196-
Disabled: d.Get("disabled").(bool),
197-
Ssl: d.Get("ssl").(bool),
198-
DisplayName: d.Get("display_name").(string),
199+
Port: d.Get("port").(string),
200+
Zone: d.Get("zone").(string),
201+
AllowedSource: allowedSources,
202+
DedicatedIpFo: dedicatedIpFo,
203+
Disabled: d.Get("disabled").(bool),
204+
Ssl: d.Get("ssl").(bool),
205+
RedirectLocation: d.Get("redirect_location").(string),
206+
DisplayName: d.Get("display_name").(string),
199207
}
200208

201209
frontend.DefaultFarmId = helpers.GetNilIntPointerFromData(d, "default_farm_id")

ovh/types_iploadbalancing.go

+11-10
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,17 @@ type IpLoadbalancingTcpFrontend struct {
187187
}
188188

189189
type IpLoadbalancingHttpFrontend struct {
190-
FrontendId int `json:"frontendId,omitempty"`
191-
Port string `json:"port"`
192-
Zone string `json:"zone"`
193-
AllowedSource []string `json:"allowedSource"`
194-
DedicatedIpFo []string `json:"dedicatedIpfo"`
195-
DefaultFarmId *int `json:"defaultFarmId,omitempty"`
196-
DefaultSslId *int `json:"defaultSslId,omitempty"`
197-
Disabled bool `json:"disabled"`
198-
Ssl bool `json:"ssl"`
199-
DisplayName string `json:"displayName"`
190+
FrontendId int `json:"frontendId,omitempty"`
191+
Port string `json:"port"`
192+
Zone string `json:"zone"`
193+
AllowedSource []string `json:"allowedSource"`
194+
DedicatedIpFo []string `json:"dedicatedIpfo"`
195+
DefaultFarmId *int `json:"defaultFarmId,omitempty"`
196+
DefaultSslId *int `json:"defaultSslId,omitempty"`
197+
Disabled bool `json:"disabled"`
198+
Ssl bool `json:"ssl"`
199+
RedirectLocation string `json:"redirectLocation,omitempty"`
200+
DisplayName string `json:"displayName,omitempty"`
200201
}
201202

202203
//IPLoadbalancingRouteHTTPRule HTTP Route Rule

website/docs/r/iploadbalancing_http_frontend.markdown

+3-4
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ The following arguments are supported:
4040

4141
* `service_name` - (Required) The internal name of your IP load balancing
4242
* `display_name` - Human readable name for your frontend, this field is for you
43-
* `port` - Port(s) attached to your frontend. Supports single port (numerical value),
44-
range (2 dash-delimited increasing ports) and comma-separated list of 'single port'
43+
* `port` - Port(s) attached to your frontend. Supports single port (numerical value),
44+
range (2 dash-delimited increasing ports) and comma-separated list of 'single port'
4545
and/or 'range'. Each port must be in the [1;49151] range
4646
* `zone` - (Required) Zone where the frontend will be defined (ie. `gra`, `bhs` also supports `all`)
4747
* `allowed_source` - Restrict IP Load Balancing access to these ip block. No restriction if null. List of IP blocks.
@@ -50,7 +50,7 @@ The following arguments are supported:
5050
* `default_ssl_id` - Default ssl served to your customer
5151
* `disabled` - Disable your frontend. Default: 'false'
5252
* `ssl` - SSL deciphering. Default: 'false'
53-
53+
* `redirect_location` - Redirection HTTP'
5454

5555
## Attributes Reference
5656

@@ -64,4 +64,3 @@ The following attributes are exported:
6464
* `default_ssl_id` - See Argument Reference above.
6565
* `disabled` - See Argument Reference above.
6666
* `ssl` - See Argument Reference above.
67-

0 commit comments

Comments
 (0)