diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a7de636a3..0ff8fffa4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ FEATURES: * **New Resource:** `tencentcloud_ccn_route_table_associate_instance_config` ([#2730](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2730)) * **New Resource:** `tencentcloud_ccn_route_table_broadcast_policies` ([#2730](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2730)) * **New Resource:** `tencentcloud_ccn_route_table_input_policies` ([#2730](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2730)) +* **New Resource:** `tencentcloud_ccn_route_table_selection_policies` ([#2730](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2730)) * **New Resource:** `tencentcloud_kubernetes_addon_config` ([#2725](https://github.com/tencentcloudstack/terraform-provider-tencentcloud/pull/2725)) ENHANCEMENTS: diff --git a/tencentcloud/provider.md b/tencentcloud/provider.md index f15d9a6336..56d27be4ac 100644 --- a/tencentcloud/provider.md +++ b/tencentcloud/provider.md @@ -309,6 +309,7 @@ Cloud Connect Network(CCN) tencentcloud_ccn_tenant_instances tencentcloud_ccn_cross_border_flow_monitor tencentcloud_ccn_cross_border_region_bandwidth_limits + tencentcloud_ccn_routes Resource tencentcloud_ccn @@ -318,6 +319,11 @@ Cloud Connect Network(CCN) tencentcloud_ccn_instances_accept_attach tencentcloud_ccn_instances_reject_attach tencentcloud_ccn_instances_reset_attach + tencentcloud_ccn_route_table + tencentcloud_ccn_route_table_input_policies + tencentcloud_ccn_route_table_broadcast_policies + tencentcloud_ccn_route_table_selection_policies + tencentcloud_ccn_route_table_associate_instance_config CVM Dedicated Host(CDH) Data Source diff --git a/website/docs/d/ccn_routes.html.markdown b/website/docs/d/ccn_routes.html.markdown new file mode 100644 index 0000000000..8cf1bfc25a --- /dev/null +++ b/website/docs/d/ccn_routes.html.markdown @@ -0,0 +1,68 @@ +--- +subcategory: "Cloud Connect Network(CCN)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_ccn_routes" +sidebar_current: "docs-tencentcloud-datasource-ccn_routes" +description: |- + Use this data source to query detailed information of CCN routes. +--- + +# tencentcloud_ccn_routes + +Use this data source to query detailed information of CCN routes. + +## Example Usage + +### Query CCN instance all routes + +```hcl +data "tencentcloud_ccn_routes" "routes" { + ccn_id = "ccn-gr7nynbd" +} +``` + +### Query CCN instance routes by filter + +```hcl +data "tencentcloud_ccn_routes" "routes" { + ccn_id = "ccn-gr7nynbd" + filters { + name = "route-table-id" + values = ["ccnrtb-jpf7bzn3"] + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ccn_id` - (Required, String) ID of the CCN to be queried. +* `filters` - (Optional, List) Filter conditions. +* `result_output_file` - (Optional, String) Used to save results. + +The `filters` object supports the following: + +* `name` - (Required, String) Field to be filtered. Support `route-id`, `cidr-block`, `instance-type`, `instance-region`, `instance-id`, `route-table-id`. +* `values` - (Required, Set) Filter value of the field. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `route_list` - CCN route list. + * `destination_cidr_block` - Destination. + * `enabled` - Is routing enabled. + * `extra_state` - Extension status of routing. + * `instance_extra_name` - Next hop extension name (associated instance extension name). + * `instance_id` - Next jump (associated instance ID). + * `instance_name` - Next jump (associated instance name). + * `instance_region` - Next jump (associated instance region). + * `instance_type` - Next hop type (associated instance type), all types: VPC, DIRECTCONNECT. + * `instance_uin` - The UIN (root account) to which the associated instance belongs. + * `is_bgp` - Is it dynamic routing. + * `route_id` - route ID. + * `route_priority` - Routing priority. + * `update_time` - update time. + + diff --git a/website/docs/r/ccn_route_table.html.markdown b/website/docs/r/ccn_route_table.html.markdown new file mode 100644 index 0000000000..2c3ca06641 --- /dev/null +++ b/website/docs/r/ccn_route_table.html.markdown @@ -0,0 +1,84 @@ +--- +subcategory: "Cloud Connect Network(CCN)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_ccn_route_table" +sidebar_current: "docs-tencentcloud-resource-ccn_route_table" +description: |- + Provides a resource to create a CCN Route table. +--- + +# tencentcloud_ccn_route_table + +Provides a resource to create a CCN Route table. + +## Example Usage + +```hcl +variable "region" { + default = "ap-guangzhou" +} + +variable "availability_zone" { + default = "ap-guangzhou-4" +} + +# create vpc +resource "tencentcloud_vpc" "vpc" { + name = "vpc" + cidr_block = "172.16.0.0/16" +} + +# create subnet +resource "tencentcloud_subnet" "subnet" { + availability_zone = var.availability_zone + name = "subnet" + vpc_id = tencentcloud_vpc.vpc.id + cidr_block = "10.0.20.0/28" + is_multicast = false +} + +# create ccn +resource "tencentcloud_ccn" "example" { + name = "tf-example" + description = "desc." + qos = "AG" + charge_type = "PREPAID" + bandwidth_limit_type = "INTER_REGION_LIMIT" + tags = { + createBy = "terraform" + } +} + +# create ccn route table +resource "tencentcloud_ccn_route_table" "example" { + ccn_id = tencentcloud_ccn.example.id + name = "tf-example" + description = "desc." +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ccn_id` - (Required, String, ForceNew) CCN Instance ID. +* `description` - (Required, String) Description of CCN Route table. +* `name` - (Required, String) CCN Route table name. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. +* `create_time` - create time. +* `is_default_table` - True: default routing table False: non default routing table. + + +## Import + +Ccn instance can be imported, e.g. + +``` +$ terraform import tencentcloud_ccn_route_table.example ccnrtb-r5hrr417 +``` + diff --git a/website/docs/r/ccn_route_table_associate_instance_config.html.markdown b/website/docs/r/ccn_route_table_associate_instance_config.html.markdown new file mode 100644 index 0000000000..eac700c090 --- /dev/null +++ b/website/docs/r/ccn_route_table_associate_instance_config.html.markdown @@ -0,0 +1,107 @@ +--- +subcategory: "Cloud Connect Network(CCN)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_ccn_route_table_associate_instance_config" +sidebar_current: "docs-tencentcloud-resource-ccn_route_table_associate_instance_config" +description: |- + Provides a resource to create a CCN Route table associate instance config. +--- + +# tencentcloud_ccn_route_table_associate_instance_config + +Provides a resource to create a CCN Route table associate instance config. + +## Example Usage + +```hcl +variable "region" { + default = "ap-guangzhou" +} + +variable "availability_zone" { + default = "ap-guangzhou-4" +} + +# create vpc +resource "tencentcloud_vpc" "vpc" { + name = "vpc" + cidr_block = "172.16.0.0/16" +} + +# create subnet +resource "tencentcloud_subnet" "subnet" { + availability_zone = var.availability_zone + name = "subnet" + vpc_id = tencentcloud_vpc.vpc.id + cidr_block = "172.16.0.0/24" + is_multicast = false +} + +# create ccn +resource "tencentcloud_ccn" "example" { + name = "tf-example" + description = "desc." + qos = "AG" + charge_type = "PREPAID" + bandwidth_limit_type = "INTER_REGION_LIMIT" + tags = { + createBy = "terraform" + } +} + +# create ccn route table +resource "tencentcloud_ccn_route_table" "example" { + ccn_id = tencentcloud_ccn.example.id + name = "tf-example" + description = "desc." +} + +# attachment instance +resource "tencentcloud_ccn_attachment" "attachment" { + ccn_id = tencentcloud_ccn.example.id + instance_id = tencentcloud_vpc.vpc.id + instance_type = "VPC" + instance_region = var.region + route_table_id = tencentcloud_ccn_route_table.example.id +} + +# route table associate instance +resource "tencentcloud_ccn_route_table_associate_instance_config" "example" { + ccn_id = tencentcloud_ccn.example.id + route_table_id = tencentcloud_ccn_route_table.example.id + instances { + instance_id = tencentcloud_vpc.vpc.id + instance_type = "VPC" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ccn_id` - (Required, String) ID of the CCN. +* `instances` - (Required, Set) Instances list. +* `route_table_id` - (Required, String) Ccn instance route table ID. + +The `instances` object supports the following: + +* `instance_id` - (Required, String) Instances ID. +* `instance_type` - (Required, String) Cloud networking supports instance types: VPC, DIRECTCONNECT, BMVPC, EDGE, EDGE_TUNNEL, EDGE_VPNGW, VPNGW. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +Ccn instance can be imported, e.g. + +``` +$ terraform import tencentcloud_ccn_route_table_associate_instance_config.example ccn-gr7nynbd#ccnrtb-jpf7bzn3 +``` + diff --git a/website/docs/r/ccn_route_table_broadcast_policies.html.markdown b/website/docs/r/ccn_route_table_broadcast_policies.html.markdown new file mode 100644 index 0000000000..e58ec8833a --- /dev/null +++ b/website/docs/r/ccn_route_table_broadcast_policies.html.markdown @@ -0,0 +1,134 @@ +--- +subcategory: "Cloud Connect Network(CCN)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_ccn_route_table_broadcast_policies" +sidebar_current: "docs-tencentcloud-resource-ccn_route_table_broadcast_policies" +description: |- + Provides a resource to create a CCN Route table broadcast policies. +--- + +# tencentcloud_ccn_route_table_broadcast_policies + +Provides a resource to create a CCN Route table broadcast policies. + +~> **NOTE:** Use this resource to manage all broadcast policies under the routing table of CCN instances. + +## Example Usage + +```hcl +variable "region" { + default = "ap-guangzhou" +} + +variable "availability_zone" { + default = "ap-guangzhou-4" +} + +# create vpc +resource "tencentcloud_vpc" "vpc" { + name = "vpc" + cidr_block = "172.16.0.0/16" +} + +# create subnet +resource "tencentcloud_subnet" "subnet" { + availability_zone = var.availability_zone + name = "subnet" + vpc_id = tencentcloud_vpc.vpc.id + cidr_block = "172.16.0.0/24" + is_multicast = false +} + +# create ccn +resource "tencentcloud_ccn" "example" { + name = "tf-example" + description = "desc." + qos = "AG" + charge_type = "PREPAID" + bandwidth_limit_type = "INTER_REGION_LIMIT" + tags = { + createBy = "terraform" + } +} + +# create ccn route table +resource "tencentcloud_ccn_route_table" "example" { + ccn_id = tencentcloud_ccn.example.id + name = "tf-example" + description = "desc." +} + +# attachment instance +resource "tencentcloud_ccn_attachment" "attachment" { + ccn_id = tencentcloud_ccn.example.id + instance_id = tencentcloud_vpc.vpc.id + instance_type = "VPC" + instance_region = var.region + route_table_id = tencentcloud_ccn_route_table.example.id +} + +# create route table broadcast policy +resource "tencentcloud_ccn_route_table_broadcast_policies" "example" { + ccn_id = tencentcloud_ccn.example.id + route_table_id = tencentcloud_ccn_route_table.example.id + policies { + action = "accept" + description = "desc." + route_conditions { + name = "instance-region" + values = ["ap-guangzhou"] + match_pattern = 1 + } + + broadcast_conditions { + name = "instance-region" + values = ["ap-shanghai"] + match_pattern = 1 + } + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ccn_id` - (Required, String, ForceNew) CCN Instance ID. +* `policies` - (Required, List) Routing propagation strategy. +* `route_table_id` - (Required, String, ForceNew) CCN Route table ID. + +The `broadcast_conditions` object of `policies` supports the following: + +* `match_pattern` - (Required, Int) Matching mode, `1` precise matching, `0` fuzzy matching. +* `name` - (Required, String) condition type. +* `values` - (Required, List) List of conditional values. + +The `policies` object supports the following: + +* `action` - (Required, String) Routing behavior, `accept` allows, `drop` rejects. +* `broadcast_conditions` - (Required, List) propagation conditions. +* `description` - (Required, String) Policy description. +* `route_conditions` - (Required, List) Routing conditions. + +The `route_conditions` object of `policies` supports the following: + +* `match_pattern` - (Required, Int) Matching mode, `1` precise matching, `0` fuzzy matching. +* `name` - (Required, String) condition type. +* `values` - (Required, List) List of conditional values. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +Ccn instance can be imported, e.g. + +``` +$ terraform import tencentcloud_ccn_route_table_broadcast_policies.example ccn-gr7nynbd#ccnrtb-jpf7bzn3 +``` + diff --git a/website/docs/r/ccn_route_table_input_policies.html.markdown b/website/docs/r/ccn_route_table_input_policies.html.markdown new file mode 100644 index 0000000000..d4f9821ac7 --- /dev/null +++ b/website/docs/r/ccn_route_table_input_policies.html.markdown @@ -0,0 +1,121 @@ +--- +subcategory: "Cloud Connect Network(CCN)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_ccn_route_table_input_policies" +sidebar_current: "docs-tencentcloud-resource-ccn_route_table_input_policies" +description: |- + Provides a resource to create a CCN Route table input policies. +--- + +# tencentcloud_ccn_route_table_input_policies + +Provides a resource to create a CCN Route table input policies. + +~> **NOTE:** Use this resource to manage all input policies under the routing table of CCN instances. + +## Example Usage + +```hcl +variable "region" { + default = "ap-guangzhou" +} + +variable "availability_zone" { + default = "ap-guangzhou-4" +} + +# create vpc +resource "tencentcloud_vpc" "vpc" { + name = "vpc" + cidr_block = "172.16.0.0/16" +} + +# create subnet +resource "tencentcloud_subnet" "subnet" { + availability_zone = var.availability_zone + name = "subnet" + vpc_id = tencentcloud_vpc.vpc.id + cidr_block = "172.16.0.0/24" + is_multicast = false +} + +# create ccn +resource "tencentcloud_ccn" "example" { + name = "tf-example" + description = "desc." + qos = "AG" + charge_type = "PREPAID" + bandwidth_limit_type = "INTER_REGION_LIMIT" + tags = { + createBy = "terraform" + } +} + +# create ccn route table +resource "tencentcloud_ccn_route_table" "example" { + ccn_id = tencentcloud_ccn.example.id + name = "tf-example" + description = "desc." +} + +# attachment instance +resource "tencentcloud_ccn_attachment" "attachment" { + ccn_id = tencentcloud_ccn.example.id + instance_id = tencentcloud_vpc.vpc.id + instance_type = "VPC" + instance_region = var.region + route_table_id = tencentcloud_ccn_route_table.example.id +} + +# create route table input policy +resource "tencentcloud_ccn_route_table_input_policies" "example" { + ccn_id = tencentcloud_ccn.example.id + route_table_id = tencentcloud_ccn_route_table.example.id + policies { + action = "accept" + description = "desc." + route_conditions { + name = "instance-region" + values = [var.region] + match_pattern = 1 + } + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ccn_id` - (Required, String, ForceNew) CCN Instance ID. +* `route_table_id` - (Required, String, ForceNew) CCN Route table ID. +* `policies` - (Optional, List) Routing reception strategy. + +The `policies` object supports the following: + +* `action` - (Required, String) Routing behavior, `accept` allows, `drop` rejects. +* `description` - (Required, String) Policy description. +* `route_conditions` - (Required, List) Routing conditions. + +The `route_conditions` object of `policies` supports the following: + +* `match_pattern` - (Required, Int) Matching mode, `1` precise matching, `0` fuzzy matching. +* `name` - (Required, String) condition type. +* `values` - (Required, List) List of conditional values. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +Ccn instance can be imported, e.g. + +``` +$ terraform import tencentcloud_ccn_route_table_input_policies.example ccn-gr7nynbd#ccnrtb-jpf7bzn3 +``` + diff --git a/website/docs/r/ccn_route_table_selection_policies.html.markdown b/website/docs/r/ccn_route_table_selection_policies.html.markdown new file mode 100644 index 0000000000..92ba541aed --- /dev/null +++ b/website/docs/r/ccn_route_table_selection_policies.html.markdown @@ -0,0 +1,113 @@ +--- +subcategory: "Cloud Connect Network(CCN)" +layout: "tencentcloud" +page_title: "TencentCloud: tencentcloud_ccn_route_table_selection_policies" +sidebar_current: "docs-tencentcloud-resource-ccn_route_table_selection_policies" +description: |- + Provides a resource to create a CCN Route table selection policies. +--- + +# tencentcloud_ccn_route_table_selection_policies + +Provides a resource to create a CCN Route table selection policies. + +~> **NOTE:** Use this resource to manage all selection policies under the routing table of CCN instances. + +## Example Usage + +```hcl +variable "region" { + default = "ap-guangzhou" +} + +variable "availability_zone" { + default = "ap-guangzhou-4" +} + +# create vpc +resource "tencentcloud_vpc" "vpc" { + name = "vpc" + cidr_block = "172.16.0.0/16" +} + +# create subnet +resource "tencentcloud_subnet" "subnet" { + availability_zone = var.availability_zone + name = "subnet" + vpc_id = tencentcloud_vpc.vpc.id + cidr_block = "172.16.0.0/24" + is_multicast = false +} + +# create ccn +resource "tencentcloud_ccn" "example" { + name = "tf-example" + description = "desc." + qos = "AG" + charge_type = "PREPAID" + bandwidth_limit_type = "INTER_REGION_LIMIT" + tags = { + createBy = "terraform" + } +} + +# create ccn route table +resource "tencentcloud_ccn_route_table" "example" { + ccn_id = tencentcloud_ccn.example.id + name = "tf-example" + description = "desc." +} + +# attachment instance +resource "tencentcloud_ccn_attachment" "attachment" { + ccn_id = tencentcloud_ccn.example.id + instance_id = tencentcloud_vpc.vpc.id + instance_type = "VPC" + instance_region = var.region + route_table_id = tencentcloud_ccn_route_table.example.id +} + +# create route table selection policy +resource "tencentcloud_ccn_route_table_selection_policies" "example" { + ccn_id = tencentcloud_ccn.example.id + selection_policies { + instance_type = "VPC" + instance_id = tencentcloud_vpc.vpc.id + source_cidr_block = "192.168.100.0/24" + route_table_id = tencentcloud_ccn_route_table.example.id + description = "desc." + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ccn_id` - (Required, String, ForceNew) CCN Instance ID. +* `selection_policies` - (Required, List) Select strategy information set. + +The `selection_policies` object supports the following: + +* `description` - (Required, String) description. +* `instance_id` - (Required, String) Instance ID. +* `instance_type` - (Required, String) Instance Type: Private Network: VPC, Dedicated Gateway: DIRECTCONNECT, Blackstone Private Network: BMVPC, EDGE Device: EDGE, EDGE Tunnel: EDGE_TUNNEL, EDGE Gateway: EDGE_VPNGW, VPN Gateway: VPNGW. +* `route_table_id` - (Required, String) route table ID. +* `source_cidr_block` - (Required, String) Source CIDR. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - ID of the resource. + + + +## Import + +Ccn instance can be imported, e.g. + +``` +$ terraform import tencentcloud_ccn_route_table_selection_policies.example ccn-gr7nynbd +``` + diff --git a/website/tencentcloud.erb b/website/tencentcloud.erb index 1a11355d25..1ea3f2179a 100644 --- a/website/tencentcloud.erb +++ b/website/tencentcloud.erb @@ -896,6 +896,9 @@
  • tencentcloud_ccn_instances
  • +
  • + tencentcloud_ccn_routes +
  • tencentcloud_ccn_tenant_instances
  • @@ -922,6 +925,21 @@
  • tencentcloud_ccn_instances_reset_attach
  • +
  • + tencentcloud_ccn_route_table +
  • +
  • + tencentcloud_ccn_route_table_associate_instance_config +
  • +
  • + tencentcloud_ccn_route_table_broadcast_policies +
  • +
  • + tencentcloud_ccn_route_table_input_policies +
  • +
  • + tencentcloud_ccn_route_table_selection_policies +
  • tencentcloud_ccn_routes