Skip to content

Commit

Permalink
Merge pull request #157 from volcengine/feat/tr
Browse files Browse the repository at this point in the history
Feat/tr
  • Loading branch information
zpp12354321 authored Jan 22, 2024
2 parents 87c1039 + ae97a9d commit a214f9e
Show file tree
Hide file tree
Showing 27 changed files with 797 additions and 94 deletions.
2 changes: 1 addition & 1 deletion common/common_volcengine_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package common

const (
TerraformProviderName = "terraform-provider-volcengine"
TerraformProviderVersion = "0.0.136"
TerraformProviderVersion = "0.0.137"
)
16 changes: 14 additions & 2 deletions example/dataTransitRouterRouteTables/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
resource "volcengine_transit_router" "foo" {
transit_router_name = "test-tf-acc"
description = "test-tf-acc"
}

resource "volcengine_transit_router_route_table" "foo" {
description = "tf-test-acc-description"
transit_router_route_table_name = "tf-table-test-acc"
transit_router_id = volcengine_transit_router.foo.id
}


data "volcengine_transit_router_route_tables" "default" {
transit_router_id = "tr-2ff4v69tkxji859gp684cm14e"
ids = ["tr-rtb-12b7qd3fmzf2817q7y2jkbd55"]
transit_router_id = volcengine_transit_router.foo.id
ids = [volcengine_transit_router_route_table.foo.transit_router_route_table_id]
//transit_router_route_table_type = ""
}
9 changes: 7 additions & 2 deletions example/dataTransitRouters/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
resource "volcengine_transit_router" "foo" {
transit_router_name = "test-tf-acc"
description = "test-tf-acc"
}

data "volcengine_transit_routers" "default" {
ids = ["tr-2d6fr7mzya2gw58ozfes5g2oh"]
transit_router_name = "tf2"
ids = [volcengine_transit_router.foo.id]
transit_router_name = "test"
}
24 changes: 19 additions & 5 deletions example/transitRouterDirectConnectGatewayAttachment/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
resource "volcengine_transit_router" "foo" {
transit_router_name = "acc-test-tf-acc"
description = "acc-test-tf-acc"
}

resource "volcengine_direct_connect_gateway" "foo"{
direct_connect_gateway_name="acc-test-gateway-acc"
description="acc-test-acc"
tags{
key="k1"
value="v1"
}
}

resource "volcengine_transit_router_direct_connect_gateway_attachment" "foo" {
transit_router_id = "tr-2bzy39x27qtxc2dx0eg5qaj05"
direct_connect_gateway_id = "dcg-3reaq6ymdzegw5zsk2igxzusb"
description = "tf-test-modify"
transit_router_attachment_name = "tf-test-modify"
}
description = "acc-test-tf"
transit_router_attachment_name = "acc-test-tf"
transit_router_id = volcengine_transit_router.foo.id
direct_connect_gateway_id = volcengine_direct_connect_gateway.foo.id
}
13 changes: 9 additions & 4 deletions example/transitRouterGrantRule/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
resource "volcengine_transit_router" "foo" {
transit_router_name = "acc-test-tf"
description = "acc-test-tf"
}

resource "volcengine_transit_router_grant_rule" "foo" {
transit_router_id = "tr-2bzy39uy6u3282dx0efxiqyq0"
grant_account_id = "200000xxxx"
description = "tf-test"
}
grant_account_id = "2000xxxxx"
description = "acc-test-tf"
transit_router_id = volcengine_transit_router.foo.id
}
27 changes: 21 additions & 6 deletions example/transitRouterPeerAttachment/main.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
resource "volcengine_transit_router_bandwidth_package" "foo" {
transit_router_bandwidth_package_name = "acc-tf-test"
description = "acc-test"
bandwidth = 2
period = 1
renew_type = "Manual"
renew_period = 1
remain_renew_times = -1
}

resource "volcengine_transit_router" "foo" {
transit_router_name = "acc-test-tf"
description = "acc-test-tf"
}

resource "volcengine_transit_router_peer_attachment" "foo" {
transit_router_id = "tr-12bbdsa6ode6817q7y1f5****"
transit_router_attachment_name = "tf-test-tra"
transit_router_id = volcengine_transit_router.foo.id
transit_router_attachment_name = "acc-test-tf"
description = "tf-test"
peer_transit_router_id = "tr-3jgsfiktn0feo3pncmfb5****"
peer_transit_router_region_id = "cn-beijing"
transit_router_bandwidth_package_id = "tbp-cd-2felfww0i6pkw59gp68bq****"
peer_transit_router_id = "tr-xxx"
peer_transit_router_region_id = "cn-xx"
transit_router_bandwidth_package_id = volcengine_transit_router_bandwidth_package.foo.id
bandwidth = 2
}
}
87 changes: 81 additions & 6 deletions example/transitRouterRouteEntry/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,83 @@
data "volcengine_zones" "foo"{
}

