diff --git a/.changelog/3272.txt b/.changelog/3272.txt new file mode 100644 index 0000000000..0419f64a27 --- /dev/null +++ b/.changelog/3272.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +datasource/tencentcloud_vpn_connections: update code and doc +``` \ No newline at end of file diff --git a/tencentcloud/services/vpn/data_source_tc_vpn_connections.go b/tencentcloud/services/vpn/data_source_tc_vpn_connections.go index 4a0795c203..cdfbb8814f 100644 --- a/tencentcloud/services/vpn/data_source_tc_vpn_connections.go +++ b/tencentcloud/services/vpn/data_source_tc_vpn_connections.go @@ -326,6 +326,7 @@ func dataSourceTencentCloudVpnConnectionsRead(d *schema.ResourceData, meta inter mapping := map[string]interface{}{ "id": *connection.VpnConnectionId, "name": *connection.VpnConnectionName, + "vpc_id": *connection.VpcId, "vpn_gateway_id": *connection.VpnGatewayId, "customer_gateway_id": *connection.CustomerGatewayId, "ike_proto_authen_algorithm": *connection.IKEOptionsSpecification.PropoAuthenAlgorithm, diff --git a/tencentcloud/services/vpn/data_source_tc_vpn_connections.md b/tencentcloud/services/vpn/data_source_tc_vpn_connections.md index ed66520030..cdb381a686 100644 --- a/tencentcloud/services/vpn/data_source_tc_vpn_connections.md +++ b/tencentcloud/services/vpn/data_source_tc_vpn_connections.md @@ -2,15 +2,23 @@ Use this data source to query detailed information of VPN connections. Example Usage +Query all vpn connections + +```hcl +data "tencentcloud_vpn_connections" "example" {} +``` + +Query vpn connections by filters + ```hcl -data "tencentcloud_vpn_connections" "foo" { - name = "main" - id = "vpnx-xfqag" +data "tencentcloud_vpn_connections" "example" { + name = "tf-example" + id = "vpnx-fq4e4364" vpn_gateway_id = "vpngw-8ccsnclt" - vpc_id = "cgw-xfqag" - customer_gateway_id = "" + vpc_id = "vpc-6ccw0s5l" + customer_gateway_id = "cgw-r1g6c8fr" tags = { - test = "tf" + createBy = "Terraform" } } -``` \ No newline at end of file +``` diff --git a/website/docs/d/vpn_connections.html.markdown b/website/docs/d/vpn_connections.html.markdown index b46d8ca851..4aad3ac5d7 100644 --- a/website/docs/d/vpn_connections.html.markdown +++ b/website/docs/d/vpn_connections.html.markdown @@ -13,15 +13,23 @@ Use this data source to query detailed information of VPN connections. ## Example Usage +### Query all vpn connections + +```hcl +data "tencentcloud_vpn_connections" "example" {} +``` + +### Query vpn connections by filters + ```hcl -data "tencentcloud_vpn_connections" "foo" { - name = "main" - id = "vpnx-xfqag" +data "tencentcloud_vpn_connections" "example" { + name = "tf-example" + id = "vpnx-fq4e4364" vpn_gateway_id = "vpngw-8ccsnclt" - vpc_id = "cgw-xfqag" - customer_gateway_id = "" + vpc_id = "vpc-6ccw0s5l" + customer_gateway_id = "cgw-r1g6c8fr" tags = { - test = "tf" + createBy = "Terraform" } } ```