From 894bd40695b4e30e2df989718c850a786d425c17 Mon Sep 17 00:00:00 2001 From: "guimin.hgm" Date: Thu, 17 Oct 2024 14:47:14 +0800 Subject: [PATCH] PrivateLink: Improves the invoking private link api method and supports refreshing credential automatically --- ...ud_privatelink_vpc_endpoint_connections.go | 11 +- ...vatelink_vpc_endpoint_service_resources.go | 10 +- ..._privatelink_vpc_endpoint_service_users.go | 7 +- ...cloud_privatelink_vpc_endpoint_services.go | 10 +- ...alicloud_privatelink_vpc_endpoint_zones.go | 10 +- ...urce_alicloud_privatelink_vpc_endpoints.go | 10 +- ...ource_alicloud_privatelink_vpc_endpoint.go | 53 ++------- ...oud_privatelink_vpc_endpoint_connection.go | 28 ++--- ...icloud_privatelink_vpc_endpoint_service.go | 36 ++----- ...ivatelink_vpc_endpoint_service_resource.go | 19 +--- ...d_privatelink_vpc_endpoint_service_test.go | 29 +++-- ...d_privatelink_vpc_endpoint_service_user.go | 19 +--- ..._alicloud_privatelink_vpc_endpoint_test.go | 8 +- ..._alicloud_privatelink_vpc_endpoint_zone.go | 19 +--- alicloud/service_alicloud_private_link_v2.go | 102 +++--------------- alicloud/service_alicloud_privatelink.go | 73 ++----------- .../docs/d/privatelink_service.html.markdown | 4 +- ...ink_vpc_endpoint_connections.html.markdown | 14 +-- ...c_endpoint_service_resources.html.markdown | 12 +-- ...k_vpc_endpoint_service_users.html.markdown | 10 +- ...telink_vpc_endpoint_services.html.markdown | 24 ++--- ...ivatelink_vpc_endpoint_zones.html.markdown | 20 ++-- .../d/privatelink_vpc_endpoints.html.markdown | 32 +++--- 23 files changed, 141 insertions(+), 419 deletions(-) diff --git a/alicloud/data_source_alicloud_privatelink_vpc_endpoint_connections.go b/alicloud/data_source_alicloud_privatelink_vpc_endpoint_connections.go index e69150e7bbc..cf9a9d16e07 100644 --- a/alicloud/data_source_alicloud_privatelink_vpc_endpoint_connections.go +++ b/alicloud/data_source_alicloud_privatelink_vpc_endpoint_connections.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/PaesslerAG/jsonpath" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -91,14 +90,10 @@ func dataSourceAlicloudPrivatelinkVpcEndpointConnectionsRead(d *schema.ResourceD request["MaxResults"] = PageSizeLarge var objects []map[string]interface{} var response map[string]interface{} - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error for { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + + response, err = client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_privatelink_vpc_endpoint_connections", action, AlibabaCloudSdkGoERROR) } diff --git a/alicloud/data_source_alicloud_privatelink_vpc_endpoint_service_resources.go b/alicloud/data_source_alicloud_privatelink_vpc_endpoint_service_resources.go index 45353418623..755ac28bafc 100644 --- a/alicloud/data_source_alicloud_privatelink_vpc_endpoint_service_resources.go +++ b/alicloud/data_source_alicloud_privatelink_vpc_endpoint_service_resources.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/PaesslerAG/jsonpath" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -61,14 +60,9 @@ func dataSourceAlicloudPrivatelinkVpcEndpointServiceResourcesRead(d *schema.Reso request["MaxResults"] = PageSizeLarge var objects []map[string]interface{} var response map[string]interface{} - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error for { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_privatelink_vpc_endpoint_service_resources", action, AlibabaCloudSdkGoERROR) } diff --git a/alicloud/data_source_alicloud_privatelink_vpc_endpoint_service_users.go b/alicloud/data_source_alicloud_privatelink_vpc_endpoint_service_users.go index dbdd43d3b8a..b881f3bda15 100644 --- a/alicloud/data_source_alicloud_privatelink_vpc_endpoint_service_users.go +++ b/alicloud/data_source_alicloud_privatelink_vpc_endpoint_service_users.go @@ -65,14 +65,11 @@ func dataSourceAlicloudPrivatelinkVpcEndpointServiceUsersRead(d *schema.Resource request["MaxResults"] = PageSizeLarge var objects []map[string]interface{} var response map[string]interface{} - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error for { runtime := util.RuntimeOptions{} runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_privatelink_vpc_endpoint_service_users", action, AlibabaCloudSdkGoERROR) } diff --git a/alicloud/data_source_alicloud_privatelink_vpc_endpoint_services.go b/alicloud/data_source_alicloud_privatelink_vpc_endpoint_services.go index 7869da4b9b4..beef750207b 100644 --- a/alicloud/data_source_alicloud_privatelink_vpc_endpoint_services.go +++ b/alicloud/data_source_alicloud_privatelink_vpc_endpoint_services.go @@ -5,7 +5,6 @@ import ( "regexp" "github.com/PaesslerAG/jsonpath" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -148,14 +147,9 @@ func dataSourceAlicloudPrivatelinkVpcEndpointServicesRead(d *schema.ResourceData } } var response map[string]interface{} - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error for { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_privatelink_vpc_endpoint_services", action, AlibabaCloudSdkGoERROR) } diff --git a/alicloud/data_source_alicloud_privatelink_vpc_endpoint_zones.go b/alicloud/data_source_alicloud_privatelink_vpc_endpoint_zones.go index bf0128cee84..e6064a9ad47 100644 --- a/alicloud/data_source_alicloud_privatelink_vpc_endpoint_zones.go +++ b/alicloud/data_source_alicloud_privatelink_vpc_endpoint_zones.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/PaesslerAG/jsonpath" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -85,14 +84,9 @@ func dataSourceAlicloudPrivatelinkVpcEndpointZonesRead(d *schema.ResourceData, m var objects []map[string]interface{} status, statusOk := d.GetOk("status") var response map[string]interface{} - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error for { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_privatelink_vpc_endpoint_zones", action, AlibabaCloudSdkGoERROR) } diff --git a/alicloud/data_source_alicloud_privatelink_vpc_endpoints.go b/alicloud/data_source_alicloud_privatelink_vpc_endpoints.go index 708bbdb6e68..977f81e2c5d 100644 --- a/alicloud/data_source_alicloud_privatelink_vpc_endpoints.go +++ b/alicloud/data_source_alicloud_privatelink_vpc_endpoints.go @@ -5,7 +5,6 @@ import ( "regexp" "github.com/PaesslerAG/jsonpath" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -176,14 +175,9 @@ func dataSourceAlicloudPrivatelinkVpcEndpointsRead(d *schema.ResourceData, meta } } var response map[string]interface{} - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error for { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_privatelink_vpc_endpoints", action, AlibabaCloudSdkGoERROR) } diff --git a/alicloud/resource_alicloud_privatelink_vpc_endpoint.go b/alicloud/resource_alicloud_privatelink_vpc_endpoint.go index db4e5167822..281b79d4df6 100644 --- a/alicloud/resource_alicloud_privatelink_vpc_endpoint.go +++ b/alicloud/resource_alicloud_privatelink_vpc_endpoint.go @@ -6,7 +6,6 @@ import ( "log" "time" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -125,10 +124,7 @@ func resourceAliCloudPrivateLinkVpcEndpointCreate(d *schema.ResourceData, meta i var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) request["RegionId"] = client.RegionId request["ClientToken"] = buildClientToken(action) @@ -174,11 +170,9 @@ func resourceAliCloudPrivateLinkVpcEndpointCreate(d *schema.ResourceData, meta i if v, ok := d.GetOk("policy_document"); ok { request["PolicyDocument"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { wait() @@ -261,10 +255,7 @@ func resourceAliCloudPrivateLinkVpcEndpointUpdate(d *schema.ResourceData, meta i update := false d.Partial(true) action := "UpdateVpcEndpointAttribute" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query = make(map[string]interface{}) query["EndpointId"] = d.Id() @@ -289,11 +280,9 @@ func resourceAliCloudPrivateLinkVpcEndpointUpdate(d *schema.ResourceData, meta i } if update { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if IsExpectedErrors(err, []string{"EndpointLocked", "EndpointConnectionOperationDenied", "EndpointOperationDenied"}) || NeedRetry(err) { wait() @@ -310,10 +299,6 @@ func resourceAliCloudPrivateLinkVpcEndpointUpdate(d *schema.ResourceData, meta i } update = false action = "ChangeResourceGroup" - conn, err = client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["ResourceId"] = d.Id() @@ -325,11 +310,9 @@ func resourceAliCloudPrivateLinkVpcEndpointUpdate(d *schema.ResourceData, meta i request["ResourceType"] = "VpcEndpoint" if update { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, false) if err != nil { if NeedRetry(err) { wait() @@ -368,10 +351,6 @@ func resourceAliCloudPrivateLinkVpcEndpointUpdate(d *schema.ResourceData, meta i for _, item := range securityGroupIds { action := "AttachSecurityGroupToVpcEndpoint" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["EndpointId"] = d.Id() @@ -379,12 +358,9 @@ func resourceAliCloudPrivateLinkVpcEndpointUpdate(d *schema.ResourceData, meta i request["ClientToken"] = buildClientToken(action) request["DryRun"] = d.Get("dry_run") request["SecurityGroupId"] = item - - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { wait() @@ -412,10 +388,6 @@ func resourceAliCloudPrivateLinkVpcEndpointUpdate(d *schema.ResourceData, meta i for _, item := range securityGroupIds { action := "DetachSecurityGroupFromVpcEndpoint" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["EndpointId"] = d.Id() @@ -423,11 +395,9 @@ func resourceAliCloudPrivateLinkVpcEndpointUpdate(d *schema.ResourceData, meta i request["ClientToken"] = buildClientToken(action) request["DryRun"] = d.Get("dry_run") request["SecurityGroupId"] = item - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { wait() @@ -462,10 +432,7 @@ func resourceAliCloudPrivateLinkVpcEndpointDelete(d *schema.ResourceData, meta i var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query["EndpointId"] = d.Id() request["RegionId"] = client.RegionId @@ -475,11 +442,9 @@ func resourceAliCloudPrivateLinkVpcEndpointDelete(d *schema.ResourceData, meta i if v, ok := d.GetOkExists("dry_run"); ok { request["DryRun"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { diff --git a/alicloud/resource_alicloud_privatelink_vpc_endpoint_connection.go b/alicloud/resource_alicloud_privatelink_vpc_endpoint_connection.go index 460368baba4..227bbeb5557 100644 --- a/alicloud/resource_alicloud_privatelink_vpc_endpoint_connection.go +++ b/alicloud/resource_alicloud_privatelink_vpc_endpoint_connection.go @@ -7,7 +7,6 @@ import ( "strings" "time" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -64,10 +63,7 @@ func resourceAliCloudPrivateLinkVpcEndpointConnectionCreate(d *schema.ResourceDa var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query["ServiceId"] = d.Get("service_id") query["EndpointId"] = d.Get("endpoint_id") @@ -80,11 +76,9 @@ func resourceAliCloudPrivateLinkVpcEndpointConnectionCreate(d *schema.ResourceDa if v, ok := d.GetOk("bandwidth"); ok { request["Bandwidth"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { @@ -143,10 +137,7 @@ func resourceAliCloudPrivateLinkVpcEndpointConnectionUpdate(d *schema.ResourceDa update := false parts := strings.Split(d.Id(), ":") action := "UpdateVpcEndpointConnectionAttribute" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query = make(map[string]interface{}) query["ServiceId"] = parts[0] @@ -162,11 +153,9 @@ func resourceAliCloudPrivateLinkVpcEndpointConnectionUpdate(d *schema.ResourceDa } if update { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { @@ -200,10 +189,7 @@ func resourceAliCloudPrivateLinkVpcEndpointConnectionDelete(d *schema.ResourceDa var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query["ServiceId"] = parts[0] query["EndpointId"] = parts[1] @@ -214,11 +200,9 @@ func resourceAliCloudPrivateLinkVpcEndpointConnectionDelete(d *schema.ResourceDa if v, ok := d.GetOkExists("dry_run"); ok { request["DryRun"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { diff --git a/alicloud/resource_alicloud_privatelink_vpc_endpoint_service.go b/alicloud/resource_alicloud_privatelink_vpc_endpoint_service.go index 8a37dd00198..bddd86df441 100644 --- a/alicloud/resource_alicloud_privatelink_vpc_endpoint_service.go +++ b/alicloud/resource_alicloud_privatelink_vpc_endpoint_service.go @@ -6,7 +6,6 @@ import ( "log" "time" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -107,10 +106,7 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceCreate(d *schema.ResourceData, var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) request["RegionId"] = client.RegionId request["ClientToken"] = buildClientToken(action) @@ -139,11 +135,9 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceCreate(d *schema.ResourceData, if v, ok := d.GetOkExists("service_support_ipv6"); ok { request["ServiceSupportIPv6"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { @@ -219,10 +213,7 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceUpdate(d *schema.ResourceData, update := false d.Partial(true) action := "UpdateVpcEndpointServiceAttribute" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query = make(map[string]interface{}) query["ServiceId"] = d.Id() @@ -257,11 +248,9 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceUpdate(d *schema.ResourceData, } if update { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { @@ -285,10 +274,6 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceUpdate(d *schema.ResourceData, } update = false action = "ChangeResourceGroup" - conn, err = client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["ResourceId"] = d.Id() @@ -300,11 +285,9 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceUpdate(d *schema.ResourceData, query["ResourceType"] = "VpcEndpointService" query["ResourceRegionId"] = client.RegionId if update { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, false) if err != nil { if NeedRetry(err) { @@ -345,10 +328,7 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceDelete(d *schema.ResourceData, var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query["ServiceId"] = d.Id() request["RegionId"] = client.RegionId @@ -358,11 +338,9 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceDelete(d *schema.ResourceData, if v, ok := d.GetOkExists("dry_run"); ok { request["DryRun"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { diff --git a/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_resource.go b/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_resource.go index 6a379f9f983..9afcc46c1bb 100644 --- a/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_resource.go +++ b/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_resource.go @@ -7,7 +7,6 @@ import ( "strings" "time" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -66,10 +65,7 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceResourceCreate(d *schema.Resou var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query["ResourceId"] = d.Get("resource_id") query["ServiceId"] = d.Get("service_id") @@ -81,11 +77,9 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceResourceCreate(d *schema.Resou if v, ok := d.GetOkExists("dry_run"); ok { request["DryRun"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { @@ -161,10 +155,7 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceResourceDelete(d *schema.Resou var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query["ResourceId"] = parts[1] query["ServiceId"] = parts[0] @@ -179,11 +170,9 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceResourceDelete(d *schema.Resou if v, ok := d.GetOkExists("dry_run"); ok { request["DryRun"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { diff --git a/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_test.go b/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_test.go index fe56e947f39..4fad7bfb127 100644 --- a/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_test.go +++ b/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_test.go @@ -52,14 +52,10 @@ func testSweepPrivatelinkVpcEndpointService(region string) error { } var response map[string]interface{} action := "ListVpcEndpointServices" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } for { runtime := util.RuntimeOptions{} runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_privatelink_vpc_endpoint_service", action, AlibabaCloudSdkGoERROR) } @@ -86,7 +82,7 @@ func testSweepPrivatelinkVpcEndpointService(region string) error { request := map[string]interface{}{ "ServiceId": item["ServiceId"], } - _, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &util.RuntimeOptions{}) + _, err = client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { log.Printf("[ERROR] Failed to delete Privatelink VpcEndpoint Service (%s): %s", item["ServiceId"].(string), err) } @@ -569,16 +565,17 @@ func TestAccAliCloudPrivateLinkVpcEndpointService_basic4837(t *testing.T) { }), ), }, - { - Config: testAccConfig(map[string]interface{}{ - "service_support_ipv6": "true", - }), - Check: resource.ComposeTestCheckFunc( - testAccCheck(map[string]string{ - "service_support_ipv6": "true", - }), - ), - }, + // The field 'service_support_ipv6' has been deprecated in API docs, and will not work when setting it to true anymore. + //{ + // Config: testAccConfig(map[string]interface{}{ + // "service_support_ipv6": "true", + // }), + // Check: resource.ComposeTestCheckFunc( + // testAccCheck(map[string]string{ + // "service_support_ipv6": "true", + // }), + // ), + //}, { Config: testAccConfig(map[string]interface{}{ "zone_affinity_enabled": "false", diff --git a/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_user.go b/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_user.go index f29055ce493..c5979c01509 100644 --- a/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_user.go +++ b/alicloud/resource_alicloud_privatelink_vpc_endpoint_service_user.go @@ -7,7 +7,6 @@ import ( "strings" "time" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -54,10 +53,7 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceUserCreate(d *schema.ResourceD var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query["UserId"] = d.Get("user_id") query["ServiceId"] = d.Get("service_id") @@ -67,11 +63,9 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceUserCreate(d *schema.ResourceD if v, ok := d.GetOkExists("dry_run"); ok { request["DryRun"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { @@ -130,10 +124,7 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceUserDelete(d *schema.ResourceD var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query["UserId"] = parts[1] query["ServiceId"] = parts[0] @@ -144,11 +135,9 @@ func resourceAliCloudPrivateLinkVpcEndpointServiceUserDelete(d *schema.ResourceD if v, ok := d.GetOkExists("dry_run"); ok { request["DryRun"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { diff --git a/alicloud/resource_alicloud_privatelink_vpc_endpoint_test.go b/alicloud/resource_alicloud_privatelink_vpc_endpoint_test.go index 510a06cc9d9..e888bea3f82 100644 --- a/alicloud/resource_alicloud_privatelink_vpc_endpoint_test.go +++ b/alicloud/resource_alicloud_privatelink_vpc_endpoint_test.go @@ -52,14 +52,10 @@ func testSweepPrivatelinkVpcEndpoint(region string) error { } var response map[string]interface{} action := "ListVpcEndpoints" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } for { runtime := util.RuntimeOptions{} runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { return WrapErrorf(err, DataDefaultErrorMsg, "alicloud_privatelink_vpc_endpoint", action, AlibabaCloudSdkGoERROR) } @@ -89,7 +85,7 @@ func testSweepPrivatelinkVpcEndpoint(region string) error { request := map[string]interface{}{ "EndpointId": item["EndpointId"], } - _, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &util.RuntimeOptions{}) + _, err = client.RpcPost("Privatelink", "2020-04-15", action, nil, request, false) if err != nil { log.Printf("[ERROR] Failed to delete Privatelink VpcEndpoint (%s): %s", item["EndpointName"].(string), err) } diff --git a/alicloud/resource_alicloud_privatelink_vpc_endpoint_zone.go b/alicloud/resource_alicloud_privatelink_vpc_endpoint_zone.go index 7b7a8343e24..3bcf84dc2ce 100644 --- a/alicloud/resource_alicloud_privatelink_vpc_endpoint_zone.go +++ b/alicloud/resource_alicloud_privatelink_vpc_endpoint_zone.go @@ -7,7 +7,6 @@ import ( "strings" "time" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -69,10 +68,7 @@ func resourceAliCloudPrivateLinkVpcEndpointZoneCreate(d *schema.ResourceData, me var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query["EndpointId"] = d.Get("endpoint_id") query["ZoneId"] = d.Get("zone_id") @@ -94,11 +90,9 @@ func resourceAliCloudPrivateLinkVpcEndpointZoneCreate(d *schema.ResourceData, me } query["ZoneId"] = vsw["ZoneId"] } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { @@ -166,10 +160,7 @@ func resourceAliCloudPrivateLinkVpcEndpointZoneDelete(d *schema.ResourceData, me var request map[string]interface{} var response map[string]interface{} query := make(map[string]interface{}) - conn, err := client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } + var err error request = make(map[string]interface{}) query["EndpointId"] = parts[0] query["ZoneId"] = parts[1] @@ -180,11 +171,9 @@ func resourceAliCloudPrivateLinkVpcEndpointZoneDelete(d *schema.ResourceData, me if v, ok := d.GetOkExists("dry_run"); ok { request["DryRun"] = v } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { diff --git a/alicloud/service_alicloud_private_link_v2.go b/alicloud/service_alicloud_private_link_v2.go index 75fb7d58fd9..3a0ca6f1d69 100644 --- a/alicloud/service_alicloud_private_link_v2.go +++ b/alicloud/service_alicloud_private_link_v2.go @@ -6,8 +6,6 @@ import ( "time" "github.com/PaesslerAG/jsonpath" - rpc "github.com/alibabacloud-go/tea-rpc/client" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -25,20 +23,13 @@ func (s *PrivateLinkServiceV2) DescribePrivateLinkVpcEndpointService(id string) var response map[string]interface{} var query map[string]interface{} action := "GetVpcEndpointServiceAttribute" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return object, WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["ServiceId"] = id request["RegionId"] = client.RegionId - - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(1*time.Minute, func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { @@ -66,22 +57,15 @@ func (s *PrivateLinkServiceV2) DescribeListTagResources(id string) (object map[s var response map[string]interface{} var query map[string]interface{} action := "ListTagResources" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return object, WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) request["ResourceId.1"] = id request["RegionId"] = client.RegionId request["ClientToken"] = buildClientToken(action) - request["ResourceType"] = "vpcendpointservice" - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(1*time.Minute, func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { @@ -130,7 +114,6 @@ func (s *PrivateLinkServiceV2) SetResourceTags(d *schema.ResourceData, resourceT if d.HasChange("tags") { var err error var action string - var conn *rpc.Client client := s.client var request map[string]interface{} var response map[string]interface{} @@ -145,10 +128,6 @@ func (s *PrivateLinkServiceV2) SetResourceTags(d *schema.ResourceData, resourceT } if len(removedTagKeys) > 0 { action = "UntagResources" - conn, err = client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) request["ResourceId.1"] = d.Id() @@ -162,11 +141,9 @@ func (s *PrivateLinkServiceV2) SetResourceTags(d *schema.ResourceData, resourceT request["DryRun"] = v } request["ResourceType"] = resourceType - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { wait() @@ -185,10 +162,6 @@ func (s *PrivateLinkServiceV2) SetResourceTags(d *schema.ResourceData, resourceT if len(added) > 0 { action = "TagResources" - conn, err = client.NewPrivatelinkClient() - if err != nil { - return WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) request["ResourceId.1"] = d.Id() @@ -205,11 +178,9 @@ func (s *PrivateLinkServiceV2) SetResourceTags(d *schema.ResourceData, resourceT } request["ResourceType"] = resourceType - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(d.Timeout(schema.TimeoutUpdate), func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { wait() @@ -243,21 +214,15 @@ func (s *PrivateLinkServiceV2) DescribePrivateLinkVpcEndpointServiceUser(id stri err = WrapError(fmt.Errorf("invalid Resource Id %s. Expected parts' length %d, got %d", id, 2, len(parts))) } action := "ListVpcEndpointServiceUsers" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return object, WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["ServiceId"] = parts[0] query["UserId"] = parts[1] request["RegionId"] = client.RegionId - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(1*time.Minute, func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { @@ -325,20 +290,14 @@ func (s *PrivateLinkServiceV2) DescribePrivateLinkVpcEndpointServiceResource(id var query map[string]interface{} parts, _ := ParseResourceIds(id) action := "ListVpcEndpointServiceResources" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return object, WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["ServiceId"] = parts[0] request["RegionId"] = client.RegionId - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(1*time.Minute, func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { @@ -415,20 +374,14 @@ func (s *PrivateLinkServiceV2) DescribePrivateLinkVpcEndpointZone(id string) (ob err = WrapError(fmt.Errorf("invalid Resource Id %s. Expected parts' length %d, got %d", id, 2, len(parts))) } action := "ListVpcEndpointZones" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return object, WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["EndpointId"] = parts[0] request["RegionId"] = client.RegionId - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(1*time.Minute, func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { @@ -503,21 +456,15 @@ func (s *PrivateLinkServiceV2) DescribePrivateLinkVpcEndpointConnection(id strin err = WrapError(fmt.Errorf("invalid Resource Id %s. Expected parts' length %d, got %d", id, 2, len(parts))) } action := "ListVpcEndpointConnections" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return object, WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["EndpointId"] = parts[1] query["ServiceId"] = parts[0] request["RegionId"] = client.RegionId - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(1*time.Minute, func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { @@ -582,20 +529,14 @@ func (s *PrivateLinkServiceV2) DescribePrivateLinkVpcEndpoint(id string) (object var response map[string]interface{} var query map[string]interface{} action := "GetVpcEndpointAttribute" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return object, WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["EndpointId"] = id query["RegionId"] = client.RegionId - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(1*time.Minute, func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { @@ -623,20 +564,14 @@ func (s *PrivateLinkServiceV2) DescribeListVpcEndpointConnections(id string) (ob var response map[string]interface{} var query map[string]interface{} action := "ListVpcEndpointConnections" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return object, WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["EndpointId"] = id query["RegionId"] = client.RegionId - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(1*time.Minute, func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { @@ -668,22 +603,15 @@ func (s *PrivateLinkServiceV2) DescribePrivateLinkListTagResources(id string) (o var response map[string]interface{} var query map[string]interface{} action := "ListTagResources" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return object, WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) request["ResourceId.1"] = id request["RegionId"] = client.RegionId request["ClientToken"] = buildClientToken(action) - request["ResourceType"] = "VpcEndpoint" - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(1*time.Minute, func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) request["ClientToken"] = buildClientToken(action) if err != nil { @@ -709,20 +637,14 @@ func (s *PrivateLinkServiceV2) DescribeListVpcEndpointSecurityGroups(id string) var response map[string]interface{} var query map[string]interface{} action := "ListVpcEndpointSecurityGroups" - conn, err := client.NewPrivatelinkClient() - if err != nil { - return object, WrapError(err) - } request = make(map[string]interface{}) query = make(map[string]interface{}) query["EndpointId"] = id query["RegionId"] = client.RegionId - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) wait := incrementalWait(3*time.Second, 5*time.Second) err = resource.Retry(1*time.Minute, func() *resource.RetryError { - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), query, request, &runtime) + response, err = client.RpcPost("Privatelink", "2020-04-15", action, query, request, true) if err != nil { if NeedRetry(err) { diff --git a/alicloud/service_alicloud_privatelink.go b/alicloud/service_alicloud_privatelink.go index 40edd02e508..e3433a1087a 100644 --- a/alicloud/service_alicloud_privatelink.go +++ b/alicloud/service_alicloud_privatelink.go @@ -2,7 +2,6 @@ package alicloud import ( "github.com/PaesslerAG/jsonpath" - util "github.com/alibabacloud-go/tea-utils/service" "github.com/aliyun/terraform-provider-alicloud/alicloud/connectivity" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) @@ -13,18 +12,12 @@ type PrivatelinkService struct { func (s *PrivatelinkService) ListVpcEndpointServiceResources(id string) (object map[string]interface{}, err error) { var response map[string]interface{} - conn, err := s.client.NewPrivatelinkClient() - if err != nil { - return nil, WrapError(err) - } action := "ListVpcEndpointServiceResources" request := map[string]interface{}{ "RegionId": s.client.RegionId, "ServiceId": id, } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = s.client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { if IsExpectedErrors(err, []string{"EndpointServiceNotFound"}) { err = WrapErrorf(Error(GetNotFoundMessage("PrivatelinkVpcEndpointService", id)), NotFoundMsg, ProviderERROR) @@ -44,18 +37,12 @@ func (s *PrivatelinkService) ListVpcEndpointServiceResources(id string) (object func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointService(id string) (object map[string]interface{}, err error) { var response map[string]interface{} - conn, err := s.client.NewPrivatelinkClient() - if err != nil { - return nil, WrapError(err) - } action := "GetVpcEndpointServiceAttribute" request := map[string]interface{}{ "RegionId": s.client.RegionId, "ServiceId": id, } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = s.client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { if IsExpectedErrors(err, []string{"EndpointServiceNotFound"}) { err = WrapErrorf(Error(GetNotFoundMessage("PrivatelinkVpcEndpointService", id)), NotFoundMsg, ProviderERROR) @@ -95,10 +82,6 @@ func (s *PrivatelinkService) PrivatelinkVpcEndpointServiceStateRefreshFunc(id st func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointConnection(id string) (object map[string]interface{}, err error) { var response map[string]interface{} - conn, err := s.client.NewPrivatelinkClient() - if err != nil { - return nil, WrapError(err) - } action := "ListVpcEndpointConnections" parts, err := ParseResourceId(id, 2) if err != nil { @@ -110,9 +93,7 @@ func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointConnection(id string) "EndpointId": parts[1], "ServiceId": parts[0], } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = s.client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { if IsExpectedErrors(err, []string{"EndpointServiceNotFound"}) { err = WrapErrorf(Error(GetNotFoundMessage("PrivatelinkVpcEndpointConnection", id)), NotFoundMsg, ProviderERROR) @@ -155,18 +136,12 @@ func (s *PrivatelinkService) PrivatelinkVpcEndpointConnectionStateRefreshFunc(id func (s *PrivatelinkService) ListVpcEndpointSecurityGroups(id string) (object map[string]interface{}, err error) { var response map[string]interface{} - conn, err := s.client.NewPrivatelinkClient() - if err != nil { - return nil, WrapError(err) - } action := "ListVpcEndpointSecurityGroups" request := map[string]interface{}{ "RegionId": s.client.RegionId, "EndpointId": id, } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = s.client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { if IsExpectedErrors(err, []string{"EndpointNotFound"}) { err = WrapErrorf(Error(GetNotFoundMessage("PrivatelinkVpcEndpoint", id)), NotFoundMsg, ProviderERROR) @@ -186,18 +161,12 @@ func (s *PrivatelinkService) ListVpcEndpointSecurityGroups(id string) (object ma func (s *PrivatelinkService) ListVpcEndpointZones(id string) (object map[string]interface{}, err error) { var response map[string]interface{} - conn, err := s.client.NewPrivatelinkClient() - if err != nil { - return nil, WrapError(err) - } action := "ListVpcEndpointZones" request := map[string]interface{}{ "RegionId": s.client.RegionId, "EndpointId": id, } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = s.client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { if IsExpectedErrors(err, []string{"EndpointNotFound"}) { err = WrapErrorf(Error(GetNotFoundMessage("PrivatelinkVpcEndpoint", id)), NotFoundMsg, ProviderERROR) @@ -217,19 +186,13 @@ func (s *PrivatelinkService) ListVpcEndpointZones(id string) (object map[string] func (s *PrivatelinkService) DescribePrivatelinkVpcEndpoint(id string) (object map[string]interface{}, err error) { var response map[string]interface{} - conn, err := s.client.NewPrivatelinkClient() - if err != nil { - return nil, WrapError(err) - } action := "GetVpcEndpointAttribute" request := map[string]interface{}{ "RegionId": s.client.RegionId, "EndpointId": id, } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) request["ClientToken"] = buildClientToken("GetVpcEndpointAttribute") - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = s.client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { if IsExpectedErrors(err, []string{"EndpointNotFound"}) { err = WrapErrorf(Error(GetNotFoundMessage("PrivatelinkVpcEndpoint", id)), NotFoundMsg, ProviderERROR) @@ -269,10 +232,6 @@ func (s *PrivatelinkService) PrivatelinkVpcEndpointStateRefreshFunc(id string, f func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointServiceResource(id string) (object map[string]interface{}, err error) { var response map[string]interface{} - conn, err := s.client.NewPrivatelinkClient() - if err != nil { - return nil, WrapError(err) - } action := "ListVpcEndpointServiceResources" parts, err := ParseResourceId(id, 2) if err != nil { @@ -284,9 +243,7 @@ func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointServiceResource(id st "ServiceId": parts[0], } for { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = s.client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { if IsExpectedErrors(err, []string{"EndpointServiceNotFound"}) { err = WrapErrorf(Error(GetNotFoundMessage("PrivatelinkVpcEndpointServiceResource", id)), NotFoundMsg, ProviderERROR) @@ -321,10 +278,6 @@ func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointServiceResource(id st func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointServiceUser(id string) (object map[string]interface{}, err error) { var response map[string]interface{} - conn, err := s.client.NewPrivatelinkClient() - if err != nil { - return nil, WrapError(err) - } action := "ListVpcEndpointServiceUsers" parts, err := ParseResourceId(id, 2) if err != nil { @@ -336,9 +289,7 @@ func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointServiceUser(id string "ServiceId": parts[0], "UserId": parts[1], } - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = s.client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { if IsExpectedErrors(err, []string{"EndpointServiceNotFound"}) { err = WrapErrorf(Error(GetNotFoundMessage("PrivatelinkVpcEndpointServiceUser", id)), NotFoundMsg, ProviderERROR) @@ -361,10 +312,6 @@ func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointServiceUser(id string func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointZone(id string) (object map[string]interface{}, err error) { var response map[string]interface{} - conn, err := s.client.NewPrivatelinkClient() - if err != nil { - return nil, WrapError(err) - } action := "ListVpcEndpointZones" parts, err := ParseResourceId(id, 2) if err != nil { @@ -376,9 +323,7 @@ func (s *PrivatelinkService) DescribePrivatelinkVpcEndpointZone(id string) (obje "EndpointId": parts[0], } for { - runtime := util.RuntimeOptions{} - runtime.SetAutoretry(true) - response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2020-04-15"), StringPointer("AK"), nil, request, &runtime) + response, err = s.client.RpcPost("Privatelink", "2020-04-15", action, nil, request, true) if err != nil { if IsExpectedErrors(err, []string{"EndpointNotFound"}) { err = WrapErrorf(Error(GetNotFoundMessage("PrivatelinkVpcEndpointZone", id)), NotFoundMsg, ProviderERROR) diff --git a/website/docs/d/privatelink_service.html.markdown b/website/docs/d/privatelink_service.html.markdown index fb1d27f84ce..9b1d434aaa2 100644 --- a/website/docs/d/privatelink_service.html.markdown +++ b/website/docs/d/privatelink_service.html.markdown @@ -7,13 +7,13 @@ description: |- Provides a datasource to open the Privatelink service automatically. --- -# alicloud\_privatelink\_service +# alicloud_privatelink_service Using this data source can open Privatelink service automatically. If the service has been opened, it will return opened. For information about Privatelink and how to use it, see [What is Privatelink](https://www.alibabacloud.com/help/en/product/120462.htm). --> **NOTE:** Available in v1.113.0+ +-> **NOTE:** Available since v1.113.0. ## Example Usage diff --git a/website/docs/d/privatelink_vpc_endpoint_connections.html.markdown b/website/docs/d/privatelink_vpc_endpoint_connections.html.markdown index 05603633152..b2115a45bac 100644 --- a/website/docs/d/privatelink_vpc_endpoint_connections.html.markdown +++ b/website/docs/d/privatelink_vpc_endpoint_connections.html.markdown @@ -7,11 +7,11 @@ description: |- Provides a list of Privatelink Vpc Endpoint Connections to the user. --- -# alicloud\_privatelink\_vpc\_endpoint\_connections +# alicloud_privatelink_vpc_endpoint_connections This data source provides the Privatelink Vpc Endpoint Connections of the current Alibaba Cloud user. --> **NOTE:** Available in v1.110.0+. +-> **NOTE:** Available since v1.110.0. ## Example Usage @@ -38,13 +38,13 @@ The following arguments are supported: * `service_id` - (Required, ForceNew) The ID of the Vpc Endpoint Service. * `status` - (Optional, ForceNew) The status of Vpc Endpoint Connection. Valid Values: `Connected`, `Connecting`, `Deleted`, `Deleting`, `Disconnected`, `Disconnecting`, `Pending` and `ServiceDeleted`. -## Argument Reference +## Attributes Reference The following attributes are exported in addition to the arguments listed above: * `ids` - A list of Vpc Endpoint Connection IDs. * `connections` - A list of Privatelink Vpc Endpoint Connections. Each element contains the following attributes: - * `bandwidth` - The Bandwidth. - * `endpoint_id` - The ID of the Vpc Endpoint. - * `id` - The ID of the Vpc Endpoint Connection. - * `status` - The status of Vpc Endpoint Connection. + * `bandwidth` - The Bandwidth. + * `endpoint_id` - The ID of the Vpc Endpoint. + * `id` - The ID of the Vpc Endpoint Connection. + * `status` - The status of Vpc Endpoint Connection. diff --git a/website/docs/d/privatelink_vpc_endpoint_service_resources.html.markdown b/website/docs/d/privatelink_vpc_endpoint_service_resources.html.markdown index 50240d2fcc9..b501dc9005d 100644 --- a/website/docs/d/privatelink_vpc_endpoint_service_resources.html.markdown +++ b/website/docs/d/privatelink_vpc_endpoint_service_resources.html.markdown @@ -7,11 +7,11 @@ description: |- Provides a list of Privatelink Vpc Endpoint Service Resources to the user. --- -# alicloud\_privatelink\_vpc\_endpoint\_service\_resources +# alicloud_privatelink_vpc_endpoint_service_resources This data source provides the Privatelink Vpc Endpoint Service Resources of the current Alibaba Cloud user. --> **NOTE:** Available in v1.110.0+. +-> **NOTE:** Available since v1.110.0. ## Example Usage @@ -34,12 +34,12 @@ The following arguments are supported: * `output_file` - (Optional) File name where to save data source results (after running `terraform plan`). * `service_id` - (Required, ForceNew) The ID of Vpc Endpoint Service. -## Argument Reference +## Attributes Reference The following attributes are exported in addition to the arguments listed above: * `ids` - A list of Vpc Endpoint Service Resource IDs. * `resources` - A list of Privatelink Vpc Endpoint Service Resources. Each element contains the following attributes: - * `id` - The ID of the Vpc Endpoint Service Resource. - * `resource_id` - The ID of Resource. - * `resource_type` - The type of Resource. + * `id` - The ID of the Vpc Endpoint Service Resource. + * `resource_id` - The ID of Resource. + * `resource_type` - The type of Resource. diff --git a/website/docs/d/privatelink_vpc_endpoint_service_users.html.markdown b/website/docs/d/privatelink_vpc_endpoint_service_users.html.markdown index 23c1336af99..99f916a8441 100644 --- a/website/docs/d/privatelink_vpc_endpoint_service_users.html.markdown +++ b/website/docs/d/privatelink_vpc_endpoint_service_users.html.markdown @@ -7,11 +7,11 @@ description: |- Provides a list of Privatelink Vpc Endpoint Service Users to the user. --- -# alicloud\_privatelink\_vpc\_endpoint\_service\_users +# alicloud_privatelink_vpc_endpoint_service_users This data source provides the Privatelink Vpc Endpoint Service Users of the current Alibaba Cloud user. --> **NOTE:** Available in v1.110.0+. +-> **NOTE:** Available since v1.110.0. ## Example Usage @@ -35,11 +35,11 @@ The following arguments are supported: * `service_id` - (Required, ForceNew) The Id of Vpc Endpoint Service. * `user_id` - (Optional, ForceNew) The Id of Ram User. -## Argument Reference +## Attributes Reference The following attributes are exported in addition to the arguments listed above: * `ids` - A list of Vpc Endpoint Service User IDs. * `users` - A list of Privatelink Vpc Endpoint Service Users. Each element contains the following attributes: - * `id` - The ID of the Vpc Endpoint Service User. - * `user_id` - The Id of Ram User. + * `id` - The ID of the Vpc Endpoint Service User. + * `user_id` - The Id of Ram User. diff --git a/website/docs/d/privatelink_vpc_endpoint_services.html.markdown b/website/docs/d/privatelink_vpc_endpoint_services.html.markdown index 3a333c8d2b4..1191957f96a 100644 --- a/website/docs/d/privatelink_vpc_endpoint_services.html.markdown +++ b/website/docs/d/privatelink_vpc_endpoint_services.html.markdown @@ -7,11 +7,11 @@ description: |- Provides a list of Privatelink Vpc Endpoint Services to the user. --- -# alicloud\_privatelink\_vpc\_endpoint\_services +# alicloud_privatelink_vpc_endpoint_services This data source provides the Privatelink Vpc Endpoint Services of the current Alibaba Cloud user. --> **NOTE:** Available in v1.109.0+. +-> **NOTE:** Available since v1.109.0. ## Example Usage @@ -40,18 +40,18 @@ The following arguments are supported: * `status` - (Optional, ForceNew) The Status of Vpc Endpoint Service. Valid Value: `Active`, `Creating`, `Deleted`, `Deleting` and `Pending`. * `vpc_endpoint_service_name` - (Optional, ForceNew) The name of Vpc Endpoint Service. -## Argument Reference +## Attributes Reference The following attributes are exported in addition to the arguments listed above: * `names` - A list of Vpc Endpoint Service names. * `services` - A list of Privatelink Vpc Endpoint Services. Each element contains the following attributes: - * `auto_accept_connection` - Whether to automatically accept terminal node connections.. - * `connect_bandwidth` - The connection bandwidth. - * `id` - The ID of the Vpc Endpoint Service. - * `service_business_status` - The business status of the terminal node service.. - * `service_description` - The description of the terminal node service. - * `service_domain` - The domain of service. - * `service_id` - The ID of the Vpc Endpoint Service. - * `status` - The Status of Vpc Endpoint Service. - * `vpc_endpoint_service_name` - The name of Vpc Endpoint Service. + * `auto_accept_connection` - Whether to automatically accept terminal node connections.. + * `connect_bandwidth` - The connection bandwidth. + * `id` - The ID of the Vpc Endpoint Service. + * `service_business_status` - The business status of the terminal node service.. + * `service_description` - The description of the terminal node service. + * `service_domain` - The domain of service. + * `service_id` - The ID of the Vpc Endpoint Service. + * `status` - The Status of Vpc Endpoint Service. + * `vpc_endpoint_service_name` - The name of Vpc Endpoint Service. diff --git a/website/docs/d/privatelink_vpc_endpoint_zones.html.markdown b/website/docs/d/privatelink_vpc_endpoint_zones.html.markdown index 25b40e05bf0..e5bfcaecce1 100644 --- a/website/docs/d/privatelink_vpc_endpoint_zones.html.markdown +++ b/website/docs/d/privatelink_vpc_endpoint_zones.html.markdown @@ -7,11 +7,11 @@ description: |- Provides a list of Privatelink Vpc Endpoint Zones to the user. --- -# alicloud\_privatelink\_vpc\_endpoint\_zones +# alicloud_privatelink_vpc_endpoint_zones This data source provides the Privatelink Vpc Endpoint Zones of the current Alibaba Cloud user. --> **NOTE:** Available in v1.111.0+. +-> **NOTE:** Available since v1.111.0. ## Example Usage @@ -35,16 +35,16 @@ The following arguments are supported: * `output_file` - (Optional) File name where to save data source results (after running `terraform plan`). * `status` - (Optional, ForceNew) The Status of Vpc Endpoint Zone. Valid Values: `Connected`, `Connecting`, `Creating`, `Deleted`, `Deleting`, `Disconnected`, `Disconnecting` and `Wait`. -## Argument Reference +## Attributes Reference The following attributes are exported in addition to the arguments listed above: * `ids` - A list of Vpc Endpoint Zone IDs. * `zones` - A list of Privatelink Vpc Endpoint Zones. Each element contains the following attributes: - * `eni_id` - Terminal node network card. - * `eni_ip` - IP address of the terminal node network card. - * `id` - The ID of the Vpc Endpoint Zone. - * `status` - The Status of Vpc Endpoint Zone.. - * `vswitch_id` - The vSwitch id. - * `zone_domain` - The Zone Domain. - * `zone_id` - The Zone Id. + * `eni_id` - Terminal node network card. + * `eni_ip` - IP address of the terminal node network card. + * `id` - The ID of the Vpc Endpoint Zone. + * `status` - The Status of Vpc Endpoint Zone.. + * `vswitch_id` - The vSwitch id. + * `zone_domain` - The Zone Domain. + * `zone_id` - The Zone Id. diff --git a/website/docs/d/privatelink_vpc_endpoints.html.markdown b/website/docs/d/privatelink_vpc_endpoints.html.markdown index ef129b0778f..6969023d95b 100644 --- a/website/docs/d/privatelink_vpc_endpoints.html.markdown +++ b/website/docs/d/privatelink_vpc_endpoints.html.markdown @@ -7,11 +7,11 @@ description: |- Provides a list of Privatelink Vpc Endpoints to the user. --- -# alicloud\_privatelink\_vpc\_endpoints +# alicloud_privatelink_vpc_endpoints This data source provides the Privatelink Vpc Endpoints of the current Alibaba Cloud user. --> **NOTE:** Available in v1.109.0+. +-> **NOTE:** Available since v1.109.0. ## Example Usage @@ -42,22 +42,22 @@ The following arguments are supported: * `vpc_endpoint_name` - (Optional, ForceNew) The name of Vpc Endpoint. * `vpc_id` - (Optional, ForceNew) The private network to which the terminal node belongs.. -## Argument Reference +## Attributes Reference The following attributes are exported in addition to the arguments listed above: * `names` - A list of Vpc Endpoint names. * `endpoints` - A list of Privatelink Vpc Endpoints. Each element contains the following attributes: - * `bandwidth` - The Bandwidth. - * `connection_status` - The status of Connection. - * `endpoint_business_status` - The status of Endpoint Business. - * `endpoint_description` - The description of Vpc Endpoint. - * `endpoint_domain` - The Endpoint Domain. - * `endpoint_id` - The ID of the Vpc Endpoint. - * `id` - The ID of the Vpc Endpoint. - * `security_group_ids` - The security group associated with the terminal node network card. - * `service_id` - The terminal node service associated with the terminal node. - * `service_name` - The name of the terminal node service associated with the terminal node. - * `status` - The status of Vpc Endpoint. - * `vpc_endpoint_name` - The name of Vpc Endpoint. - * `vpc_id` - The private network to which the terminal node belongs. + * `bandwidth` - The Bandwidth. + * `connection_status` - The status of Connection. + * `endpoint_business_status` - The status of Endpoint Business. + * `endpoint_description` - The description of Vpc Endpoint. + * `endpoint_domain` - The Endpoint Domain. + * `endpoint_id` - The ID of the Vpc Endpoint. + * `id` - The ID of the Vpc Endpoint. + * `security_group_ids` - The security group associated with the terminal node network card. + * `service_id` - The terminal node service associated with the terminal node. + * `service_name` - The name of the terminal node service associated with the terminal node. + * `status` - The status of Vpc Endpoint. + * `vpc_endpoint_name` - The name of Vpc Endpoint. + * `vpc_id` - The private network to which the terminal node belongs.