diff --git a/common/common_volcengine_version.go b/common/common_volcengine_version.go index 3ea26f6a..f6cd8846 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.147" + TerraformProviderVersion = "0.0.148" ) diff --git a/example/dataSnatEntries/main.tf b/example/dataSnatEntries/main.tf index eaf51697..86d0d9de 100644 --- a/example/dataSnatEntries/main.tf +++ b/example/dataSnatEntries/main.tf @@ -46,7 +46,7 @@ resource "volcengine_snat_entry" "foo1" { nat_gateway_id = volcengine_nat_gateway.foo.id eip_id = volcengine_eip_address.foo.id source_cidr = "172.16.0.0/24" - depends_on = ["volcengine_eip_associate.foo"] + depends_on = [volcengine_eip_associate.foo] } resource "volcengine_snat_entry" "foo2" { @@ -54,7 +54,7 @@ resource "volcengine_snat_entry" "foo2" { nat_gateway_id = volcengine_nat_gateway.foo.id eip_id = volcengine_eip_address.foo.id source_cidr = "172.16.0.0/16" - depends_on = ["volcengine_eip_associate.foo"] + depends_on = [volcengine_eip_associate.foo] } data "volcengine_snat_entries" "foo"{ diff --git a/example/snatEntry/main.tf b/example/snatEntry/main.tf index 7b3bfbe0..242a32f5 100644 --- a/example/snatEntry/main.tf +++ b/example/snatEntry/main.tf @@ -46,5 +46,5 @@ resource "volcengine_snat_entry" "foo" { nat_gateway_id = volcengine_nat_gateway.foo.id eip_id = volcengine_eip_address.foo.id source_cidr = "172.16.0.0/24" - depends_on = ["volcengine_eip_associate.foo"] + depends_on = [volcengine_eip_associate.foo] } diff --git a/example/transitRouter/main.tf b/example/transitRouter/main.tf index 7c849379..26270ff3 100644 --- a/example/transitRouter/main.tf +++ b/example/transitRouter/main.tf @@ -1,9 +1,10 @@ resource "volcengine_transit_router" "foo" { transit_router_name = "acc-test-tr" description = "acc-test" - project_name = "default" + asn = 4294967294 + project_name = "default" tags { - key = "k1" + key = "k1" value = "v1" } } \ No newline at end of file diff --git a/example/transitRouterVpcAttachment/main.tf b/example/transitRouterVpcAttachment/main.tf index be9c296d..b82f54d1 100644 --- a/example/transitRouterVpcAttachment/main.tf +++ b/example/transitRouterVpcAttachment/main.tf @@ -1,14 +1,15 @@ resource "volcengine_transit_router" "foo" { transit_router_name = "test-tf-acc" description = "test-tf-acc" + asn = 4294967293 } data "volcengine_zones" "foo" { } resource "volcengine_vpc" "foo" { - vpc_name = "acc-test-vpc-acc" - cidr_block = "172.16.0.0/16" + vpc_name = "acc-test-vpc-acc" + cidr_block = "172.16.0.0/16" } resource "volcengine_subnet" "foo" { @@ -25,7 +26,6 @@ resource "volcengine_subnet" "foo2" { 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 @@ -37,10 +37,11 @@ resource "volcengine_transit_router_vpc_attachment" "foo" { subnet_id = volcengine_subnet.foo2.id zone_id = "cn-beijing-b" } - transit_router_attachment_name = "tf-test-acc-name1" - description = "tf-test-acc-description" + transit_router_attachment_name = "tf-test-acc-vpc-attach" + description = "tf-test-acc-description" + auto_publish_route_enabled = true tags { - key = "k1" + key = "k1" value = "v1" } } diff --git a/volcengine/autoscaling/scaling_configuration/resource_volcengine_scaling_configuration.go b/volcengine/autoscaling/scaling_configuration/resource_volcengine_scaling_configuration.go index 7e01d2f5..e4095a3b 100644 --- a/volcengine/autoscaling/scaling_configuration/resource_volcengine_scaling_configuration.go +++ b/volcengine/autoscaling/scaling_configuration/resource_volcengine_scaling_configuration.go @@ -180,6 +180,7 @@ func ResourceVolcengineScalingConfiguration() *schema.Resource { "project_name": { Type: schema.TypeString, Optional: true, + Computed: true, Description: "The project to which the instance created by the scaling configuration belongs.", }, "hpc_cluster_id": { diff --git a/volcengine/cen/cen/resource_volcengine_cen.go b/volcengine/cen/cen/resource_volcengine_cen.go index b4f6e66b..f675d31a 100644 --- a/volcengine/cen/cen/resource_volcengine_cen.go +++ b/volcengine/cen/cen/resource_volcengine_cen.go @@ -49,6 +49,7 @@ func ResourceVolcengineCen() *schema.Resource { "project_name": { Type: schema.TypeString, Optional: true, + Computed: true, Description: "The ProjectName of the cen instance.", }, }, diff --git a/volcengine/cen/cen_bandwidth_package/resource_volcengine_cen_bandwidth_package.go b/volcengine/cen/cen_bandwidth_package/resource_volcengine_cen_bandwidth_package.go index 94a48faf..e55c78b4 100644 --- a/volcengine/cen/cen_bandwidth_package/resource_volcengine_cen_bandwidth_package.go +++ b/volcengine/cen/cen_bandwidth_package/resource_volcengine_cen_bandwidth_package.go @@ -96,6 +96,7 @@ func ResourceVolcengineCenBandwidthPackage() *schema.Resource { "project_name": { Type: schema.TypeString, Optional: true, + Computed: true, Description: "The ProjectName of the cen bandwidth package.", }, }, diff --git a/volcengine/ecs/ecs_instance_state/resource_volcengine_ecs_instance_state.go b/volcengine/ecs/ecs_instance_state/resource_volcengine_ecs_instance_state.go index 60b7e068..6cc46302 100644 --- a/volcengine/ecs/ecs_instance_state/resource_volcengine_ecs_instance_state.go +++ b/volcengine/ecs/ecs_instance_state/resource_volcengine_ecs_instance_state.go @@ -38,7 +38,8 @@ func ResourceVolcengineEcsInstanceState() *schema.Resource { Type: schema.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{"Start", "Stop", "ForceStop"}, false), - Description: "Start or Stop of Instance Action, the value can be `Start`, `Stop` or `ForceStop`.", + Description: "Start or Stop of Instance Action, the value can be `Start`, `Stop` or `ForceStop`. \n" + + "If the target status of the action is consistent with the current status of the instance, the action will not actually be executed.", }, "instance_id": { Type: schema.TypeString, diff --git a/volcengine/ecs/ecs_instance_state/service_volcengine_ecs_instance_state.go b/volcengine/ecs/ecs_instance_state/service_volcengine_ecs_instance_state.go index 537bc8f7..595fdd1e 100644 --- a/volcengine/ecs/ecs_instance_state/service_volcengine_ecs_instance_state.go +++ b/volcengine/ecs/ecs_instance_state/service_volcengine_ecs_instance_state.go @@ -45,6 +45,18 @@ func (s *VolcengineInstanceStateService) CreateResource(resourceData *schema.Res targetStatus = []string{"STOPPED"} } + // 根据实例当前状态判断是否执行操作 + update, err := s.describeCurrentStatus(resourceData, targetStatus) + if err != nil { + return []ve.Callback{{ + Err: err, + }} + } + if !update { + resourceData.SetId(fmt.Sprintf("state:%v", resourceData.Get("instance_id"))) + return []ve.Callback{} + } + callback := ve.Callback{ Call: ve.SdkCall{ Action: action, @@ -215,6 +227,17 @@ func (s *VolcengineInstanceStateService) ModifyResource(resourceData *schema.Res targetStatus = []string{"STOPPED"} } + // 根据实例当前状态判断是否执行操作 + update, err := s.describeCurrentStatus(resourceData, targetStatus) + if err != nil { + return []ve.Callback{{ + Err: err, + }} + } + if !update { + return []ve.Callback{} + } + strs := strings.Split(resourceData.Id(), ":") callback := ve.Callback{ @@ -264,3 +287,22 @@ func (s *VolcengineInstanceStateService) DatasourceResources(*schema.ResourceDat func (s *VolcengineInstanceStateService) ReadResourceId(id string) string { return id } + +func (s *VolcengineInstanceStateService) describeCurrentStatus(resourceData *schema.ResourceData, targetStatus []string) (bool, error) { + instanceId := resourceData.Get("instance_id").(string) + data, err := s.ReadResource(resourceData, "state:"+instanceId) + if err != nil { + return false, err + } + status, err := ve.ObtainSdkValue("Status", data) + if err != nil { + return false, err + } + for _, v := range targetStatus { + // 目标状态和当前状态相同时,不执行操作 + if v == status.(string) { + return false, nil + } + } + return true, nil +} diff --git a/volcengine/nat/snat_entry/data_source_volcengine_snat_entries_test.go b/volcengine/nat/snat_entry/data_source_volcengine_snat_entries_test.go index f8230902..30510669 100644 --- a/volcengine/nat/snat_entry/data_source_volcengine_snat_entries_test.go +++ b/volcengine/nat/snat_entry/data_source_volcengine_snat_entries_test.go @@ -56,7 +56,7 @@ resource "volcengine_snat_entry" "foo1" { nat_gateway_id = "${volcengine_nat_gateway.foo.id}" eip_id = "${volcengine_eip_address.foo.id}" source_cidr = "172.16.0.0/24" - depends_on = ["volcengine_eip_associate.foo"] + depends_on = [volcengine_eip_associate.foo] } resource "volcengine_snat_entry" "foo2" { @@ -64,7 +64,7 @@ resource "volcengine_snat_entry" "foo2" { nat_gateway_id = "${volcengine_nat_gateway.foo.id}" eip_id = "${volcengine_eip_address.foo.id}" source_cidr = "172.16.0.0/16" - depends_on = ["volcengine_eip_associate.foo"] + depends_on = [volcengine_eip_associate.foo] } data "volcengine_snat_entries" "foo"{ diff --git a/volcengine/transit_router/transit_router/data_source_volcengine_transit_routers.go b/volcengine/transit_router/transit_router/data_source_volcengine_transit_routers.go index 7ddb46d7..e220ea7c 100644 --- a/volcengine/transit_router/transit_router/data_source_volcengine_transit_routers.go +++ b/volcengine/transit_router/transit_router/data_source_volcengine_transit_routers.go @@ -60,6 +60,11 @@ func DataSourceVolcengineTransitRouters() *schema.Resource { Computed: true, Description: "The name of the transit router.", }, + "asn": { + Type: schema.TypeInt, + Computed: true, + Description: "The asn of the transit router.", + }, "account_id": { Type: schema.TypeString, Computed: true, diff --git a/volcengine/transit_router/transit_router/resource_volcengine_transit_router.go b/volcengine/transit_router/transit_router/resource_volcengine_transit_router.go index c4ac524c..8f7906fe 100644 --- a/volcengine/transit_router/transit_router/resource_volcengine_transit_router.go +++ b/volcengine/transit_router/transit_router/resource_volcengine_transit_router.go @@ -44,6 +44,13 @@ func ResourceVolcengineTransitRouter() *schema.Resource { Optional: true, Description: "The description of the transit router.", }, + "asn": { + Type: schema.TypeInt, + Optional: true, + ForceNew: true, + Computed: true, + Description: "The asn of the transit router. Valid value range in 64512-65534 and 4200000000-4294967294. Default is 64512.", + }, "project_name": { Type: schema.TypeString, Optional: true, diff --git a/volcengine/transit_router/transit_router/service_volcengine_transit_router.go b/volcengine/transit_router/transit_router/service_volcengine_transit_router.go index 66d24681..c910cd85 100644 --- a/volcengine/transit_router/transit_router/service_volcengine_transit_router.go +++ b/volcengine/transit_router/transit_router/service_volcengine_transit_router.go @@ -5,6 +5,7 @@ import ( "fmt" "time" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ve "github.com/volcengine/terraform-provider-volcengine/common" @@ -202,6 +203,10 @@ func (s *Service) CreateResource(resourceData *schema.ResourceData, resource *sc ConvertType: ve.ConvertListN, }, }, + BeforeCall: func(d *schema.ResourceData, client *ve.SdkClient, call ve.SdkCall) (bool, error) { + (*call.SdkParam)["ClientToken"] = uuid.New().String() + return true, nil + }, ExecuteCall: func(d *schema.ResourceData, client *ve.SdkClient, call ve.SdkCall) (*map[string]interface{}, error) { logger.Debug(logger.RespFormat, call.Action, call.SdkParam) return s.Client.UniversalClient.DoCall(getUniversalInfo(call.Action), call.SdkParam) diff --git a/volcengine/transit_router/transit_router_direct_connect_gateway_attachment/service_volcengine_transit_router_direct_connect_gateway_attachment.go b/volcengine/transit_router/transit_router_direct_connect_gateway_attachment/service_volcengine_transit_router_direct_connect_gateway_attachment.go index 36e87bda..7491b702 100644 --- a/volcengine/transit_router/transit_router_direct_connect_gateway_attachment/service_volcengine_transit_router_direct_connect_gateway_attachment.go +++ b/volcengine/transit_router/transit_router_direct_connect_gateway_attachment/service_volcengine_transit_router_direct_connect_gateway_attachment.go @@ -4,15 +4,16 @@ import ( "encoding/json" "errors" "fmt" - "github.com/volcengine/terraform-provider-volcengine/volcengine/transit_router/transit_router" "strconv" "strings" "time" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ve "github.com/volcengine/terraform-provider-volcengine/common" "github.com/volcengine/terraform-provider-volcengine/logger" + "github.com/volcengine/terraform-provider-volcengine/volcengine/transit_router/transit_router" ) type VolcengineTransitRouterDirectConnectGatewayAttachmentService struct { @@ -140,6 +141,10 @@ func (s *VolcengineTransitRouterDirectConnectGatewayAttachmentService) CreateRes ConvertType: ve.ConvertListN, }, }, + BeforeCall: func(d *schema.ResourceData, client *ve.SdkClient, call ve.SdkCall) (bool, error) { + (*call.SdkParam)["ClientToken"] = uuid.New().String() + return true, nil + }, ExecuteCall: func(d *schema.ResourceData, client *ve.SdkClient, call ve.SdkCall) (*map[string]interface{}, error) { logger.Debug(logger.RespFormat, call.Action, call.SdkParam) resp, err := s.Client.UniversalClient.DoCall(getUniversalInfo(call.Action), call.SdkParam) diff --git a/volcengine/transit_router/transit_router_vpc_attachment/data_source_volcengine_transit_router_vpc_attachments.go b/volcengine/transit_router/transit_router_vpc_attachment/data_source_volcengine_transit_router_vpc_attachments.go index f09aef5e..3b57ff64 100644 --- a/volcengine/transit_router/transit_router_vpc_attachment/data_source_volcengine_transit_router_vpc_attachments.go +++ b/volcengine/transit_router/transit_router_vpc_attachment/data_source_volcengine_transit_router_vpc_attachments.go @@ -85,6 +85,11 @@ func DataSourceVolcengineTransitRouterVpcAttachments() *schema.Resource { Computed: true, Description: "The description info.", }, + "auto_publish_route_enabled": { + Type: schema.TypeBool, + Computed: true, + Description: "Whether to auto publish route of the transit router to vpc instance.", + }, "tags": ve.TagsSchemaComputed(), "attach_points": { Description: "The collection of attach points.", diff --git a/volcengine/transit_router/transit_router_vpc_attachment/resource_volcengine_transit_router_vpc_attachment.go b/volcengine/transit_router/transit_router_vpc_attachment/resource_volcengine_transit_router_vpc_attachment.go index ed722022..cc4626d5 100644 --- a/volcengine/transit_router/transit_router_vpc_attachment/resource_volcengine_transit_router_vpc_attachment.go +++ b/volcengine/transit_router/transit_router_vpc_attachment/resource_volcengine_transit_router_vpc_attachment.go @@ -75,6 +75,12 @@ func ResourceVolcengineTransitRouterVpcAttachment() *schema.Resource { Computed: true, Description: "The name of the transit router vpc attachment.", }, + "auto_publish_route_enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + Description: "Whether to auto publish route of the transit router to vpc instance. Default is false.", + }, "tags": ve.TagsSchema(), "attach_points": { Type: schema.TypeSet, diff --git a/volcengine/transit_router/transit_router_vpc_attachment/service_volcengine_transit_router_vpc_attachment.go b/volcengine/transit_router/transit_router_vpc_attachment/service_volcengine_transit_router_vpc_attachment.go index 9ae7a2cf..46065b9c 100644 --- a/volcengine/transit_router/transit_router_vpc_attachment/service_volcengine_transit_router_vpc_attachment.go +++ b/volcengine/transit_router/transit_router_vpc_attachment/service_volcengine_transit_router_vpc_attachment.go @@ -7,6 +7,7 @@ import ( "strings" "time" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ve "github.com/volcengine/terraform-provider-volcengine/common" @@ -159,6 +160,10 @@ func (s *Service) CreateResource(resourceData *schema.ResourceData, resource *sc ConvertType: ve.ConvertListN, }, }, + BeforeCall: func(d *schema.ResourceData, client *ve.SdkClient, call ve.SdkCall) (bool, error) { + (*call.SdkParam)["ClientToken"] = uuid.New().String() + return true, nil + }, ExecuteCall: func(d *schema.ResourceData, client *ve.SdkClient, call ve.SdkCall) (*map[string]interface{}, error) { logger.Debug(logger.RespFormat, call.Action, call.SdkParam) return s.Client.UniversalClient.DoCall(getUniversalInfo(call.Action), call.SdkParam) @@ -195,6 +200,9 @@ func (s *Service) ModifyResource(resourceData *schema.ResourceData, resource *sc "transit_router_attachment_name": { TargetField: "TransitRouterAttachmentName", }, + "auto_publish_route_enabled": { + TargetField: "AutoPublishRouteEnabled", + }, }, BeforeCall: func(d *schema.ResourceData, client *ve.SdkClient, call ve.SdkCall) (bool, error) { (*call.SdkParam)["TransitRouterAttachmentId"] = d.Get("transit_router_attachment_id") diff --git a/volcengine/transit_router/transit_router_vpn_attachment/service_volcengine_transit_router_vpn_attachment.go b/volcengine/transit_router/transit_router_vpn_attachment/service_volcengine_transit_router_vpn_attachment.go index 9f05f7d7..5922583f 100644 --- a/volcengine/transit_router/transit_router_vpn_attachment/service_volcengine_transit_router_vpn_attachment.go +++ b/volcengine/transit_router/transit_router_vpn_attachment/service_volcengine_transit_router_vpn_attachment.go @@ -7,6 +7,7 @@ import ( "strings" "time" + "github.com/google/uuid" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ve "github.com/volcengine/terraform-provider-volcengine/common" @@ -157,6 +158,10 @@ func (s *VolcengineTRVpnAttachmentService) CreateResource(resourceData *schema.R ConvertType: ve.ConvertListN, }, }, + BeforeCall: func(d *schema.ResourceData, client *ve.SdkClient, call ve.SdkCall) (bool, error) { + (*call.SdkParam)["ClientToken"] = uuid.New().String() + return true, nil + }, ExecuteCall: func(d *schema.ResourceData, client *ve.SdkClient, call ve.SdkCall) (*map[string]interface{}, error) { logger.Debug(logger.RespFormat, call.Action, call.SdkParam) return s.Client.UniversalClient.DoCall(getUniversalInfo(call.Action), call.SdkParam) diff --git a/volcengine/vke/node/resource_volcengine_vke_node_test.go b/volcengine/vke/node/resource_volcengine_vke_node_test.go index 1f52a1e0..9a88e242 100644 --- a/volcengine/vke/node/resource_volcengine_vke_node_test.go +++ b/volcengine/vke/node/resource_volcengine_vke_node_test.go @@ -339,7 +339,7 @@ resource "volcengine_vke_node" "foo" { } cordon = true } - depends_on = ["volcengine_vke_default_node_pool.foo"] + depends_on = [volcengine_vke_default_node_pool.foo] } ` diff --git a/website/docs/d/snat_entries.html.markdown b/website/docs/d/snat_entries.html.markdown index 288addb1..6da64c97 100644 --- a/website/docs/d/snat_entries.html.markdown +++ b/website/docs/d/snat_entries.html.markdown @@ -58,7 +58,7 @@ resource "volcengine_snat_entry" "foo1" { nat_gateway_id = volcengine_nat_gateway.foo.id eip_id = volcengine_eip_address.foo.id source_cidr = "172.16.0.0/24" - depends_on = ["volcengine_eip_associate.foo"] + depends_on = [volcengine_eip_associate.foo] } resource "volcengine_snat_entry" "foo2" { @@ -66,7 +66,7 @@ resource "volcengine_snat_entry" "foo2" { nat_gateway_id = volcengine_nat_gateway.foo.id eip_id = volcengine_eip_address.foo.id source_cidr = "172.16.0.0/16" - depends_on = ["volcengine_eip_associate.foo"] + depends_on = [volcengine_eip_associate.foo] } data "volcengine_snat_entries" "foo" { diff --git a/website/docs/d/transit_router_vpc_attachments.html.markdown b/website/docs/d/transit_router_vpc_attachments.html.markdown index a19a00f3..f4e31470 100644 --- a/website/docs/d/transit_router_vpc_attachments.html.markdown +++ b/website/docs/d/transit_router_vpc_attachments.html.markdown @@ -35,6 +35,7 @@ In addition to all arguments above, the following attributes are exported: * `network_interface_id` - The ID of network interface. * `subnet_id` - The ID of subnet. * `zone_id` - The ID of zone. + * `auto_publish_route_enabled` - Whether to auto publish route of the transit router to vpc instance. * `creation_time` - The create time. * `description` - The description info. * `status` - The status of the transit router. diff --git a/website/docs/d/transit_routers.html.markdown b/website/docs/d/transit_routers.html.markdown index 9e8833e8..8ec5b5c5 100644 --- a/website/docs/d/transit_routers.html.markdown +++ b/website/docs/d/transit_routers.html.markdown @@ -38,6 +38,7 @@ In addition to all arguments above, the following attributes are exported: * `total_count` - The total count of query. * `transit_routers` - The collection of query. * `account_id` - The ID of account. + * `asn` - The asn of the transit router. * `business_status` - The business status of the transit router. * `creation_time` - The create time. * `description` - The description info. diff --git a/website/docs/r/ecs_instance_state.html.markdown b/website/docs/r/ecs_instance_state.html.markdown index 7b90d60c..70247d89 100644 --- a/website/docs/r/ecs_instance_state.html.markdown +++ b/website/docs/r/ecs_instance_state.html.markdown @@ -56,7 +56,8 @@ resource "volcengine_ecs_instance_state" "foo" { ``` ## Argument Reference The following arguments are supported: -* `action` - (Required) Start or Stop of Instance Action, the value can be `Start`, `Stop` or `ForceStop`. +* `action` - (Required) Start or Stop of Instance Action, the value can be `Start`, `Stop` or `ForceStop`. +If the target status of the action is consistent with the current status of the instance, the action will not actually be executed. * `instance_id` - (Required, ForceNew) Id of Instance. * `stopped_mode` - (Optional) Stop Mode of Instance, the value can be `KeepCharging` or `StopCharging`. diff --git a/website/docs/r/snat_entry.html.markdown b/website/docs/r/snat_entry.html.markdown index d362eadb..a5332163 100644 --- a/website/docs/r/snat_entry.html.markdown +++ b/website/docs/r/snat_entry.html.markdown @@ -58,7 +58,7 @@ resource "volcengine_snat_entry" "foo" { nat_gateway_id = volcengine_nat_gateway.foo.id eip_id = volcengine_eip_address.foo.id source_cidr = "172.16.0.0/24" - depends_on = ["volcengine_eip_associate.foo"] + depends_on = [volcengine_eip_associate.foo] } ``` ## Argument Reference diff --git a/website/docs/r/transit_router.html.markdown b/website/docs/r/transit_router.html.markdown index 8c431764..a6b487eb 100644 --- a/website/docs/r/transit_router.html.markdown +++ b/website/docs/r/transit_router.html.markdown @@ -13,6 +13,7 @@ Provides a resource to manage transit router resource "volcengine_transit_router" "foo" { transit_router_name = "acc-test-tr" description = "acc-test" + asn = 4294967294 project_name = "default" tags { key = "k1" @@ -22,6 +23,7 @@ resource "volcengine_transit_router" "foo" { ``` ## Argument Reference The following arguments are supported: +* `asn` - (Optional, ForceNew) The asn of the transit router. Valid value range in 64512-65534 and 4200000000-4294967294. Default is 64512. * `description` - (Optional) The description of the transit router. * `project_name` - (Optional) The ProjectName of the transit router. * `tags` - (Optional) Tags. diff --git a/website/docs/r/transit_router_vpc_attachment.html.markdown b/website/docs/r/transit_router_vpc_attachment.html.markdown index cc5d1152..682dd42a 100644 --- a/website/docs/r/transit_router_vpc_attachment.html.markdown +++ b/website/docs/r/transit_router_vpc_attachment.html.markdown @@ -13,6 +13,7 @@ Provides a resource to manage transit router vpc attachment resource "volcengine_transit_router" "foo" { transit_router_name = "test-tf-acc" description = "test-tf-acc" + asn = 4294967293 } data "volcengine_zones" "foo" { @@ -37,7 +38,6 @@ resource "volcengine_subnet" "foo2" { 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 @@ -49,8 +49,9 @@ resource "volcengine_transit_router_vpc_attachment" "foo" { subnet_id = volcengine_subnet.foo2.id zone_id = "cn-beijing-b" } - transit_router_attachment_name = "tf-test-acc-name1" + transit_router_attachment_name = "tf-test-acc-vpc-attach" description = "tf-test-acc-description" + auto_publish_route_enabled = true tags { key = "k1" value = "v1" @@ -62,6 +63,7 @@ The following arguments are supported: * `attach_points` - (Required) The attach points of transit router vpc attachment. * `transit_router_id` - (Required, ForceNew) The id of the transit router. * `vpc_id` - (Required, ForceNew) The ID of vpc. +* `auto_publish_route_enabled` - (Optional) Whether to auto publish route of the transit router to vpc instance. Default is false. * `description` - (Optional) The description of the transit router vpc attachment. * `tags` - (Optional) Tags. * `transit_router_attachment_name` - (Optional) The name of the transit router vpc attachment.