Skip to content

feat(ccn): [115175599] add new resource #2733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions tencentcloud/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
68 changes: 68 additions & 0 deletions website/docs/d/ccn_routes.html.markdown
Original file line number Diff line number Diff line change
@@ -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.


84 changes: 84 additions & 0 deletions website/docs/r/ccn_route_table.html.markdown
Original file line number Diff line number Diff line change
@@ -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
```

107 changes: 107 additions & 0 deletions website/docs/r/ccn_route_table_associate_instance_config.html.markdown
Original file line number Diff line number Diff line change
@@ -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
```

Loading
Loading