resource "volcengine_vpc" "foo" {
vpc_name = "acc-test-vpc"
cidr_block = "172.16.0.0/16"
}

resource "volcengine_subnet" "foo" {
subnet_name = "acc-test-subnet"
cidr_block = "172.16.0.0/24"
zone_id = data.volcengine_zones.foo.zones[0].id
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_vpn_gateway" "foo" {
vpc_id = volcengine_vpc.foo.id
subnet_id = volcengine_subnet.foo.id
bandwidth = 20
vpn_gateway_name = "acc-test"
description = "acc-test"
period = 2
}

resource "volcengine_customer_gateway" "foo" {
ip_address = "192.0.1.3"
customer_gateway_name = "acc-test"
description = "acc-test"
}

resource "volcengine_vpn_connection" "foo" {
vpn_connection_name = "acc-tf-test"
description = "acc-tf-test"
attach_type = "TransitRouter"
vpn_gateway_id = volcengine_vpn_gateway.foo.id
customer_gateway_id = volcengine_customer_gateway.foo.id
local_subnet = ["192.168.0.0/22"]
remote_subnet = ["192.161.0.0/20"]
dpd_action = "none"
nat_traversal = true
ike_config_psk = "acctest@!3"
ike_config_version = "ikev1"
ike_config_mode = "main"
ike_config_enc_alg = "aes"
ike_config_auth_alg = "md5"
ike_config_dh_group = "group2"
ike_config_lifetime = 9000
ike_config_local_id = "acc_test"
ike_config_remote_id = "acc_test"
ipsec_config_enc_alg = "aes"
ipsec_config_auth_alg = "sha256"
ipsec_config_dh_group = "group2"
ipsec_config_lifetime = 9000
log_enabled = false
}

resource "volcengine_transit_router_vpn_attachment" "foo" {
zone_id = "cn-beijing-a"
transit_router_attachment_name = "tf-test-acc"
description = "tf-test-acc-desc"
transit_router_id = volcengine_transit_router.foo.id
vpn_connection_id = volcengine_vpn_connection.foo.id
}

resource "volcengine_transit_router" "foo" {
transit_router_name = "test-tf-acc"
description = "test-tf-acc"
}

resource "volcengine_transit_router_route_table" "foo" {
description = "tf-test-acc-description-route-route-table"
transit_router_route_table_name = "tf-table-test-acc"
transit_router_id = volcengine_transit_router.foo.id
}

resource "volcengine_transit_router_route_entry" "foo" {
transit_router_route_table_id = "tr-rtb-12b7qd3fmzf2817q7y2jkbd55"
description = "tf-test-acc-description-entry"
transit_router_route_entry_name = "tf-acc-test-entry"
destination_cidr_block = "192.168.0.0/24"
transit_router_route_entry_next_hop_type = "BlackHole"
//transit_router_route_entry_next_hop_id = ""
description = "tf test 23"
transit_router_route_entry_name = "tf-entry-23"
}
transit_router_route_entry_next_hop_type = "Attachment"
transit_router_route_table_id = volcengine_transit_router_route_table.foo.transit_router_route_table_id
transit_router_route_entry_next_hop_id = volcengine_transit_router_vpn_attachment.foo.transit_router_attachment_id
}
13 changes: 9 additions & 4 deletions example/transitRouterRouteTable/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
resource "volcengine_transit_router" "foo" {
transit_router_name = "test-tf-acc"
description = "test-tf-acc"
}

resource "volcengine_transit_router_route_table" "foo" {
transit_router_id = "tr-2ff4v69tkxji859gp684cm14e"
description = "tf test23"
transit_router_route_table_name = "tf-table-23"
}
description = "tf-test-acc-description"
transit_router_route_table_name = "tf-table-test-acc"
transit_router_id = volcengine_transit_router.foo.id
}
81 changes: 78 additions & 3 deletions example/transitRouterRouteTableAssociation/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,79 @@
resource "volcengine_transit_router" "foo" {
transit_router_name = "test-tf-acc"
description = "test-tf-acc"
}

resource "volcengine_transit_router_route_table" "foo" {
description = "tf-test-acc-description"
transit_router_route_table_name = "tf-table-test-acc"
transit_router_id = volcengine_transit_router.foo.id
}

data "volcengine_zones" "foo"{
}

resource "volcengine_vpc" "foo" {
vpc_name = "acc-test-vpc"
cidr_block = "172.16.0.0/16"
}

resource "volcengine_subnet" "foo" {
subnet_name = "acc-test-subnet"
cidr_block = "172.16.0.0/24"
zone_id = data.volcengine_zones.foo.zones[0].id
vpc_id = volcengine_vpc.foo.id
}

