provider/fastly add origin shielding (#10677)
* Add shield to options for fastly backend * Add shield to acceptance test for fastly * Update website with shield option
This commit is contained in:
parent
3173b7c17b
commit
27d42d1831
|
@ -166,6 +166,12 @@ func resourceServiceV1() *schema.Resource {
|
|||
Default: 80,
|
||||
Description: "The port number Backend responds on. Default 80",
|
||||
},
|
||||
"shield": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Default: "",
|
||||
Description: "The POP of the shield designated to reduce inbound load.",
|
||||
},
|
||||
"ssl_check_cert": &schema.Schema{
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
|
@ -819,6 +825,7 @@ func resourceServiceV1Update(d *schema.ResourceData, meta interface{}) error {
|
|||
AutoLoadbalance: gofastly.CBool(df["auto_loadbalance"].(bool)),
|
||||
SSLCheckCert: gofastly.CBool(df["ssl_check_cert"].(bool)),
|
||||
SSLHostname: df["ssl_hostname"].(string),
|
||||
Shield: df["shield"].(string),
|
||||
Port: uint(df["port"].(int)),
|
||||
BetweenBytesTimeout: uint(df["between_bytes_timeout"].(int)),
|
||||
ConnectTimeout: uint(df["connect_timeout"].(int)),
|
||||
|
@ -1499,6 +1506,7 @@ func flattenBackends(backendList []*gofastly.Backend) []map[string]interface{} {
|
|||
"first_byte_timeout": int(b.FirstByteTimeout),
|
||||
"max_conn": int(b.MaxConn),
|
||||
"port": int(b.Port),
|
||||
"shield": b.Shield,
|
||||
"ssl_check_cert": gofastly.CBool(b.SSLCheckCert),
|
||||
"ssl_hostname": b.SSLHostname,
|
||||
"weight": int(b.Weight),
|
||||
|
|
|
@ -72,6 +72,7 @@ func TestResourceFastlyFlattenBackend(t *testing.T) {
|
|||
MaxConn: uint(200),
|
||||
SSLCheckCert: true,
|
||||
SSLHostname: "",
|
||||
Shield: "New York",
|
||||
Weight: uint(100),
|
||||
},
|
||||
},
|
||||
|
@ -88,6 +89,7 @@ func TestResourceFastlyFlattenBackend(t *testing.T) {
|
|||
"max_conn": 200,
|
||||
"ssl_check_cert": gofastly.CBool(true),
|
||||
"ssl_hostname": "",
|
||||
"shield": "New York",
|
||||
"weight": 100,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -176,6 +176,7 @@ Default `200`.
|
|||
* `port` - (Optional) The port number on which the Backend responds. Default `80`.
|
||||
* `ssl_check_cert` - (Optional) Be strict about checking SSL certs. Default `true`.
|
||||
* `ssl_hostname` - (Optional) Used for both SNI during the TLS handshake and to validate the cert.
|
||||
* `shield` - (Optional) The POP of the shield designated to reduce inbound load.
|
||||
* `weight` - (Optional) The [portion of traffic](https://docs.fastly.com/guides/performance-tuning/load-balancing-configuration.html#how-weight-affects-load-balancing) to send to this Backend. Each Backend receives `weight / total` of the traffic. Default `100`.
|
||||
|
||||
The `condition` block supports allows you to add logic to any basic configuration
|
||||
|
|
Loading…
Reference in New Issue