Skip to content

Commit 44d79b9

Browse files
committed
fix: Deprecated force_https
1 parent 7f12446 commit 44d79b9

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

tencentcloud/resource_tc_tse_cngw_route.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ resource "tencentcloud_tse_cngw_service" "cngw_service" {
6767
6868
resource "tencentcloud_tse_cngw_route" "cngw_route" {
6969
destination_ports = []
70-
force_https = false
7170
gateway_id = tencentcloud_tse_cngw_gateway.cngw_gateway.id
7271
hosts = [
7372
"192.168.0.1:9090",
@@ -191,6 +190,7 @@ func resourceTencentCloudTseCngwRoute() *schema.Resource {
191190
"force_https": {
192191
Optional: true,
193192
Type: schema.TypeBool,
193+
Deprecated: "This field has been deprecated and will be deleted in subsequent versions.",
194194
Description: "whether to enable forced HTTPS, no longer use.",
195195
},
196196

@@ -536,11 +536,11 @@ func resourceTencentCloudTseCngwRouteUpdate(d *schema.ResourceData, meta interfa
536536
}
537537
}
538538

539-
// if d.HasChange("force_https") {
540-
// if v, ok := d.GetOkExists("force_https"); ok {
541-
// request.ForceHttps = helper.Bool(v.(bool))
542-
// }
543-
// }
539+
if d.HasChange("force_https") {
540+
if v, ok := d.GetOkExists("force_https"); ok {
541+
request.ForceHttps = helper.Bool(v.(bool))
542+
}
543+
}
544544

545545
if d.HasChange("destination_ports") {
546546
if v, ok := d.GetOk("destination_ports"); ok {

tencentcloud/resource_tc_tse_cngw_route_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ func TestAccTencentCloudTseCngwRouteResource_basic(t *testing.T) {
2626
testAccCheckTseCngwRouteExists("tencentcloud_tse_cngw_route.cngw_route"),
2727
resource.TestCheckResourceAttrSet("tencentcloud_tse_cngw_route.cngw_route", "id"),
2828
resource.TestCheckResourceAttr("tencentcloud_tse_cngw_route.cngw_route", "gateway_id", defaultTseGatewayId),
29-
resource.TestCheckResourceAttr("tencentcloud_tse_cngw_route.cngw_route", "force_https", "false"),
3029
resource.TestCheckResourceAttr("tencentcloud_tse_cngw_route.cngw_route", "hosts.#", "1"),
3130
resource.TestCheckResourceAttr("tencentcloud_tse_cngw_route.cngw_route", "https_redirect_status_code", "426"),
3231
resource.TestCheckResourceAttr("tencentcloud_tse_cngw_route.cngw_route", "paths.#", "1"),
@@ -51,7 +50,6 @@ func TestAccTencentCloudTseCngwRouteResource_basic(t *testing.T) {
5150
testAccCheckTseCngwRouteExists("tencentcloud_tse_cngw_route.cngw_route"),
5251
resource.TestCheckResourceAttrSet("tencentcloud_tse_cngw_route.cngw_route", "id"),
5352
resource.TestCheckResourceAttr("tencentcloud_tse_cngw_route.cngw_route", "gateway_id", defaultTseGatewayId),
54-
// resource.TestCheckResourceAttr("tencentcloud_tse_cngw_route.cngw_route", "force_https", "true"),
5553
resource.TestCheckResourceAttr("tencentcloud_tse_cngw_route.cngw_route", "hosts.#", "1"),
5654
resource.TestCheckResourceAttr("tencentcloud_tse_cngw_route.cngw_route", "https_redirect_status_code", "301"),
5755
resource.TestCheckResourceAttr("tencentcloud_tse_cngw_route.cngw_route", "paths.#", "1"),
@@ -134,7 +132,6 @@ const testAccTseCngwRoute = DefaultTseVar + `
134132
135133
resource "tencentcloud_tse_cngw_route" "cngw_route" {
136134
destination_ports = []
137-
force_https = false
138135
gateway_id = var.gateway_id
139136
hosts = [
140137
"192.168.0.1:9090",
@@ -162,7 +159,6 @@ const testAccTseCngwRouteUp = DefaultTseVar + `
162159
163160
resource "tencentcloud_tse_cngw_route" "cngw_route" {
164161
destination_ports = []
165-
force_https = false
166162
gateway_id = var.gateway_id
167163
hosts = [
168164
"192.168.0.1:9091",

website/docs/r/tse_cngw_route.html.markdown

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ resource "tencentcloud_tse_cngw_service" "cngw_service" {
7777
7878
resource "tencentcloud_tse_cngw_route" "cngw_route" {
7979
destination_ports = []
80-
force_https = false
8180
gateway_id = tencentcloud_tse_cngw_gateway.cngw_gateway.id
8281
hosts = [
8382
"192.168.0.1:9090",
@@ -108,7 +107,7 @@ The following arguments are supported:
108107
* `gateway_id` - (Required, String) gateway ID.
109108
* `service_id` - (Required, String) ID of the service which the route belongs to.
110109
* `destination_ports` - (Optional, Set: [`Int`]) destination port for Layer 4 matching.
111-
* `force_https` - (Optional, Bool) whether to enable forced HTTPS, no longer use.
110+
* `force_https` - (Optional, Bool, **Deprecated**) This field has been deprecated and will be deleted in subsequent versions. whether to enable forced HTTPS, no longer use.
112111
* `headers` - (Optional, List) the headers of route.
113112
* `hosts` - (Optional, Set: [`String`]) host list.
114113
* `https_redirect_status_code` - (Optional, Int) https redirection status code.

0 commit comments

Comments
 (0)