diff --git a/common/common_volcengine_version.go b/common/common_volcengine_version.go index 5cf17704..2a6ac8f9 100644 --- a/common/common_volcengine_version.go +++ b/common/common_volcengine_version.go @@ -2,5 +2,5 @@ package common const ( TerraformProviderName = "terraform-provider-volcengine" - TerraformProviderVersion = "0.0.136" + TerraformProviderVersion = "0.0.137" ) diff --git a/example/dataTransitRouterRouteTables/main.tf b/example/dataTransitRouterRouteTables/main.tf index 4f331e3a..da76cc33 100644 --- a/example/dataTransitRouterRouteTables/main.tf +++ b/example/dataTransitRouterRouteTables/main.tf @@ -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 = "" } diff --git a/example/dataTransitRouters/main.tf b/example/dataTransitRouters/main.tf index 5157e2b8..6739e793 100644 --- a/example/dataTransitRouters/main.tf +++ b/example/dataTransitRouters/main.tf @@ -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" } \ No newline at end of file diff --git a/example/transitRouterDirectConnectGatewayAttachment/main.tf b/example/transitRouterDirectConnectGatewayAttachment/main.tf index d79459e7..7cbf3512 100644 --- a/example/transitRouterDirectConnectGatewayAttachment/main.tf +++ b/example/transitRouterDirectConnectGatewayAttachment/main.tf @@ -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" -} \ No newline at end of file + 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 +} diff --git a/example/transitRouterGrantRule/main.tf b/example/transitRouterGrantRule/main.tf index c664b078..828c7d76 100644 --- a/example/transitRouterGrantRule/main.tf +++ b/example/transitRouterGrantRule/main.tf @@ -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" -} \ No newline at end of file + grant_account_id = "2000xxxxx" + description = "acc-test-tf" + transit_router_id = volcengine_transit_router.foo.id +} diff --git a/example/transitRouterPeerAttachment/main.tf b/example/transitRouterPeerAttachment/main.tf index dd10bab8..fed79b18 100644 --- a/example/transitRouterPeerAttachment/main.tf +++ b/example/transitRouterPeerAttachment/main.tf @@ -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 -} \ No newline at end of file +} diff --git a/example/transitRouterRouteEntry/main.tf b/example/transitRouterRouteEntry/main.tf index daca0d20..1170f9e0 100644 --- a/example/transitRouterRouteEntry/main.tf +++ b/example/transitRouterRouteEntry/main.tf @@ -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" -} \ No newline at end of file + 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 +} diff --git a/example/transitRouterRouteTable/main.tf b/example/transitRouterRouteTable/main.tf index ad4787fa..f8e006a1 100644 --- a/example/transitRouterRouteTable/main.tf +++ b/example/transitRouterRouteTable/main.tf @@ -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" -} \ No newline at end of file + description = "tf-test-acc-description" + transit_router_route_table_name = "tf-table-test-acc" + transit_router_id = volcengine_transit_router.foo.id +} diff --git a/example/transitRouterRouteTableAssociation/main.tf b/example/transitRouterRouteTableAssociation/main.tf index 06218194..26303f82 100644 --- a/example/transitRouterRouteTableAssociation/main.tf +++ b/example/transitRouterRouteTableAssociation/main.tf @@ -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" -} \ No newline at end of file + 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 +} diff --git a/example/transitRouterRouteTablePropagation/main.tf b/example/transitRouterRouteTablePropagation/main.tf index bfb632a0..ff371c50 100644 --- a/example/transitRouterRouteTablePropagation/main.tf +++ b/example/transitRouterRouteTablePropagation/main.tf @@ -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" -} \ No newline at end of file + 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 +} diff --git a/example/transitRouterSharedTransitRouterState/main.tf b/example/transitRouterSharedTransitRouterState/main.tf index 71be023d..aede4603 100644 --- a/example/transitRouterSharedTransitRouterState/main.tf +++ b/example/transitRouterSharedTransitRouterState/main.tf @@ -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" } \ No newline at end of file diff --git a/example/transitRouterVpcAttachment/main.tf b/example/transitRouterVpcAttachment/main.tf index 034b7887..e877ad53 100644 --- a/example/transitRouterVpcAttachment/main.tf +++ b/example/transitRouterVpcAttachment/main.tf @@ -1,14 +1,42 @@ +resource "volcengine_transit_router" "foo" { + transit_router_name = "test-tf-acc" + description = "test-tf-acc" +} + +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 = "tr-2d6fr7f39unsw58ozfe1ow21x" - vpc_id = "vpc-2bysvq1xx543k2dx0eeulpeiv" + transit_router_id = volcengine_transit_router.foo.id + vpc_id = volcengine_vpc.foo.id attach_points { - subnet_id = "subnet-3refsrxdswsn45zsk2hmdg4zx" + subnet_id = volcengine_subnet.foo.id zone_id = "cn-beijing-a" } attach_points { - subnet_id = "subnet-2d68bh74345q858ozfekrm8fj" - zone_id = "cn-beijing-a" + subnet_id = volcengine_subnet.foo2.id + zone_id = "cn-beijing-b" } - transit_router_attachment_name = "tfname1" - description = "desc" -} \ No newline at end of file + transit_router_attachment_name = "tf-test-acc-name1" + description = "tf-test-acc-description" +} diff --git a/example/transitRouterVpnAttachment/main.tf b/example/transitRouterVpnAttachment/main.tf index c5ca0e5c..3a07cbad 100644 --- a/example/transitRouterVpnAttachment/main.tf +++ b/example/transitRouterVpnAttachment/main.tf @@ -1,7 +1,68 @@ +resource "volcengine_transit_router" "foo" { + transit_router_name = "test-tf-acc" + description = "test-tf-acc" +} + +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" { - transit_router_id = "tr-2d6frp10q687458ozfep4****" - vpn_connection_id = "vgc-3reidwjf1t1c05zsk2hik****" zone_id = "cn-beijing-a" - transit_router_attachment_name = "tf-test" - description = "desc" -} \ No newline at end of file + 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 +} diff --git a/volcengine/rds_mysql/rds_mysql_account/service_volcengine_rds_mysql_account.go b/volcengine/rds_mysql/rds_mysql_account/service_volcengine_rds_mysql_account.go index acecc12e..40b441e8 100644 --- a/volcengine/rds_mysql/rds_mysql_account/service_volcengine_rds_mysql_account.go +++ b/volcengine/rds_mysql/rds_mysql_account/service_volcengine_rds_mysql_account.go @@ -31,7 +31,7 @@ func (s *VolcengineRdsMysqlAccountService) GetClient() *volc.SdkClient { } func (s *VolcengineRdsMysqlAccountService) ReadResources(m map[string]interface{}) ([]interface{}, error) { - return volc.WithPageNumberQuery(m, "PageSize", "PageNumber", 20, 0, func(condition map[string]interface{}) (data []interface{}, err error) { + return volc.WithPageNumberQuery(m, "PageSize", "PageNumber", 20, 1, func(condition map[string]interface{}) (data []interface{}, err error) { var ( resp *map[string]interface{} results interface{} diff --git a/volcengine/rds_mysql/rds_mysql_database/service_volcengine_rds_mysql_database.go b/volcengine/rds_mysql/rds_mysql_database/service_volcengine_rds_mysql_database.go index 6444369a..9469175e 100644 --- a/volcengine/rds_mysql/rds_mysql_database/service_volcengine_rds_mysql_database.go +++ b/volcengine/rds_mysql/rds_mysql_database/service_volcengine_rds_mysql_database.go @@ -129,10 +129,12 @@ func (s *VolcengineRdsMysqlDatabaseService) CreateResource(resourceData *schema. Action: "CreateDatabase", ContentType: volc.ContentTypeJson, ConvertMode: volc.RequestConvertAll, + LockId: func(d *schema.ResourceData) string { + return d.Get("instance_id").(string) + }, Convert: map[string]volc.RequestConvert{ - "database_privileges": { - TargetField: "DatabasePrivileges", - ConvertType: volc.ConvertJsonObjectArray, + "db_name": { + TargetField: "DBName", }, }, ExecuteCall: func(d *schema.ResourceData, client *volc.SdkClient, call volc.SdkCall) (*map[string]interface{}, error) { @@ -160,6 +162,9 @@ func (s *VolcengineRdsMysqlDatabaseService) RemoveResource(resourceData *schema. Action: "DeleteDatabase", ContentType: volc.ContentTypeJson, ConvertMode: volc.RequestConvertIgnore, + LockId: func(d *schema.ResourceData) string { + return d.Get("instance_id").(string) + }, BeforeCall: func(d *schema.ResourceData, client *volc.SdkClient, call volc.SdkCall) (bool, error) { databaseId := d.Id() ids := strings.Split(databaseId, ":") diff --git a/website/docs/d/transit_router_route_tables.html.markdown b/website/docs/d/transit_router_route_tables.html.markdown index ea602eb4..8fc5be8a 100644 --- a/website/docs/d/transit_router_route_tables.html.markdown +++ b/website/docs/d/transit_router_route_tables.html.markdown @@ -10,9 +10,21 @@ description: |- Use this data source to query detailed information of transit router route tables ## Example Usage ```hcl +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 = "" } ``` diff --git a/website/docs/d/transit_routers.html.markdown b/website/docs/d/transit_routers.html.markdown index d4339cb8..8f50c60f 100644 --- a/website/docs/d/transit_routers.html.markdown +++ b/website/docs/d/transit_routers.html.markdown @@ -10,9 +10,14 @@ description: |- Use this data source to query detailed information of transit routers ## Example Usage ```hcl +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" } ``` ## Argument Reference diff --git a/website/docs/r/transit_router_direct_connect_gateway_attachment.html.markdown b/website/docs/r/transit_router_direct_connect_gateway_attachment.html.markdown index a297ce34..d1b4c936 100644 --- a/website/docs/r/transit_router_direct_connect_gateway_attachment.html.markdown +++ b/website/docs/r/transit_router_direct_connect_gateway_attachment.html.markdown @@ -10,11 +10,25 @@ description: |- Provides a resource to manage transit router direct connect gateway attachment ## Example Usage ```hcl +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 } ``` ## Argument Reference diff --git a/website/docs/r/transit_router_grant_rule.html.markdown b/website/docs/r/transit_router_grant_rule.html.markdown index 7a442a6d..f0c198a8 100644 --- a/website/docs/r/transit_router_grant_rule.html.markdown +++ b/website/docs/r/transit_router_grant_rule.html.markdown @@ -10,10 +10,15 @@ description: |- Provides a resource to manage transit router grant rule ## Example Usage ```hcl +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 } ``` ## Argument Reference diff --git a/website/docs/r/transit_router_peer_attachment.html.markdown b/website/docs/r/transit_router_peer_attachment.html.markdown index 231eec02..1c99fd0e 100644 --- a/website/docs/r/transit_router_peer_attachment.html.markdown +++ b/website/docs/r/transit_router_peer_attachment.html.markdown @@ -10,13 +10,28 @@ description: |- Provides a resource to manage transit router peer attachment ## Example Usage ```hcl +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 } ``` diff --git a/website/docs/r/transit_router_route_entry.html.markdown b/website/docs/r/transit_router_route_entry.html.markdown index 2d0cdb53..cc02bacc 100644 --- a/website/docs/r/transit_router_route_entry.html.markdown +++ b/website/docs/r/transit_router_route_entry.html.markdown @@ -10,13 +10,88 @@ description: |- Provides a resource to manage transit router route entry ## Example Usage ```hcl +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 } ``` ## Argument Reference diff --git a/website/docs/r/transit_router_route_table.html.markdown b/website/docs/r/transit_router_route_table.html.markdown index 9694b3de..ed1087fd 100644 --- a/website/docs/r/transit_router_route_table.html.markdown +++ b/website/docs/r/transit_router_route_table.html.markdown @@ -10,10 +10,15 @@ description: |- Provides a resource to manage transit router route table ## Example Usage ```hcl +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 } ``` ## Argument Reference diff --git a/website/docs/r/transit_router_route_table_association.html.markdown b/website/docs/r/transit_router_route_table_association.html.markdown index c00aafb4..ab9e5bc7 100644 --- a/website/docs/r/transit_router_route_table_association.html.markdown +++ b/website/docs/r/transit_router_route_table_association.html.markdown @@ -10,9 +10,84 @@ description: |- Provides a resource to manage transit router route table association ## Example Usage ```hcl +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 } ``` ## Argument Reference diff --git a/website/docs/r/transit_router_route_table_propagation.html.markdown b/website/docs/r/transit_router_route_table_propagation.html.markdown index 0c3e11d4..f97d7b4b 100644 --- a/website/docs/r/transit_router_route_table_propagation.html.markdown +++ b/website/docs/r/transit_router_route_table_propagation.html.markdown @@ -10,9 +10,58 @@ description: |- Provides a resource to manage transit router route table propagation ## Example Usage ```hcl +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 } ``` ## Argument Reference diff --git a/website/docs/r/transit_router_shared_transit_router_state.html.markdown b/website/docs/r/transit_router_shared_transit_router_state.html.markdown index 5c2b56ff..c3641895 100644 --- a/website/docs/r/transit_router_shared_transit_router_state.html.markdown +++ b/website/docs/r/transit_router_shared_transit_router_state.html.markdown @@ -10,8 +10,13 @@ description: |- Provides a resource to manage transit router shared transit router state ## Example Usage ```hcl +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" } ``` diff --git a/website/docs/r/transit_router_vpc_attachment.html.markdown b/website/docs/r/transit_router_vpc_attachment.html.markdown index 042aaca5..eec69450 100644 --- a/website/docs/r/transit_router_vpc_attachment.html.markdown +++ b/website/docs/r/transit_router_vpc_attachment.html.markdown @@ -10,19 +10,47 @@ description: |- Provides a resource to manage transit router vpc attachment ## Example Usage ```hcl +resource "volcengine_transit_router" "foo" { + transit_router_name = "test-tf-acc" + description = "test-tf-acc" +} + +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 = "tr-2d6fr7f39unsw58ozfe1ow21x" - vpc_id = "vpc-2bysvq1xx543k2dx0eeulpeiv" + transit_router_id = volcengine_transit_router.foo.id + vpc_id = volcengine_vpc.foo.id attach_points { - subnet_id = "subnet-3refsrxdswsn45zsk2hmdg4zx" + subnet_id = volcengine_subnet.foo.id zone_id = "cn-beijing-a" } attach_points { - subnet_id = "subnet-2d68bh74345q858ozfekrm8fj" - zone_id = "cn-beijing-a" + subnet_id = volcengine_subnet.foo2.id + zone_id = "cn-beijing-b" } - transit_router_attachment_name = "tfname1" - description = "desc" + transit_router_attachment_name = "tf-test-acc-name1" + description = "tf-test-acc-description" } ``` ## Argument Reference diff --git a/website/docs/r/transit_router_vpn_attachment.html.markdown b/website/docs/r/transit_router_vpn_attachment.html.markdown index d309309e..bf78bf3e 100644 --- a/website/docs/r/transit_router_vpn_attachment.html.markdown +++ b/website/docs/r/transit_router_vpn_attachment.html.markdown @@ -10,12 +10,73 @@ description: |- Provides a resource to manage transit router vpn attachment ## Example Usage ```hcl +resource "volcengine_transit_router" "foo" { + transit_router_name = "test-tf-acc" + description = "test-tf-acc" +} + +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" { - transit_router_id = "tr-2d6frp10q687458ozfep4****" - vpn_connection_id = "vgc-3reidwjf1t1c05zsk2hik****" zone_id = "cn-beijing-a" - transit_router_attachment_name = "tf-test" - description = "desc" + 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 } ``` ## Argument Reference