diff --git a/.changelog/3143.txt b/.changelog/3143.txt new file mode 100644 index 0000000000..05e4e98d7a --- /dev/null +++ b/.changelog/3143.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_dcx_extra_config: update field properties and doc +``` diff --git a/tencentcloud/services/dc/resource_tc_dc_instance.md b/tencentcloud/services/dc/resource_tc_dc_instance.md index 08dff45bef..ec494ee9f7 100644 --- a/tencentcloud/services/dc/resource_tc_dc_instance.md +++ b/tencentcloud/services/dc/resource_tc_dc_instance.md @@ -16,7 +16,7 @@ resource "tencentcloud_dc_instance" "example" { Or ```hcl -resource "tencentcloud_dc_instance" "instance" { +resource "tencentcloud_dc_instance" "example" { direct_connect_name = "tf-example" access_point_id = "ap-shenzhen-b-ft" line_operator = "In-houseWiring" diff --git a/tencentcloud/services/dc/resource_tc_dcx_extra_config.go b/tencentcloud/services/dc/resource_tc_dcx_extra_config.go index a9a734eafa..189b04da69 100644 --- a/tencentcloud/services/dc/resource_tc_dcx_extra_config.go +++ b/tencentcloud/services/dc/resource_tc_dcx_extra_config.go @@ -31,12 +31,14 @@ func ResourceTencentCloudDcxExtraConfig() *schema.Resource { "vlan": { Optional: true, + Computed: true, Type: schema.TypeInt, Description: "direct connect tunnel vlan id.", }, "bgp_peer": { Optional: true, + Computed: true, Type: schema.TypeList, MaxItems: 1, Description: "idc BGP, Asn, AuthKey.", @@ -45,11 +47,13 @@ func ResourceTencentCloudDcxExtraConfig() *schema.Resource { "asn": { Type: schema.TypeInt, Optional: true, + Computed: true, Description: "user idc BGP Asn.", }, "auth_key": { Type: schema.TypeString, Optional: true, + Computed: true, Description: "user bgp key.", }, }, @@ -58,6 +62,7 @@ func ResourceTencentCloudDcxExtraConfig() *schema.Resource { "route_filter_prefixes": { Optional: true, + Computed: true, Type: schema.TypeList, MaxItems: 1, Description: "user filter network prefixes.", @@ -66,6 +71,7 @@ func ResourceTencentCloudDcxExtraConfig() *schema.Resource { "cidr": { Type: schema.TypeString, Optional: true, + Computed: true, Description: "user network prefixes.", }, }, @@ -74,48 +80,56 @@ func ResourceTencentCloudDcxExtraConfig() *schema.Resource { "tencent_address": { Optional: true, + Computed: true, Type: schema.TypeString, Description: "direct connect tunnel tencent cloud connect ip.", }, "tencent_backup_address": { Optional: true, + Computed: true, Type: schema.TypeString, Description: "direct connect tunnel tencent cloud backup connect ip.", }, "customer_address": { Optional: true, + Computed: true, Type: schema.TypeString, Description: "direct connect tunnel user idc connect ip.", }, "bandwidth": { Optional: true, + Computed: true, Type: schema.TypeInt, Description: "direct connect tunnel bandwidth.", }, "enable_bgp_community": { Optional: true, + Computed: true, Type: schema.TypeBool, Description: "BGP community attribute.", }, "bfd_enable": { Optional: true, + Computed: true, Type: schema.TypeInt, Description: "be enabled BFD.", }, "nqa_enable": { Optional: true, + Computed: true, Type: schema.TypeInt, Description: "be enabled NQA.", }, "bfd_info": { Optional: true, + Computed: true, Type: schema.TypeList, MaxItems: 1, Description: "BFD config info.", @@ -124,11 +138,13 @@ func ResourceTencentCloudDcxExtraConfig() *schema.Resource { "probe_failed_times": { Type: schema.TypeInt, Optional: true, + Computed: true, Description: "detect times.", }, "interval": { Type: schema.TypeInt, Optional: true, + Computed: true, Description: "detect interval.", }, }, @@ -137,6 +153,7 @@ func ResourceTencentCloudDcxExtraConfig() *schema.Resource { "nqa_info": { Optional: true, + Computed: true, Type: schema.TypeList, MaxItems: 1, Description: "NQA config info.", @@ -145,16 +162,19 @@ func ResourceTencentCloudDcxExtraConfig() *schema.Resource { "probe_failed_times": { Type: schema.TypeInt, Optional: true, + Computed: true, Description: "detect times.", }, "interval": { Type: schema.TypeInt, Optional: true, + Computed: true, Description: "detect interval.", }, "destination_ip": { Type: schema.TypeString, Optional: true, + Computed: true, Description: "detect ip.", }, }, @@ -163,12 +183,14 @@ func ResourceTencentCloudDcxExtraConfig() *schema.Resource { "ipv6_enable": { Optional: true, + Computed: true, Type: schema.TypeInt, Description: "0: disable IPv61: enable IPv6.", }, "jumbo_enable": { Optional: true, + Computed: true, Type: schema.TypeInt, Description: "direct connect tunnel support jumbo frame1: enable direct connect tunnel jumbo frame0: disable direct connect tunnel jumbo frame.", }, @@ -234,12 +256,10 @@ func resourceTencentCloudDcxExtraConfigRead(d *schema.ResourceData, meta interfa if dcxExtraConfig.RouteFilterPrefixes != nil { routeFilterPrefixesMap := map[string]interface{}{} - - if dcxExtraConfig.RouteFilterPrefixes != nil { - if len(dcxExtraConfig.RouteFilterPrefixes) > 0 { - routeFilterPrefixesMap["cidr"] = dcxExtraConfig.RouteFilterPrefixes[0].Cidr - } + if len(dcxExtraConfig.RouteFilterPrefixes) > 0 { + routeFilterPrefixesMap["cidr"] = dcxExtraConfig.RouteFilterPrefixes[0].Cidr } + _ = d.Set("route_filter_prefixes", []interface{}{routeFilterPrefixesMap}) } diff --git a/tencentcloud/services/dc/resource_tc_dcx_extra_config.md b/tencentcloud/services/dc/resource_tc_dcx_extra_config.md index f3dab82c19..81743b0960 100644 --- a/tencentcloud/services/dc/resource_tc_dcx_extra_config.md +++ b/tencentcloud/services/dc/resource_tc_dcx_extra_config.md @@ -1,46 +1,40 @@ -Provides a resource to create a dc dcx_extra_config +Provides a resource to create a DC extra config Example Usage ```hcl -resource "tencentcloud_dcx_extra_config" "dcx_extra_config" { +resource "tencentcloud_dcx_extra_config" "example" { direct_connect_tunnel_id = "dcx-4z49tnws" vlan = 123 + tencent_address = "10.3.191.73/29" + tencent_backup_address = "10.3.191.72/29" + customer_address = "10.3.191.74/29" + bandwidth = 100 + enable_bgp_community = false + bfd_enable = 1 + nqa_enable = 0 bgp_peer { asn = 65101 auth_key = "test123" - - } - route_filter_prefixes { - cidr = "192.168.0.0/24" } - tencent_address = "192.168.1.1" - tencent_backup_address = "192.168.1.2" - customer_address = "192.168.1.4" - bandwidth = 10 - enable_bgp_community = false - bfd_enable = 0 - nqa_enable = 1 bfd_info { probe_failed_times = 3 - interval = 100 - + interval = 2000 } nqa_info { - probe_failed_times = 3 - interval = 100 - destination_ip = "192.168.2.2" - + probe_failed_times = -1 + interval = -1 + destination_ip = "0.0.0.0" } - ipv6_enable = 0 + ipv6_enable = 0 jumbo_enable = 0 } ``` Import -dc dcx_extra_config can be imported using the id, e.g. +DC extra config can be imported using the id, e.g. ``` -terraform import tencentcloud_dcx_extra_config.dcx_extra_config dcx_id +terraform import tencentcloud_dcx_extra_config.example dcx-4z49tnws ``` \ No newline at end of file diff --git a/website/docs/r/dc_instance.html.markdown b/website/docs/r/dc_instance.html.markdown index ead2322e09..0199d8bbec 100644 --- a/website/docs/r/dc_instance.html.markdown +++ b/website/docs/r/dc_instance.html.markdown @@ -27,7 +27,7 @@ resource "tencentcloud_dc_instance" "example" { ### Or ```hcl -resource "tencentcloud_dc_instance" "instance" { +resource "tencentcloud_dc_instance" "example" { direct_connect_name = "tf-example" access_point_id = "ap-shenzhen-b-ft" line_operator = "In-houseWiring" diff --git a/website/docs/r/dcx_extra_config.html.markdown b/website/docs/r/dcx_extra_config.html.markdown index ccd0183948..62f84e9fd7 100644 --- a/website/docs/r/dcx_extra_config.html.markdown +++ b/website/docs/r/dcx_extra_config.html.markdown @@ -4,44 +4,38 @@ layout: "tencentcloud" page_title: "TencentCloud: tencentcloud_dcx_extra_config" sidebar_current: "docs-tencentcloud-resource-dcx_extra_config" description: |- - Provides a resource to create a dc dcx_extra_config + Provides a resource to create a DC extra config --- # tencentcloud_dcx_extra_config -Provides a resource to create a dc dcx_extra_config +Provides a resource to create a DC extra config ## Example Usage ```hcl -resource "tencentcloud_dcx_extra_config" "dcx_extra_config" { +resource "tencentcloud_dcx_extra_config" "example" { direct_connect_tunnel_id = "dcx-4z49tnws" vlan = 123 + tencent_address = "10.3.191.73/29" + tencent_backup_address = "10.3.191.72/29" + customer_address = "10.3.191.74/29" + bandwidth = 100 + enable_bgp_community = false + bfd_enable = 1 + nqa_enable = 0 bgp_peer { asn = 65101 auth_key = "test123" - - } - route_filter_prefixes { - cidr = "192.168.0.0/24" } - tencent_address = "192.168.1.1" - tencent_backup_address = "192.168.1.2" - customer_address = "192.168.1.4" - bandwidth = 10 - enable_bgp_community = false - bfd_enable = 0 - nqa_enable = 1 bfd_info { probe_failed_times = 3 - interval = 100 - + interval = 2000 } nqa_info { - probe_failed_times = 3 - interval = 100 - destination_ip = "192.168.2.2" - + probe_failed_times = -1 + interval = -1 + destination_ip = "0.0.0.0" } ipv6_enable = 0 jumbo_enable = 0 @@ -98,9 +92,9 @@ In addition to all arguments above, the following attributes are exported: ## Import -dc dcx_extra_config can be imported using the id, e.g. +DC extra config can be imported using the id, e.g. ``` -terraform import tencentcloud_dcx_extra_config.dcx_extra_config dcx_id +terraform import tencentcloud_dcx_extra_config.example dcx-4z49tnws ```