Skip to content

Commit

Permalink
slb: set health_check_connect_port as ForceNew since there is no way …
Browse files Browse the repository at this point in the history
…to change it to backend port
  • Loading branch information
shinny-chengzhi committed Jan 16, 2024
1 parent 69970e2 commit 9ffc013
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions alicloud/resource_alicloud_slb_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,10 @@ func resourceAliyunSlbListener() *schema.Resource {
DiffSuppressFunc: httpHttpsTcpDiffSuppressFunc,
},
"health_check_connect_port": {
Type: schema.TypeInt,
ValidateFunc: validation.Any(
validation.IntBetween(0, 65535),
validation.IntInSlice([]int{-520})),
Type: schema.TypeInt,
ValidateFunc: validation.IntBetween(1, 65535),
Optional: true,
Computed: true,
ForceNew: true,
DiffSuppressFunc: healthCheckDiffSuppressFunc,
},
"healthy_threshold": {
Expand Down Expand Up @@ -654,6 +652,8 @@ func resourceAliyunSlbListenerUpdate(d *schema.ResourceData, meta interface{}) e
commonRequest.QueryParams["HealthCheckInterval"] = string(requests.NewInteger(d.Get("health_check_interval").(int)))
update = true
}
// SetXXXListenerAttribute can't change health_check_connect_port to backend port, so it's configured as ForceNew
// but we rely on Update to change it from backend port to specified port during Create
if d.HasChange("health_check_connect_port") {
if port, ok := d.GetOk("health_check_connect_port"); ok {
httpArgs.QueryParams["HealthCheckConnectPort"] = string(requests.NewInteger(port.(int)))
Expand Down

0 comments on commit 9ffc013

Please sign in to comment.