resource "volcengine_vpn_gateway" "foo" {
vpc_id = volcengine_vpc.foo.id
subnet_id = volcengine_subnet.foo.id
bandwidth = 20
vpn_gateway_name = "acc-test"
description = "acc-test"
period = 2
}

resource "volcengine_customer_gateway" "foo" {
ip_address = "192.0.1.3"
customer_gateway_name = "acc-test"
description = "acc-test"
}

resource "volcengine_vpn_connection" "foo" {
vpn_connection_name = "acc-tf-test"
description = "acc-tf-test"
attach_type = "TransitRouter"
vpn_gateway_id = volcengine_vpn_gateway.foo.id
customer_gateway_id = volcengine_customer_gateway.foo.id
local_subnet = ["192.168.0.0/22"]
remote_subnet = ["192.161.0.0/20"]
dpd_action = "none"
nat_traversal = true
ike_config_psk = "acctest@!3"
ike_config_version = "ikev1"
ike_config_mode = "main"
ike_config_enc_alg = "aes"
ike_config_auth_alg = "md5"
ike_config_dh_group = "group2"
ike_config_lifetime = 9000
ike_config_local_id = "acc_test"
ike_config_remote_id = "acc_test"
ipsec_config_enc_alg = "aes"
ipsec_config_auth_alg = "sha256"
ipsec_config_dh_group = "group2"
ipsec_config_lifetime = 9000
log_enabled = false
}

resource "volcengine_transit_router_vpn_attachment" "foo" {
zone_id = "cn-beijing-a"
transit_router_attachment_name = "tf-test-acc"
description = "tf-test-acc-desc"
transit_router_id = volcengine_transit_router.foo.id
vpn_connection_id = volcengine_vpn_connection.foo.id
}

resource "volcengine_transit_router_route_table_association" "foo" {
transit_router_attachment_id = "tr-attach-im73ng3n5kao8gbssz2ddpuq"
transit_router_route_table_id = "tr-rtb-12b7qd3fmzf2817q7y2jkbd55"
}
transit_router_attachment_id = volcengine_transit_router_vpn_attachment.foo.transit_router_attachment_id
transit_router_route_table_id = volcengine_transit_router_route_table.foo.transit_router_route_table_id
}
55 changes: 52 additions & 3 deletions example/transitRouterRouteTablePropagation/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,53 @@
resource "volcengine_transit_router" "foo" {
transit_router_name = "test-tf-acc"
description = "test-tf-acc"
}

resource "volcengine_transit_router_route_table" "foo" {
description = "tf-test-acc-description"
transit_router_route_table_name = "tf-table-test-acc"
transit_router_id = volcengine_transit_router.foo.id
}

data "volcengine_zones" "foo" {
}

resource "volcengine_vpc" "foo" {
vpc_name = "acc-test-vpc-acc"
cidr_block = "172.16.0.0/16"
}

resource "volcengine_subnet" "foo" {
vpc_id = volcengine_vpc.foo.id
cidr_block = "172.16.0.0/24"
zone_id = data.volcengine_zones.foo.zones[0].id
subnet_name = "acc-test-subnet"
}

resource "volcengine_subnet" "foo2" {
vpc_id = volcengine_vpc.foo.id
cidr_block = "172.16.255.0/24"
zone_id = data.volcengine_zones.foo.zones[1].id
subnet_name = "acc-test-subnet2"
}


resource "volcengine_transit_router_vpc_attachment" "foo" {
transit_router_id = volcengine_transit_router.foo.id
vpc_id = volcengine_vpc.foo.id
attach_points {
subnet_id = volcengine_subnet.foo.id
zone_id = "cn-beijing-a"
}
attach_points {
subnet_id = volcengine_subnet.foo2.id
zone_id = "cn-beijing-b"
}
transit_router_attachment_name = "tf-test-acc-name1"
description = "tf-test-acc-description"
}

resource "volcengine_transit_router_route_table_propagation" "foo" {
transit_router_attachment_id = "tr-attach-im73ng3n5kao8gbssz2ddpuq"
transit_router_route_table_id = "tr-rtb-12b7qd3fmzf2817q7y2jkbd55"
}
transit_router_attachment_id = volcengine_transit_router_vpc_attachment.foo.transit_router_attachment_id
transit_router_route_table_id = volcengine_transit_router_route_table.foo.transit_router_route_table_id
}
7 changes: 6 additions & 1 deletion example/transitRouterSharedTransitRouterState/main.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
resource "volcengine_transit_router" "foo" {
transit_router_name = "acc-test-tr"
description = "acc-test"
}

resource "volcengine_transit_router_shared_transit_router_state" "foo" {
transit_router_id = "tr-2bzy39uy6u3282dx0efxiqyq0"
transit_router_id = volcengine_transit_router.foo.id
action = "Reject"
}
Loading

0 comments on commit a214f9e

Please sign in to comment.