From 8ab592d4e3457bbdb233ed70712cb99bf1951838 Mon Sep 17 00:00:00 2001 From: ParthaI Date: Mon, 23 Sep 2024 16:26:08 +0530 Subject: [PATCH 1/8] Update Alicloud SDK version to support native profile authentication and remove manual profile handling code --- alicloud/service.go | 219 +----------------- alicloud/table_alicloud_action_trail.go | 2 +- alicloud/table_alicloud_cas_certificate.go | 20 +- .../table_alicloud_ram_credential_report.go | 42 +++- alicloud/table_alicloud_ram_group.go | 2 +- alicloud/table_alicloud_ram_policy.go | 4 +- alicloud/table_alicloud_ram_user.go | 4 +- go.mod | 8 +- go.sum | 45 ++-- 9 files changed, 88 insertions(+), 258 deletions(-) diff --git a/alicloud/service.go b/alicloud/service.go index c87ee1c..f1e3b65 100644 --- a/alicloud/service.go +++ b/alicloud/service.go @@ -2,13 +2,9 @@ package alicloud import ( "context" - "encoding/json" "fmt" "os" - "path/filepath" - ims "github.com/alibabacloud-go/ims-20190815/client" - rpc "github.com/alibabacloud-go/tea-rpc/client" "github.com/aliyun/alibaba-cloud-sdk-go/sdk" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials" @@ -26,7 +22,6 @@ import ( "github.com/aliyun/alibaba-cloud-sdk-go/services/sts" "github.com/aliyun/alibaba-cloud-sdk-go/services/vpc" "github.com/aliyun/aliyun-oss-go-sdk/oss" - credsConfig "github.com/aliyun/credentials-go/credentials" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" ) @@ -182,42 +177,6 @@ func ECSRegionService(ctx context.Context, d *plugin.QueryData, region string) ( return svc, nil } -// IMSService returns the service connection for Alicloud IMS service -func IMSService(ctx context.Context, d *plugin.QueryData) (*ims.Client, error) { - region := GetDefaultRegion(d.Connection) - // have we already created and cached the service? - serviceCacheKey := fmt.Sprintf("ims-%s", region) - if cachedData, ok := d.ConnectionManager.Cache.Get(serviceCacheKey); ok { - return cachedData.(*ims.Client), nil - } - - credCfg, err := getCredentialSessionCached(ctx, d, nil) - if err != nil { - return nil, err - } - cfg := credCfg.(*CredentialConfig) - - credential, err := credsConfig.NewCredential(cfg.CredConfig) - if err != nil { - return nil, err - } - - config := &rpc.Config{} - config.Credential = credential - config.RegionId = ®ion - - // so it was not in cache - create service - svc, err := ims.NewClient(config) - if err != nil { - return nil, err - } - - // cache the service connection - d.ConnectionManager.Cache.Set(serviceCacheKey, svc) - - return svc, nil -} - // KMSService returns the service connection for Alicloud KMS service func KMSService(ctx context.Context, d *plugin.QueryData) (*kms.Client, error) { region := d.EqualsQualString(matrixKeyRegion) @@ -622,68 +581,6 @@ type CredentialConfig struct { Creds auth.Credential DefaultRegion string Config *sdk.Config - CredConfig *credsConfig.Config // This is required for the table alicloud_ram_credential_report because, it uses the different SDK to make the API call. -} - -type Config struct { - Profiles []Profile `json:"profiles"` -} - -// Profile structure -type Profile struct { - Name string `json:"name"` - Mode string `json:"mode"` - AccessKeyId string `json:"access_key_id"` - AccessKeySecret string `json:"access_key_secret"` - StsToken string `json:"sts_token"` - StsRegion string `json:"sts_region"` - RamRoleName string `json:"ram_role_name"` - RamRoleArn string `json:"ram_role_arn"` - RamSessionName string `json:"ram_session_name"` - SourceProfile string `json:"source_profile"` - PublicKeyId string `json:"public_key_id"` - PrivateKey string `json:"private_key"` - KeyPairName string `json:"key_pair_name"` - ExpiredSeconds int `json:"expired_seconds"` - Verified string `json:"verified"` - RegionId string `json:"region_id"` - OutputFormat string `json:"output_format"` - Language string `json:"language"` - Site string `json:"site"` - RetryTimeout int `json:"retry_timeout"` - ConnectTimeout int `json:"connect_timeout"` - RetryCount int `json:"retry_count"` - ProcessCommand string `json:"process_command"` - CredentialsUri string `json:"credentials_uri"` -} - -type ProfileMap map[string]*Profile - -func (p ProfileMap) getProfileDetails(profile string) *Profile { - return p[profile] -} - -func getProfileMap() ProfileMap { - homeDir, err := os.UserHomeDir() - if err != nil { - panic("Failed to get home directory :" + err.Error()) - } - // Credential path is ~/.aliyun/config.json - configPath := filepath.Join(homeDir, ".aliyun", "config.json") - - config, err := loadConfig(configPath) - if err != nil { - panic("Failed to load config: " + err.Error()) - } - - configuredProfiles := make(ProfileMap) - - for _, p := range config.Profiles { - pCopy := p // Create a copy of p - configuredProfiles[pCopy.Name] = &pCopy - } - - return configuredProfiles } // Get credential from the profile configuration for Alicloud CLI @@ -703,120 +600,16 @@ func getProfileConfigurations(_ context.Context, d *plugin.QueryData) (*Credenti func getCredentialConfigByProfile(profile string, d *plugin.QueryData) (*CredentialConfig, error) { defaultRegion := GetDefaultRegion(d.Connection) defaultConfig := sdk.NewConfig() - configuredProfiles := getProfileMap() - - profileConfig := configuredProfiles.getProfileDetails(profile) - - if profileConfig == nil { - return nil, fmt.Errorf("profile with name '%s' is not configured", profile) - } // We will get a nil value if the specified profile is not available // Or // The authentication mode of the profile is not AK | RamRoleArn | StsToken | EcsRamRole As these are the supported type by ALicloud CLI. // https://github.com/aliyun/aliyun-cli/blob/master/README.md#configure-authentication-methods - creds, credsConfig := getCredentialBasedOnProfile(profileConfig) - if creds == nil { - return nil, fmt.Errorf("unsupported authentication mode '%s'", profileConfig.Mode) - } + // credsProvider := credentials.NewCLIProfileCredentialsProviderBuilder().Build(). - return &CredentialConfig{creds, defaultRegion, defaultConfig, credsConfig}, nil -} + creds := credentials.NewCLIProfileCredentialsProviderBuilder().WithProfileName(profile).Build() -// Load the alicloud credential -func loadConfig(path string) (*Config, error) { - data, err := os.ReadFile(path) - if err != nil { - return nil, fmt.Errorf("error reading config file: %v", err) - } - - var config Config - if err := json.Unmarshal(data, &config); err != nil { - return nil, fmt.Errorf("error unmarshaling config: %v", err) - } - - return &config, nil -} - -// We can configure the profile with following supported authentication methods: -// https://github.com/aliyun/aliyun-cli/blob/master/README.md#configure-authentication-methods -func getCredentialBasedOnProfile(profileConfig *Profile) (interface{}, *credsConfig.Config) { - switch profileConfig.Mode { - case "AK": - return &credentials.AccessKeyCredential{ - AccessKeyId: profileConfig.AccessKeyId, - AccessKeySecret: profileConfig.AccessKeySecret, - }, new(credsConfig.Config).SetType("access_key"). - SetAccessKeyId(profileConfig.AccessKeyId). - SetAccessKeySecret(profileConfig.AccessKeySecret) - case "StsToken": - return &credentials.StsTokenCredential{ - AccessKeyId: profileConfig.AccessKeyId, - AccessKeySecret: profileConfig.AccessKeySecret, - AccessKeyStsToken: profileConfig.StsToken, - }, new(credsConfig.Config).SetType("sts"). - SetAccessKeyId(profileConfig.AccessKeyId). - SetAccessKeySecret(profileConfig.AccessKeySecret). - SetSecurityToken(profileConfig.StsToken) - case "EcsRamRole": - return &credentials.EcsRamRoleCredential{ - RoleName: profileConfig.RamRoleName, - }, new(credsConfig.Config).SetType("ecs_ram_role"). - SetRoleName(profileConfig.RamRoleName) - case "RamRoleArn": - return &credentials.RamRoleArnCredential{ - AccessKeyId: profileConfig.AccessKeyId, - AccessKeySecret: profileConfig.AccessKeySecret, - RoleArn: profileConfig.RamRoleArn, - RoleSessionName: profileConfig.RamSessionName, - RoleSessionExpiration: profileConfig.ExpiredSeconds, - }, new(credsConfig.Config). - SetType("ram_role_arn"). - SetAccessKeyId(profileConfig.AccessKeyId). - SetAccessKeySecret(profileConfig.AccessKeySecret). - SetRoleArn(profileConfig.RamRoleArn). - SetRoleSessionName(profileConfig.RamSessionName). - SetRoleSessionExpiration(profileConfig.ExpiredSeconds) - case "ChainableRamRoleArn": // https://github.com/aliyun/aliyun-cli/blob/master/config/profile.go#L324 - sourceProfile := getSourceProfileCredential(profileConfig.SourceProfile) - if sourceProfile == nil { - return nil, nil - } - return &credentials.RamRoleArnCredential{ - AccessKeyId: sourceProfile.AccessKeyId, - AccessKeySecret: sourceProfile.AccessKeySecret, - RoleArn: profileConfig.RamRoleArn, - RoleSessionName: profileConfig.RamSessionName, - RoleSessionExpiration: profileConfig.ExpiredSeconds, - StsRegion: profileConfig.StsRegion, - }, new(credsConfig.Config). - SetType("ram_role_arn"). - SetAccessKeyId(sourceProfile.AccessKeyId). - SetAccessKeySecret(sourceProfile.AccessKeySecret). - SetRoleArn(profileConfig.RamRoleArn). - SetRoleSessionName(profileConfig.RamSessionName). - SetRoleSessionExpiration(profileConfig.ExpiredSeconds) - - //// Commenting out for the time being for reference, will uncomment it as per user's request. - //// This type of authentication is not supported by Alicloud CLI - //// Supported authentication modes: AK, StsToken, RamRoleArn, and EcsRamRole - //// https://www.alibabacloud.com/help/en/cli/interactive-configuration-or-fast-configuration#concept-508451/section-pq4-04b-7an - // case "RsaKeyPair": - // return &credentials.RsaKeyPairCredential{ - // PublicKeyId: profileConfig.PublicKeyId, - // PrivateKey: profileConfig.PrivateKey, - // SessionExpiration: profileConfig.ExpiredSeconds, - // } - } - return nil, nil -} - -func getSourceProfileCredential(profile string) *Profile { - pMap := getProfileMap() - - p := pMap.getProfileDetails(profile) - - return p + return &CredentialConfig{creds, defaultRegion, defaultConfig}, nil } var getCredentialSessionCached = plugin.HydrateFunc(getCredentialSessionUncached).Memoize() @@ -846,13 +639,9 @@ func getCredentialSessionUncached(ctx context.Context, d *plugin.QueryData, h *p } if accessKey != "" && secretKey != "" { creds := credentials.NewAccessKeyCredential(accessKey, secretKey) - connectionCfg = &CredentialConfig{creds, defaultRegion, defaultConfig, new(credsConfig.Config).SetType("access_key"). - SetAccessKeyId(accessKey). - SetAccessKeySecret(secretKey)} + connectionCfg = &CredentialConfig{creds, defaultRegion, defaultConfig} return connectionCfg, nil } return nil, nil } - - diff --git a/alicloud/table_alicloud_action_trail.go b/alicloud/table_alicloud_action_trail.go index 2a25b8d..9664f7e 100644 --- a/alicloud/table_alicloud_action_trail.go +++ b/alicloud/table_alicloud_action_trail.go @@ -198,7 +198,7 @@ func getActionTrail(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateD func getActionTrailAka(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { plugin.Logger(ctx).Trace("getActionTrailAka") - data := h.Item.(actiontrail.TrailListItem) + data := h.Item.(actiontrail.Trail) // Get project details getCommonColumnsCached := plugin.HydrateFunc(getCommonColumns).WithCache() diff --git a/alicloud/table_alicloud_cas_certificate.go b/alicloud/table_alicloud_cas_certificate.go index 07c4749..8cccfeb 100644 --- a/alicloud/table_alicloud_cas_certificate.go +++ b/alicloud/table_alicloud_cas_certificate.go @@ -167,27 +167,27 @@ func listUserCertificate(ctx context.Context, d *plugin.QueryData, _ *plugin.Hyd return nil, err } - request := cas.CreateDescribeUserCertificateListRequest() + request := cas.CreateListUserCertificateOrderRequest() request.ShowSize = "50" request.CurrentPage = "1" request.QueryParams["RegionId"] = region count := 0 for { - response, err := client.DescribeUserCertificateList(request) + response, err := client.ListUserCertificateOrder(request) if err != nil { plugin.Logger(ctx).Error("alicloud_user_certificate.listUserCertificate", "query_error", err, "request", request) return nil, err } - for _, i := range response.CertificateList { + for _, i := range response.CertificateOrderList { d.StreamListItem(ctx, i) count++ } - if count >= response.TotalCount { + if count >= int(response.TotalCount) { break } - request.CurrentPage = requests.NewInteger(response.CurrentPage + 1) + request.CurrentPage = requests.NewInteger(int(response.CurrentPage) + 1) } return nil, nil @@ -222,10 +222,10 @@ func getUserCertificate(ctx context.Context, d *plugin.QueryData, h *plugin.Hydr id = d.EqualsQuals["id"].GetInt64Value() } - request := cas.CreateDescribeUserCertificateDetailRequest() + request := cas.CreateGetUserCertificateDetailRequest() request.CertId = requests.NewInteger(int(id)) - response, err := client.DescribeUserCertificateDetail(request) + response, err := client.GetUserCertificateDetail(request) if err != nil { plugin.Logger(ctx).Error("alicloud_user_certificate.getUserCertificate", "query_error", err, "request", request) return nil, err @@ -261,9 +261,9 @@ func getUserCertificateRegion(ctx context.Context, d *plugin.QueryData, h *plugi func casCertificate(item interface{}) int64 { switch item := item.(type) { - case cas.Certificate: - return item.Id - case *cas.DescribeUserCertificateDetailResponse: + case cas.CertificateOrderListItem: + return item.CertificateId + case *cas.GetUserCertificateDetailResponse: return item.Id } return 0 diff --git a/alicloud/table_alicloud_ram_credential_report.go b/alicloud/table_alicloud_ram_credential_report.go index 8b0c8ab..ce98e04 100644 --- a/alicloud/table_alicloud_ram_credential_report.go +++ b/alicloud/table_alicloud_ram_credential_report.go @@ -3,8 +3,9 @@ package alicloud import ( "context" "encoding/base64" + "encoding/json" - ims "github.com/alibabacloud-go/ims-20190815/client" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/gocarina/gocsv" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" @@ -241,20 +242,41 @@ func tableAlicloudRAMCredentialReport(ctx context.Context) *plugin.Table { func listRAMCredentialReports(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { // Create service connection - client, err := IMSService(ctx, d) + client, err := RAMService(ctx, d) if err != nil { plugin.Logger(ctx).Error("alicloud_ram_credential_report.listRAMCredentialReports", "connection_error", err) return nil, err } - request := &ims.GetCredentialReportRequest{} - response, err := client.GetCredentialReport(request) + // Create a new request to retrieve the credential report. + // To maintain consistency within the authentication module, we chose not to use + // the "github.com/alibabacloud-go/ims-20190815/client" and "github.com/alibabacloud-go/tea-rpc/client" packages. + // Instead, we opted for the "github.com/aliyun/alibaba-cloud-sdk-go/sdk" package to handle authentication and make the API call. + + request := requests.NewCommonRequest() + request.Method = "POST" + request.Scheme = "https" + request.Domain = "ims.aliyuncs.com" + request.Version = "2019-08-15" + request.ApiName = "GetCredentialReport" + + // Make the API call + response, err := client.ProcessCommonRequest(request) + if err != nil { + plugin.Logger(ctx).Error("alicloud_ram_credential_report.listRAMCredentialReports", "Api_error", err) + return nil, err + } + + // Unmarshal the response to the struct + var credentialReportResponse GetCredentialReportResponse + err = json.Unmarshal(response.GetHttpContentBytes(), &credentialReportResponse) if err != nil { + plugin.Logger(ctx).Error("alicloud_ram_credential_report.listRAMCredentialReports", "unmarshal_error", err) return nil, err } // The report is Base64-encoded. After decoding the report, the credential report is in the CSV format. - data, err := base64.StdEncoding.DecodeString(*response.Content) + data, err := base64.StdEncoding.DecodeString(*credentialReportResponse.Content) if err != nil { return nil, err } @@ -266,9 +288,15 @@ func listRAMCredentialReports(ctx context.Context, d *plugin.QueryData, _ *plugi } for _, row := range rows { - row.GeneratedTime = response.GeneratedTime + row.GeneratedTime = credentialReportResponse.GeneratedTime d.StreamListItem(ctx, row) } - return response, nil + return nil, nil +} + +type GetCredentialReportResponse struct { + RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty" require:"true"` + Content *string `json:"Content,omitempty" xml:"Content,omitempty" require:"true"` + GeneratedTime *string `json:"GeneratedTime,omitempty" xml:"GeneratedTime,omitempty" require:"true"` } diff --git a/alicloud/table_alicloud_ram_group.go b/alicloud/table_alicloud_ram_group.go index 74d4c10..dd52ef5 100644 --- a/alicloud/table_alicloud_ram_group.go +++ b/alicloud/table_alicloud_ram_group.go @@ -156,7 +156,7 @@ func getRAMGroup(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData var name string if h.Item != nil { - i := h.Item.(ram.GroupInListGroups) + i := h.Item.(ram.Group) name = i.GroupName } else { quals := d.EqualsQuals diff --git a/alicloud/table_alicloud_ram_policy.go b/alicloud/table_alicloud_ram_policy.go index 1db376b..64ad7a7 100644 --- a/alicloud/table_alicloud_ram_policy.go +++ b/alicloud/table_alicloud_ram_policy.go @@ -198,7 +198,7 @@ func getRAMPolicy(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateDat var name, policyType string if h.Item != nil { - i := h.Item.(ram.PolicyInListPolicies) + i := h.Item.(ram.Policy) name = i.PolicyName policyType = i.PolicyType } else { @@ -257,7 +257,7 @@ func getPolicyAkas(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateDa func policyName(item interface{}) string { switch item := item.(type) { - case ram.PolicyInListPolicies: + case ram.Policy: return item.PolicyName case *ram.GetPolicyResponse: return item.Policy.PolicyName diff --git a/alicloud/table_alicloud_ram_user.go b/alicloud/table_alicloud_ram_user.go index 4b29a6c..c71f574 100644 --- a/alicloud/table_alicloud_ram_user.go +++ b/alicloud/table_alicloud_ram_user.go @@ -337,7 +337,7 @@ func getRAMUserMfaDevices(ctx context.Context, d *plugin.QueryData, h *plugin.Hy return nil, serverErr } - var items []ram.VirtualMFADeviceInListVirtualMFADevices + var items []ram.VirtualMFADevice for _, i := range response.VirtualMFADevices.VirtualMFADevice { if i.User.UserName == data.UserName { items = append(items, i) @@ -395,7 +395,7 @@ func getCsUserPermissions(ctx context.Context, d *plugin.QueryData, h *plugin.Hy //// TRANSFORM FUNCTION func userMfaStatus(_ context.Context, d *transform.TransformData) (interface{}, error) { - data := d.HydrateItem.([]ram.VirtualMFADeviceInListVirtualMFADevices) + data := d.HydrateItem.([]ram.VirtualMFADevice) if len(data) > 0 { return true, nil diff --git a/go.mod b/go.mod index 3cd5d05..a013efc 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.21.1 require ( github.com/alibabacloud-go/ims-20190815 v1.0.0 github.com/alibabacloud-go/tea-rpc v1.1.8 - github.com/aliyun/alibaba-cloud-sdk-go v1.61.1140 + github.com/aliyun/alibaba-cloud-sdk-go v1.63.17 github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible github.com/aliyun/credentials-go v1.1.2 github.com/gocarina/gocsv v0.0.0-20201208093247-67c824bc04d4 @@ -60,7 +60,6 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect - github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect @@ -86,6 +85,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/client_golang v1.14.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -93,8 +93,6 @@ require ( github.com/prometheus/procfs v0.8.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/satori/go.uuid v1.2.0 // indirect - github.com/smartystreets/assertions v1.13.0 // indirect - github.com/smartystreets/goconvey v1.7.2 // indirect github.com/stevenle/topsort v0.2.0 // indirect github.com/tkrajina/go-reflector v0.5.6 // indirect github.com/ulikunitz/xz v0.5.10 // indirect @@ -128,6 +126,6 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect - gopkg.in/ini.v1 v1.56.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 8d0ab14..035c50b 100644 --- a/go.sum +++ b/go.sum @@ -187,11 +187,13 @@ cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoIS dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -215,8 +217,8 @@ github.com/alibabacloud-go/tea-rpc-utils v1.1.2/go.mod h1:V5HdNi6Xdn0JMpgVhQ19vs github.com/alibabacloud-go/tea-utils v1.3.5/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= github.com/alibabacloud-go/tea-utils v1.3.6 h1:bVjrxHztM8hAs6nOfLWCgxQfAtKb9RgFFMV6J3rdvB4= github.com/alibabacloud-go/tea-utils v1.3.6/go.mod h1:EI/o33aBfj3hETm4RLiAxF/ThQdSngxrpF8rKUDJjPE= -github.com/aliyun/alibaba-cloud-sdk-go v1.61.1140 h1:1q4jc7cEo4zs2tQSrvxdG69T+LCxnt833G0VdolqpR8= -github.com/aliyun/alibaba-cloud-sdk-go v1.61.1140/go.mod h1:pUKYbK5JQ+1Dfxk80P0qxGqe5dkxDoabbZS7zOcouyA= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.17 h1:hdhcJzcnwFg5/aM4kmz9EY8sV6IVYnzJTmtYwNrFjmY= +github.com/aliyun/alibaba-cloud-sdk-go v1.63.17/go.mod h1:SOSDHfe1kX91v3W5QiBsWSLqeLxImobbMX1mxrFHsVQ= github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible h1:Ft+KeWIJxFP76LqgJbvtOA1qBIoC8vGkTV3QeCOeJC4= github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= github.com/aliyun/credentials-go v1.1.2 h1:qU1vwGIBb3UJ8BwunHDRFtAhS6jnQLnde/yk0+Ih2GY= @@ -264,6 +266,7 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -299,6 +302,7 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gertd/go-pluralize v0.2.1 h1:M3uASbVjMnTsPb0PNqg+E/24Vwigyo/tvyMTtAlLgiA= @@ -328,6 +332,7 @@ github.com/gocarina/gocsv v0.0.0-20201208093247-67c824bc04d4 h1:Q7s2AN3DhFJKOnzO github.com/gocarina/gocsv v0.0.0-20201208093247-67c824bc04d4/go.mod h1:5YoVOkjYAQumqlV356Hj3xeYh4BdZuLE0/nRkf2NKkI= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= @@ -433,8 +438,6 @@ github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qK github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= -github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= @@ -462,13 +465,11 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -476,10 +477,10 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= @@ -533,6 +534,8 @@ github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b h1:FfH+VrHHk6Lxt9HdVS0PXzSXFyS2NbZKXv33FYPol0A= +github.com/opentracing/opentracing-go v1.2.1-0.20220228012449-10b1cf09e00b/go.mod h1:AC62GU6hc0BrNm+9RK9VSiwa/EUe1bkIeFORAMcHvJU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -580,13 +583,7 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.1.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= -github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= -github.com/smartystreets/assertions v1.13.0 h1:Dx1kYM01xsSqKPno3aqLnrwac2LetPvN23diwyr69Qs= -github.com/smartystreets/assertions v1.13.0/go.mod h1:wDmR7qL282YbGsPy6H/yAsesrxfxaaSlJazyFLYVFx8= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= -github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stevenle/topsort v0.2.0 h1:LLWgtp34HPX6/RBDRS0kElVxGOTzGBLI1lSAa5Lb46k= github.com/stevenle/topsort v0.2.0/go.mod h1:ck2WG2/ZrOr6dLApQ/5Xrqy5wv3T0qhKYWE7r9tkibc= @@ -613,6 +610,10 @@ github.com/turbot/go-kit v0.10.0-rc.0 h1:kd+jp2ibbIV33Hc8SsMAN410Dl9Pz6SJ40axbKU github.com/turbot/go-kit v0.10.0-rc.0/go.mod h1:fFQqR59I5z5JeeBLfK1PjSifn4Oprs3NiQx0CxeSJxs= github.com/turbot/steampipe-plugin-sdk/v5 v5.10.1 h1:yqiWeswy7geNzRIUJGuA7KQRq6gY5gUOc6ozBgbpNzI= github.com/turbot/steampipe-plugin-sdk/v5 v5.10.1/go.mod h1:Ji3NU2vyZChu4aodAuSpeAS/JkApFGvsPePjOn8h9as= +github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= +github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= +github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= +github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -658,6 +659,8 @@ go.opentelemetry.io/otel/trace v1.26.0/go.mod h1:4iDxvGDQuUkHve82hJJ8UqrwswHYsZu go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v1.2.0 h1:pVeZGk7nXDC9O2hncA6nHldxEjm6LByfA2aN8IOkz94= go.opentelemetry.io/proto/otlp v1.2.0/go.mod h1:gGpR8txAl5M03pDhMC79G6SdqNV26naRm/KDsgaHD8A= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -670,7 +673,10 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -682,6 +688,7 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -906,8 +913,10 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -971,6 +980,10 @@ golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNq golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= +gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1201,9 +1214,9 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.56.0 h1:DPMeDvGTM54DXbPkVIZsp19fp/I2K7zwA/itHYHKo8Y= gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1214,6 +1227,7 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1224,5 +1238,6 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 2b581a7e9a0b88659477a1c307ce85fe1f7d6baa Mon Sep 17 00:00:00 2001 From: ParthaI Date: Mon, 23 Sep 2024 16:50:30 +0530 Subject: [PATCH 2/8] Fixed the lint failure --- alicloud/table_alicloud_action_trail.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alicloud/table_alicloud_action_trail.go b/alicloud/table_alicloud_action_trail.go index 9664f7e..3376d29 100644 --- a/alicloud/table_alicloud_action_trail.go +++ b/alicloud/table_alicloud_action_trail.go @@ -189,7 +189,7 @@ func getActionTrail(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateD return nil, serverErr } - if response.TrailList != nil && len(response.TrailList) > 0 { + if len(response.TrailList) > 0 { return response.TrailList[0], nil } From a7d9ba8504edba16d03211c5ff9f15d283172c2a Mon Sep 17 00:00:00 2001 From: ParthaI Date: Mon, 23 Sep 2024 16:58:01 +0530 Subject: [PATCH 3/8] Fixed the lint failure --- alicloud/table_alicloud_ecs_auto_provisioning_group.go | 2 +- alicloud/table_alicloud_ecs_autoscaling_group.go | 2 +- alicloud/table_alicloud_ecs_disk.go | 4 ++-- alicloud/table_alicloud_ecs_image.go | 2 +- alicloud/table_alicloud_ecs_instance.go | 2 +- alicloud/table_alicloud_ecs_key_pair.go | 2 +- alicloud/table_alicloud_ecs_luanch_template.go | 4 ++-- alicloud/table_alicloud_ecs_network_interface.go | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/alicloud/table_alicloud_ecs_auto_provisioning_group.go b/alicloud/table_alicloud_ecs_auto_provisioning_group.go index 8252ddf..b0d2d75 100644 --- a/alicloud/table_alicloud_ecs_auto_provisioning_group.go +++ b/alicloud/table_alicloud_ecs_auto_provisioning_group.go @@ -216,7 +216,7 @@ func getEcsAutosProvisioningGroup(ctx context.Context, d *plugin.QueryData, h *p return nil, serverErr } - if response.AutoProvisioningGroups.AutoProvisioningGroup != nil && len(response.AutoProvisioningGroups.AutoProvisioningGroup) > 0 { + if len(response.AutoProvisioningGroups.AutoProvisioningGroup) > 0 { return response.AutoProvisioningGroups.AutoProvisioningGroup[0], nil } diff --git a/alicloud/table_alicloud_ecs_autoscaling_group.go b/alicloud/table_alicloud_ecs_autoscaling_group.go index 1ebe2e8..7620b2b 100644 --- a/alicloud/table_alicloud_ecs_autoscaling_group.go +++ b/alicloud/table_alicloud_ecs_autoscaling_group.go @@ -352,7 +352,7 @@ func getEcsAutoscalingGroup(ctx context.Context, d *plugin.QueryData, h *plugin. return nil, serverErr } - if response.ScalingGroups.ScalingGroup != nil && len(response.ScalingGroups.ScalingGroup) > 0 { + if len(response.ScalingGroups.ScalingGroup) > 0 { return response.ScalingGroups.ScalingGroup[0], nil } diff --git a/alicloud/table_alicloud_ecs_disk.go b/alicloud/table_alicloud_ecs_disk.go index 78d1273..a020c12 100644 --- a/alicloud/table_alicloud_ecs_disk.go +++ b/alicloud/table_alicloud_ecs_disk.go @@ -407,7 +407,7 @@ func getEcsDisk(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) return nil, serverErr } - if response.Disks.Disk != nil && len(response.Disks.Disk) > 0 { + if len(response.Disks.Disk) > 0 { return response.Disks.Disk[0], nil } @@ -435,7 +435,7 @@ func getEcsDiskAutoSnapshotPolicy(ctx context.Context, d *plugin.QueryData, h *p return nil, serverErr } - if response.AutoSnapshotPolicies.AutoSnapshotPolicy != nil && len(response.AutoSnapshotPolicies.AutoSnapshotPolicy) > 0 { + if len(response.AutoSnapshotPolicies.AutoSnapshotPolicy) > 0 { return response.AutoSnapshotPolicies.AutoSnapshotPolicy[0], nil } diff --git a/alicloud/table_alicloud_ecs_image.go b/alicloud/table_alicloud_ecs_image.go index 2751d35..e0bf515 100644 --- a/alicloud/table_alicloud_ecs_image.go +++ b/alicloud/table_alicloud_ecs_image.go @@ -292,7 +292,7 @@ func getEcsImage(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData return nil, serverErr } - if response.Images.Image != nil && len(response.Images.Image) > 0 { + if len(response.Images.Image) > 0 { return response.Images.Image[0], nil } diff --git a/alicloud/table_alicloud_ecs_instance.go b/alicloud/table_alicloud_ecs_instance.go index cec8b86..74ec3e2 100644 --- a/alicloud/table_alicloud_ecs_instance.go +++ b/alicloud/table_alicloud_ecs_instance.go @@ -633,7 +633,7 @@ func getEcsInstance(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateD return nil, serverErr } - if response.Instances.Instance != nil && len(response.Instances.Instance) > 0 { + if len(response.Instances.Instance) > 0 { return response.Instances.Instance[0], nil } diff --git a/alicloud/table_alicloud_ecs_key_pair.go b/alicloud/table_alicloud_ecs_key_pair.go index a986dde..ce4303c 100644 --- a/alicloud/table_alicloud_ecs_key_pair.go +++ b/alicloud/table_alicloud_ecs_key_pair.go @@ -159,7 +159,7 @@ func getEcsKeypair(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateDa return nil, serverErr } - if response.KeyPairs.KeyPair != nil && len(response.KeyPairs.KeyPair) > 0 { + if len(response.KeyPairs.KeyPair) > 0 { return response.KeyPairs.KeyPair[0], nil } diff --git a/alicloud/table_alicloud_ecs_luanch_template.go b/alicloud/table_alicloud_ecs_luanch_template.go index 7d302df..d95428c 100644 --- a/alicloud/table_alicloud_ecs_luanch_template.go +++ b/alicloud/table_alicloud_ecs_luanch_template.go @@ -184,7 +184,7 @@ func getEcsLaunchTemplate(ctx context.Context, d *plugin.QueryData, h *plugin.Hy return nil, err } - if response.LaunchTemplateSets.LaunchTemplateSet != nil && len(response.LaunchTemplateSets.LaunchTemplateSet) > 0 { + if len(response.LaunchTemplateSets.LaunchTemplateSet) > 0 { return response.LaunchTemplateSets.LaunchTemplateSet[0], nil } @@ -213,7 +213,7 @@ func getEcsLaunchTemplateLatestVersionDetails(ctx context.Context, d *plugin.Que return nil, err } - if response.LaunchTemplateVersionSets.LaunchTemplateVersionSet != nil && len(response.LaunchTemplateVersionSets.LaunchTemplateVersionSet) > 0 { + if len(response.LaunchTemplateVersionSets.LaunchTemplateVersionSet) > 0 { return response.LaunchTemplateVersionSets.LaunchTemplateVersionSet[0], nil } diff --git a/alicloud/table_alicloud_ecs_network_interface.go b/alicloud/table_alicloud_ecs_network_interface.go index 3a1542e..7cd27cd 100644 --- a/alicloud/table_alicloud_ecs_network_interface.go +++ b/alicloud/table_alicloud_ecs_network_interface.go @@ -250,7 +250,7 @@ func getEcsEni(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) return nil, serverErr } - if response.NetworkInterfaceSets.NetworkInterfaceSet != nil && len(response.NetworkInterfaceSets.NetworkInterfaceSet) > 0 { + if len(response.NetworkInterfaceSets.NetworkInterfaceSet) > 0 { return response.NetworkInterfaceSets.NetworkInterfaceSet[0], nil } From b170b94d0d703a6f4c422053c31f2b5a52a4986f Mon Sep 17 00:00:00 2001 From: ParthaI Date: Mon, 23 Sep 2024 17:02:53 +0530 Subject: [PATCH 4/8] Fixed the lint failure --- alicloud/table_alicloud_ecs_security_group.go | 2 +- alicloud/table_alicloud_ecs_snapshot.go | 2 +- alicloud/table_alicloud_kms_secret.go | 2 +- alicloud/table_alicloud_rds_instance.go | 4 ++-- alicloud/table_alicloud_slb_load_balancer.go | 2 +- alicloud/table_alicloud_vpc_eip.go | 2 +- alicloud/table_alicloud_vpc_flow_log.go | 2 +- alicloud/table_alicloud_vpc_nat_gateway.go | 2 +- alicloud/table_alicloud_vpc_route_table.go | 2 +- alicloud/table_alicloud_vpc_ssl_vpn_server.go | 2 +- alicloud/table_alicloud_vpc_vpn_connection.go | 2 +- alicloud/table_alicloud_vpc_vpn_customer_gateway.go | 2 +- alicloud/table_alicloud_vpc_vpn_gateway.go | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/alicloud/table_alicloud_ecs_security_group.go b/alicloud/table_alicloud_ecs_security_group.go index 4eff735..f980a89 100644 --- a/alicloud/table_alicloud_ecs_security_group.go +++ b/alicloud/table_alicloud_ecs_security_group.go @@ -203,7 +203,7 @@ func getEcsSecurityGroup(ctx context.Context, d *plugin.QueryData, h *plugin.Hyd return nil, err } - if response.SecurityGroups.SecurityGroup != nil && len(response.SecurityGroups.SecurityGroup) > 0 { + if len(response.SecurityGroups.SecurityGroup) > 0 { return response.SecurityGroups.SecurityGroup[0], nil } diff --git a/alicloud/table_alicloud_ecs_snapshot.go b/alicloud/table_alicloud_ecs_snapshot.go index 3c409a5..0a13e43 100644 --- a/alicloud/table_alicloud_ecs_snapshot.go +++ b/alicloud/table_alicloud_ecs_snapshot.go @@ -256,7 +256,7 @@ func getEcsSnapshot(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateD return nil, serverErr } - if response.Snapshots.Snapshot != nil && len(response.Snapshots.Snapshot) > 0 { + if len(response.Snapshots.Snapshot) > 0 { return response.Snapshots.Snapshot[0], nil } diff --git a/alicloud/table_alicloud_kms_secret.go b/alicloud/table_alicloud_kms_secret.go index a655cb7..d19b014 100644 --- a/alicloud/table_alicloud_kms_secret.go +++ b/alicloud/table_alicloud_kms_secret.go @@ -298,7 +298,7 @@ func listKmsSecretVersionIds(ctx context.Context, d *plugin.QueryData, h *plugin return nil, err } - if response.VersionIds.VersionId != nil && len(response.VersionIds.VersionId) > 0 { + if len(response.VersionIds.VersionId) > 0 { return response.VersionIds, nil } diff --git a/alicloud/table_alicloud_rds_instance.go b/alicloud/table_alicloud_rds_instance.go index dc805e8..6232330 100644 --- a/alicloud/table_alicloud_rds_instance.go +++ b/alicloud/table_alicloud_rds_instance.go @@ -637,7 +637,7 @@ func getRdsInstance(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateD return nil, err } - if response.Items.DBInstanceAttribute != nil && len(response.Items.DBInstanceAttribute) > 0 { + if len(response.Items.DBInstanceAttribute) > 0 { if response.Items.DBInstanceAttribute[0].RegionId == region { return response.Items.DBInstanceAttribute[0], nil } @@ -667,7 +667,7 @@ func getRdsInstanceIPArrayList(ctx context.Context, d *plugin.QueryData, h *plug return nil, err } - if response.Items.DBInstanceIPArray != nil && len(response.Items.DBInstanceIPArray) > 0 { + if len(response.Items.DBInstanceIPArray) > 0 { return response, nil } diff --git a/alicloud/table_alicloud_slb_load_balancer.go b/alicloud/table_alicloud_slb_load_balancer.go index dec76d3..aa9c22e 100644 --- a/alicloud/table_alicloud_slb_load_balancer.go +++ b/alicloud/table_alicloud_slb_load_balancer.go @@ -313,7 +313,7 @@ func getSlbLoadBalancer(ctx context.Context, d *plugin.QueryData, h *plugin.Hydr return nil, err } - if response.LoadBalancers.LoadBalancer != nil && len(response.LoadBalancers.LoadBalancer) > 0 { + if len(response.LoadBalancers.LoadBalancer) > 0 { if response.LoadBalancers.LoadBalancer[0].RegionId == region { return response.LoadBalancers.LoadBalancer[0], nil } diff --git a/alicloud/table_alicloud_vpc_eip.go b/alicloud/table_alicloud_vpc_eip.go index ba41456..a076202 100644 --- a/alicloud/table_alicloud_vpc_eip.go +++ b/alicloud/table_alicloud_vpc_eip.go @@ -261,7 +261,7 @@ func getEip(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (in return nil, err } - if response.EipAddresses.EipAddress != nil && len(response.EipAddresses.EipAddress) > 0 { + if len(response.EipAddresses.EipAddress) > 0 { return response.EipAddresses.EipAddress[0], nil } return nil, nil diff --git a/alicloud/table_alicloud_vpc_flow_log.go b/alicloud/table_alicloud_vpc_flow_log.go index c4ea6dd..cae9ae3 100644 --- a/alicloud/table_alicloud_vpc_flow_log.go +++ b/alicloud/table_alicloud_vpc_flow_log.go @@ -200,7 +200,7 @@ func getVpcFlowLog(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateDa return nil, err } - if response.FlowLogs.FlowLog != nil && len(response.FlowLogs.FlowLog) > 0 { + if len(response.FlowLogs.FlowLog) > 0 { return response.FlowLogs.FlowLog[0], nil } diff --git a/alicloud/table_alicloud_vpc_nat_gateway.go b/alicloud/table_alicloud_vpc_nat_gateway.go index cf372c0..a4d5fe4 100644 --- a/alicloud/table_alicloud_vpc_nat_gateway.go +++ b/alicloud/table_alicloud_vpc_nat_gateway.go @@ -221,7 +221,7 @@ func getVpcNatGateway(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrat return nil, err } - if response.NatGateways.NatGateway != nil && len(response.NatGateways.NatGateway) > 0 { + if len(response.NatGateways.NatGateway) > 0 { return response.NatGateways.NatGateway[0], nil } diff --git a/alicloud/table_alicloud_vpc_route_table.go b/alicloud/table_alicloud_vpc_route_table.go index 9c03b60..5c38a61 100644 --- a/alicloud/table_alicloud_vpc_route_table.go +++ b/alicloud/table_alicloud_vpc_route_table.go @@ -197,7 +197,7 @@ func getVpcRouteTable(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrat return nil, err } - if response.RouterTableList.RouterTableListType != nil && len(response.RouterTableList.RouterTableListType) > 0 { + if len(response.RouterTableList.RouterTableListType) > 0 { return response.RouterTableList.RouterTableListType[0], nil } diff --git a/alicloud/table_alicloud_vpc_ssl_vpn_server.go b/alicloud/table_alicloud_vpc_ssl_vpn_server.go index 734a811..96b7b41 100644 --- a/alicloud/table_alicloud_vpc_ssl_vpn_server.go +++ b/alicloud/table_alicloud_vpc_ssl_vpn_server.go @@ -197,7 +197,7 @@ func getVpnSslServer(ctx context.Context, d *plugin.QueryData, h *plugin.Hydrate return nil, serverErr } - if response.SslVpnServers.SslVpnServer != nil && len(response.SslVpnServers.SslVpnServer) > 0 { + if len(response.SslVpnServers.SslVpnServer) > 0 { return response.SslVpnServers.SslVpnServer[0], nil } diff --git a/alicloud/table_alicloud_vpc_vpn_connection.go b/alicloud/table_alicloud_vpc_vpn_connection.go index 0a18c6b..1cd1e5e 100644 --- a/alicloud/table_alicloud_vpc_vpn_connection.go +++ b/alicloud/table_alicloud_vpc_vpn_connection.go @@ -213,7 +213,7 @@ func getVpcVpnConnection(ctx context.Context, d *plugin.QueryData, h *plugin.Hyd return nil, err } - if response.VpnConnections.VpnConnection != nil && len(response.VpnConnections.VpnConnection) > 0 { + if len(response.VpnConnections.VpnConnection) > 0 { return response.VpnConnections.VpnConnection[0], nil } diff --git a/alicloud/table_alicloud_vpc_vpn_customer_gateway.go b/alicloud/table_alicloud_vpc_vpn_customer_gateway.go index fe11d6c..75e8d4a 100644 --- a/alicloud/table_alicloud_vpc_vpn_customer_gateway.go +++ b/alicloud/table_alicloud_vpc_vpn_customer_gateway.go @@ -146,7 +146,7 @@ func getVpcCustomerGateway(ctx context.Context, d *plugin.QueryData, _ *plugin.H return nil, err } - if response.CustomerGateways.CustomerGateway != nil && len(response.CustomerGateways.CustomerGateway) > 0 { + if len(response.CustomerGateways.CustomerGateway) > 0 { return response.CustomerGateways.CustomerGateway[0], nil } diff --git a/alicloud/table_alicloud_vpc_vpn_gateway.go b/alicloud/table_alicloud_vpc_vpn_gateway.go index e7d76d3..60ddb34 100644 --- a/alicloud/table_alicloud_vpc_vpn_gateway.go +++ b/alicloud/table_alicloud_vpc_vpn_gateway.go @@ -227,7 +227,7 @@ func getVpcVpnGateway(ctx context.Context, d *plugin.QueryData, _ *plugin.Hydrat return nil, err } - if response.VpnGateways.VpnGateway != nil && len(response.VpnGateways.VpnGateway) > 0 { + if len(response.VpnGateways.VpnGateway) > 0 { return response.VpnGateways.VpnGateway[0], nil } return nil, nil From 7c2002e2a0673c40b749cd0000c7889f2b38ece9 Mon Sep 17 00:00:00 2001 From: ParthaI Date: Tue, 24 Sep 2024 11:29:03 +0530 Subject: [PATCH 5/8] Tidy up --- alicloud/service.go | 1 - 1 file changed, 1 deletion(-) diff --git a/alicloud/service.go b/alicloud/service.go index f1e3b65..09df4d0 100644 --- a/alicloud/service.go +++ b/alicloud/service.go @@ -605,7 +605,6 @@ func getCredentialConfigByProfile(profile string, d *plugin.QueryData) (*Credent // Or // The authentication mode of the profile is not AK | RamRoleArn | StsToken | EcsRamRole As these are the supported type by ALicloud CLI. // https://github.com/aliyun/aliyun-cli/blob/master/README.md#configure-authentication-methods - // credsProvider := credentials.NewCLIProfileCredentialsProviderBuilder().Build(). creds := credentials.NewCLIProfileCredentialsProviderBuilder().WithProfileName(profile).Build() From 024462b6a02cff725494317e17197987c557aeb8 Mon Sep 17 00:00:00 2001 From: ParthaI Date: Tue, 24 Sep 2024 13:12:58 +0530 Subject: [PATCH 6/8] Update terraform configuration --- .../alicloud_cas_certificate/variables.tf | 8 +-- .../variables.tf | 64 ++++++++++++++++--- .../variables.tf | 51 ++++++++++++--- alicloud/service.go | 2 +- alicloud/table_alicloud_action_trail.go | 8 +-- 5 files changed, 104 insertions(+), 29 deletions(-) diff --git a/alicloud-test/tests/alicloud_cas_certificate/variables.tf b/alicloud-test/tests/alicloud_cas_certificate/variables.tf index 486cd92..df81eb0 100644 --- a/alicloud-test/tests/alicloud_cas_certificate/variables.tf +++ b/alicloud-test/tests/alicloud_cas_certificate/variables.tf @@ -48,13 +48,13 @@ resource "tls_self_signed_cert" "example" { # Add a new Certificate. resource "alicloud_cas_certificate" "named_test_resource" { - name = var.resource_name - cert = tls_self_signed_cert.example.cert_pem - key = tls_private_key.example.private_key_pem + certificate_name = var.resource_name + cert = tls_self_signed_cert.example.cert_pem + key = tls_private_key.example.private_key_pem } output "private_key" { - value = replace(tls_private_key.example.private_key_pem, "\n", "\\n") + value = replace(tls_private_key.example.private_key_pem, "\n", "\\n") sensitive = true } diff --git a/alicloud-test/tests/alicloud_cs_kubernetes_cluster/variables.tf b/alicloud-test/tests/alicloud_cs_kubernetes_cluster/variables.tf index ca72776..496b3c5 100644 --- a/alicloud-test/tests/alicloud_cs_kubernetes_cluster/variables.tf +++ b/alicloud-test/tests/alicloud_cs_kubernetes_cluster/variables.tf @@ -36,17 +36,61 @@ resource "alicloud_vswitch" "named_test_resource" { zone_id = "us-east-1b" } +# resource "alicloud_cs_managed_kubernetes" "named_test_resource" { +# name = var.resource_name +# count = 1 +# cluster_spec = "ack.standard" +# is_enterprise_security_group = true +# worker_number = 2 +# password = "Hello1234" +# pod_cidr = "172.20.0.0/16" +# service_cidr = "172.21.0.0/20" +# worker_vswitch_ids = [alicloud_vswitch.named_test_resource.id] +# worker_instance_types = ["ecs.c5.large"] +# } + resource "alicloud_cs_managed_kubernetes" "named_test_resource" { - name = var.resource_name - count = 1 - cluster_spec = "ack.standard" - is_enterprise_security_group = true - worker_number = 2 - password = "Hello1234" - pod_cidr = "172.20.0.0/16" - service_cidr = "172.21.0.0/20" - worker_vswitch_ids = [alicloud_vswitch.named_test_resource.id] - worker_instance_types = ["ecs.c5.large"] + name = var.name + cluster_spec = "ack.pro.small" + # version can not be defined in variables.tf. + # version = "1.26.3-aliyun.1" + worker_vswitch_ids = [alicloud_vswitch.named_test_resource.id] + new_nat_gateway = true + proxy_mode = "ipvs" + service_cidr = "192.168.0.0/16" + + addons { + name = "terway-eniip" + } + addons { + name = "csi-plugin" + } + addons { + name = "csi-provisioner" + } + addons { + name = "logtail-ds" + config = jsonencode({ + IngressDashboardEnabled = "true" + }) + } + addons { + name = "nginx-ingress-controller" + config = jsonencode({ + IngressSlbNetworkType = "internet" + }) + # to disable install nginx-ingress-controller automatically + # disabled = true + } + addons { + name = "arms-prometheus" + } + addons { + name = "ack-node-problem-detector" + config = jsonencode({ + # sls_project_name = "your-sls-project" + }) + } } output "cluster_id" { diff --git a/alicloud-test/tests/alicloud_cs_kubernetes_cluster_node/variables.tf b/alicloud-test/tests/alicloud_cs_kubernetes_cluster_node/variables.tf index 86a65f9..bba896a 100644 --- a/alicloud-test/tests/alicloud_cs_kubernetes_cluster_node/variables.tf +++ b/alicloud-test/tests/alicloud_cs_kubernetes_cluster_node/variables.tf @@ -36,16 +36,47 @@ resource "alicloud_vswitch" "named_test_resource" { } resource "alicloud_cs_managed_kubernetes" "named_test_resource" { - name = var.resource_name - count = 1 - cluster_spec = "ack.standard" - is_enterprise_security_group = true - worker_number = 3 - password = "Hello1234" - pod_cidr = "172.20.0.0/16" - service_cidr = "172.21.0.0/20" - worker_vswitch_ids = [alicloud_vswitch.named_test_resource.id] - worker_instance_types = ["ecs.c5.large"] + name = var.name + cluster_spec = "ack.pro.small" + # version can not be defined in variables.tf. + # version = "1.26.3-aliyun.1" + worker_vswitch_ids = [alicloud_vswitch.named_test_resource.id] + new_nat_gateway = true + proxy_mode = "ipvs" + service_cidr = "192.168.0.0/16" + + addons { + name = "terway-eniip" + } + addons { + name = "csi-plugin" + } + addons { + name = "csi-provisioner" + } + addons { + name = "logtail-ds" + config = jsonencode({ + IngressDashboardEnabled = "true" + }) + } + addons { + name = "nginx-ingress-controller" + config = jsonencode({ + IngressSlbNetworkType = "internet" + }) + # to disable install nginx-ingress-controller automatically + # disabled = true + } + addons { + name = "arms-prometheus" + } + addons { + name = "ack-node-problem-detector" + config = jsonencode({ + # sls_project_name = "your-sls-project" + }) + } } output "cluster_id" { diff --git a/alicloud/service.go b/alicloud/service.go index 09df4d0..2a978b5 100644 --- a/alicloud/service.go +++ b/alicloud/service.go @@ -599,7 +599,7 @@ func getProfileConfigurations(_ context.Context, d *plugin.QueryData) (*Credenti func getCredentialConfigByProfile(profile string, d *plugin.QueryData) (*CredentialConfig, error) { defaultRegion := GetDefaultRegion(d.Connection) - defaultConfig := sdk.NewConfig() + defaultConfig := sdk.NewConfig().WithScheme("HTTPS") // We will get a nil value if the specified profile is not available // Or diff --git a/alicloud/table_alicloud_action_trail.go b/alicloud/table_alicloud_action_trail.go index 3376d29..1a4f6a3 100644 --- a/alicloud/table_alicloud_action_trail.go +++ b/alicloud/table_alicloud_action_trail.go @@ -61,7 +61,7 @@ func tableAlicloudActionTrail(ctx context.Context) *plugin.Table { Name: "create_time", Description: "The time when the trail was created.", Type: proto.ColumnType_TIMESTAMP, - Transform: transform.FromField("CreateTime").Transform(transform.UnixMsToTimestamp), + Transform: transform.FromField("CreateTime").Transform(transform.NullIfZeroValue), }, { Name: "event_rw", @@ -88,13 +88,13 @@ func tableAlicloudActionTrail(ctx context.Context) *plugin.Table { Name: "start_logging_time", Description: "The most recent date and time when logging was enabled for the trail.", Type: proto.ColumnType_TIMESTAMP, - Transform: transform.FromField("StartLoggingTime").Transform(transform.UnixMsToTimestamp), + Transform: transform.FromField("StartLoggingTime").Transform(transform.NullIfZeroValue), }, { Name: "stop_logging_time", Description: "The most recent date and time when logging was disabled for the trail.", Type: proto.ColumnType_TIMESTAMP, - Transform: transform.FromField("StopLoggingTime").Transform(transform.NullIfZeroValue).Transform(transform.UnixMsToTimestamp), + Transform: transform.FromField("StopLoggingTime").Transform(transform.NullIfZeroValue), }, { Name: "trail_region", @@ -105,7 +105,7 @@ func tableAlicloudActionTrail(ctx context.Context) *plugin.Table { Name: "update_time", Description: "The most recent time when the configuration of the trail was updated.", Type: proto.ColumnType_TIMESTAMP, - Transform: transform.FromField("UpdateTime").Transform(transform.UnixMsToTimestamp), + Transform: transform.FromField("UpdateTime").Transform(transform.NullIfZeroValue), }, // Steampipe standard columns From 022d1f12e961b49a181930ab87cc18da5592f245 Mon Sep 17 00:00:00 2001 From: ParthaI Date: Tue, 24 Sep 2024 17:18:18 +0530 Subject: [PATCH 7/8] Update the config to provice the connection time out input while making the API call --- alicloud-test/tint.js | 2 +- alicloud/connection_config.go | 3 +++ alicloud/service.go | 22 ++++++++++++++++++++++ config/alicloud.spc | 10 ++++++++++ docs/index.md | 10 ++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) diff --git a/alicloud-test/tint.js b/alicloud-test/tint.js index 1c1d3b7..d9e752a 100755 --- a/alicloud-test/tint.js +++ b/alicloud-test/tint.js @@ -384,7 +384,7 @@ const _runGraphqlQuery = function (test, query) { return new Promise((resolve, reject) => { try { var queryTmp = _renderToTmp(test, query.query); - var variablesTmp = _renderToTmp(test, query.variables, {}); + // var variablesTmp = _renderToTmp(test, query.variables, {}); var expectedTmp = _renderToTmp(test, query.expected); } catch (e) { console.log(chalk.red(`Template Error: ${e.sourcePath}`)); diff --git a/alicloud/connection_config.go b/alicloud/connection_config.go index 7d12c1e..245a603 100644 --- a/alicloud/connection_config.go +++ b/alicloud/connection_config.go @@ -10,6 +10,9 @@ type alicloudConfig struct { SecretKey *string `hcl:"secret_key"` IgnoreErrorCodes []string `hcl:"ignore_error_codes,optional"` Profile *string `hcl:"profile"` + AutoRetry *bool `hcl:"auto_retry,optional"` + MaxRetryTime *int `hcl:"max_retry_time,optional"` + Timeout *int `hcl:"timeout,optional"` } func ConfigInstance() interface{} { diff --git a/alicloud/service.go b/alicloud/service.go index 2a978b5..3c02f54 100644 --- a/alicloud/service.go +++ b/alicloud/service.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "os" + "time" "github.com/aliyun/alibaba-cloud-sdk-go/sdk" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth" @@ -600,6 +601,17 @@ func getProfileConfigurations(_ context.Context, d *plugin.QueryData) (*Credenti func getCredentialConfigByProfile(profile string, d *plugin.QueryData) (*CredentialConfig, error) { defaultRegion := GetDefaultRegion(d.Connection) defaultConfig := sdk.NewConfig().WithScheme("HTTPS") + config := GetConfig(d.Connection) + + if config.AutoRetry != nil { + defaultConfig = defaultConfig.WithAutoRetry(*config.AutoRetry) + } + if config.MaxRetryTime != nil { + defaultConfig = defaultConfig.WithMaxRetryTime(*config.MaxRetryTime) + } + if config.Timeout != nil { + defaultConfig = defaultConfig.WithTimeout(time.Duration(*config.Timeout) * time.Second) + } // We will get a nil value if the specified profile is not available // Or @@ -621,6 +633,16 @@ func getCredentialSessionUncached(ctx context.Context, d *plugin.QueryData, h *p defaultRegion := GetDefaultRegion(d.Connection) defaultConfig := sdk.NewConfig() // initialize with default config + if config.AutoRetry != nil { + defaultConfig = defaultConfig.WithAutoRetry(*config.AutoRetry) + } + if config.MaxRetryTime != nil { + defaultConfig = defaultConfig.WithMaxRetryTime(*config.MaxRetryTime) + } + if config.Timeout != nil { + defaultConfig = defaultConfig.WithTimeout(time.Duration(*config.Timeout) * time.Second) + } + // Profile based client if config.Profile != nil { return getProfileConfigurations(ctx, d) diff --git a/config/alicloud.spc b/config/alicloud.spc index e4756c0..98eb44e 100644 --- a/config/alicloud.spc +++ b/config/alicloud.spc @@ -21,6 +21,16 @@ connection "alicloud" { # access_key = "LTAI4GBVFakeKey09Kxezv66" # secret_key = "6iNPvThisIsNotARealSecretk1sZF" + # Disable automatic reconnection (true/false). Defaults to false. + # auto_retry = false + + # The maximum number of attempts (including the initial call) Steampipe will + # make for failing API calls. Defaults to 3 and must be greater than or equal to 1. + # max_retry_time = 3 + + # Timeout for API requests in seconds. Defaults to 10 second. + # timeout = 10 + # List of additional Alicloud error codes to ignore for all queries. # By default, common not found error codes are ignored and will still be ignored even if this argument is not set. # ignore_error_codes = ["AccessDenied", "Forbidden.Access", "Forbidden.NoPermission"] diff --git a/docs/index.md b/docs/index.md index 86fd0d5..62c67d2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -92,6 +92,16 @@ connection "alicloud" { # access_key = "LTAI4GBVFakeKey09Kxezv66" # secret_key = "6iNPvThisIsNotARealSecretk1sZF" + # Disable automatic reconnection (true/false). Defaults to false. + # auto_retry = false + + # The maximum number of attempts (including the initial call) Steampipe will + # make for failing API calls. Defaults to 3 and must be greater than or equal to 1. + # max_retry_time = 3 + + # Timeout for API requests in seconds. Defaults to 10 second. + # timeout = 10 + # List of additional Alicloud error codes to ignore for all queries. # By default, common not found error codes are ignored and will still be ignored even if this argument is not set. # ignore_error_codes = ["AccessDenied", "Forbidden.Access", "Forbidden.NoPermission"] From 33c1e3464c8c394bd6b21377625e52a10668f116 Mon Sep 17 00:00:00 2001 From: ParthaI Date: Tue, 24 Sep 2024 18:02:19 +0530 Subject: [PATCH 8/8] Made changes based on tf configuration --- alicloud-test/tests/alicloud_cas_certificate/variables.tf | 2 +- .../tests/alicloud_cms_monitor_host/variables.tf | 2 +- .../tests/alicloud_cs_kubernetes_cluster/variables.tf | 6 +++--- .../alicloud_cs_kubernetes_cluster_node/variables.tf | 8 ++++---- alicloud-test/tests/alicloud_kms_key/test-get-query.sql | 2 +- .../tests/alicloud_kms_key/test-hydrate-query.sql | 2 +- alicloud-test/tests/alicloud_kms_key/variables.tf | 4 ++++ alicloud-test/tests/alicloud_vpc_network_acl/variables.tf | 2 +- alicloud/table_alicloud_kms_key.go | 2 +- alicloud/table_alicloud_kms_secret.go | 2 +- 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/alicloud-test/tests/alicloud_cas_certificate/variables.tf b/alicloud-test/tests/alicloud_cas_certificate/variables.tf index df81eb0..4e48ad2 100644 --- a/alicloud-test/tests/alicloud_cas_certificate/variables.tf +++ b/alicloud-test/tests/alicloud_cas_certificate/variables.tf @@ -8,7 +8,7 @@ variable "resource_name" { # The Cas Certificate region only support cn-hangzhou, ap-south-1, me-east-1, eu-central-1, ap-northeast-1, ap-southeast-2. variable "alicloud_region" { type = string - default = "ap-south-1" + default = "cn-hangzhou" description = "Alicloud region used for the test." } diff --git a/alicloud-test/tests/alicloud_cms_monitor_host/variables.tf b/alicloud-test/tests/alicloud_cms_monitor_host/variables.tf index 6eb81da..c928a74 100644 --- a/alicloud-test/tests/alicloud_cms_monitor_host/variables.tf +++ b/alicloud-test/tests/alicloud_cms_monitor_host/variables.tf @@ -45,7 +45,7 @@ resource "alicloud_cs_managed_kubernetes" "named_test_resource" { pod_cidr = "172.20.0.0/16" service_cidr = "172.21.0.0/20" worker_vswitch_ids = [alicloud_vswitch.named_test_resource.id] - worker_instance_types = ["ecs.c5.large"] + instance_types = ["ecs.c5.large"] } output "cluster_id" { diff --git a/alicloud-test/tests/alicloud_cs_kubernetes_cluster/variables.tf b/alicloud-test/tests/alicloud_cs_kubernetes_cluster/variables.tf index 496b3c5..06e63b4 100644 --- a/alicloud-test/tests/alicloud_cs_kubernetes_cluster/variables.tf +++ b/alicloud-test/tests/alicloud_cs_kubernetes_cluster/variables.tf @@ -50,7 +50,7 @@ resource "alicloud_vswitch" "named_test_resource" { # } resource "alicloud_cs_managed_kubernetes" "named_test_resource" { - name = var.name + name = var.resource_name cluster_spec = "ack.pro.small" # version can not be defined in variables.tf. # version = "1.26.3-aliyun.1" @@ -94,7 +94,7 @@ resource "alicloud_cs_managed_kubernetes" "named_test_resource" { } output "cluster_id" { - value = alicloud_cs_managed_kubernetes.named_test_resource[0].id + value = alicloud_cs_managed_kubernetes.named_test_resource.id } output "resource_name" { @@ -106,5 +106,5 @@ output "region" { } output "resource_aka" { - value = "arn:acs:cs:${var.alicloud_region}:${data.alicloud_caller_identity.current.account_id}:cluster/${alicloud_cs_managed_kubernetes.named_test_resource[0].id}" + value = "arn:acs:cs:${var.alicloud_region}:${data.alicloud_caller_identity.current.account_id}:cluster/${alicloud_cs_managed_kubernetes.named_test_resource.id}" } diff --git a/alicloud-test/tests/alicloud_cs_kubernetes_cluster_node/variables.tf b/alicloud-test/tests/alicloud_cs_kubernetes_cluster_node/variables.tf index bba896a..6e7ce85 100644 --- a/alicloud-test/tests/alicloud_cs_kubernetes_cluster_node/variables.tf +++ b/alicloud-test/tests/alicloud_cs_kubernetes_cluster_node/variables.tf @@ -36,7 +36,7 @@ resource "alicloud_vswitch" "named_test_resource" { } resource "alicloud_cs_managed_kubernetes" "named_test_resource" { - name = var.name + name = var.resource_name cluster_spec = "ack.pro.small" # version can not be defined in variables.tf. # version = "1.26.3-aliyun.1" @@ -80,15 +80,15 @@ resource "alicloud_cs_managed_kubernetes" "named_test_resource" { } output "cluster_id" { - value = alicloud_cs_managed_kubernetes.named_test_resource[0].id + value = alicloud_cs_managed_kubernetes.named_test_resource.id } output "instance_id" { - value = alicloud_cs_managed_kubernetes.named_test_resource[0].worker_nodes[0].id + value = alicloud_cs_managed_kubernetes.named_test_resource.worker_nodes[0].id } output "ip_address" { - value = alicloud_cs_managed_kubernetes.named_test_resource[0].worker_nodes[0].private_ip + value = alicloud_cs_managed_kubernetes.named_test_resource.worker_nodes[0].private_ip } output "resource_name" { diff --git a/alicloud-test/tests/alicloud_kms_key/test-get-query.sql b/alicloud-test/tests/alicloud_kms_key/test-get-query.sql index 2510d96..656c3b5 100644 --- a/alicloud-test/tests/alicloud_kms_key/test-get-query.sql +++ b/alicloud-test/tests/alicloud_kms_key/test-get-query.sql @@ -14,4 +14,4 @@ select from alicloud_kms_key where - key_id = '{{ output.resource_id.value }}'; + key_id = '{{ output.resource_id.value }}' and region = '{{ output.region.value }}'; diff --git a/alicloud-test/tests/alicloud_kms_key/test-hydrate-query.sql b/alicloud-test/tests/alicloud_kms_key/test-hydrate-query.sql index 6281de2..0a4d213 100644 --- a/alicloud-test/tests/alicloud_kms_key/test-hydrate-query.sql +++ b/alicloud-test/tests/alicloud_kms_key/test-hydrate-query.sql @@ -1,3 +1,3 @@ select key_id, key_aliases from alicloud_kms_key -where key_id = '{{ output.resource_id.value }}'; \ No newline at end of file +where key_id = '{{ output.resource_id.value }}' and region = '{{ output.region.value }}';; \ No newline at end of file diff --git a/alicloud-test/tests/alicloud_kms_key/variables.tf b/alicloud-test/tests/alicloud_kms_key/variables.tf index 587fbc7..5a98415 100644 --- a/alicloud-test/tests/alicloud_kms_key/variables.tf +++ b/alicloud-test/tests/alicloud_kms_key/variables.tf @@ -71,6 +71,10 @@ output "resource_name" { value = var.resource_name } +output "region" { + value = var.alicloud_region +} + output "account_id" { value = data.alicloud_caller_identity.current.account_id } diff --git a/alicloud-test/tests/alicloud_vpc_network_acl/variables.tf b/alicloud-test/tests/alicloud_vpc_network_acl/variables.tf index 791cdb2..d6a58d3 100644 --- a/alicloud-test/tests/alicloud_vpc_network_acl/variables.tf +++ b/alicloud-test/tests/alicloud_vpc_network_acl/variables.tf @@ -7,7 +7,7 @@ variable "resource_name" { variable "alicloud_region" { type = string - default = "ap-south-1" + default = "us-east-1" description = "Alicloud region used for the test." } diff --git a/alicloud/table_alicloud_kms_key.go b/alicloud/table_alicloud_kms_key.go index 480411d..440c05d 100644 --- a/alicloud/table_alicloud_kms_key.go +++ b/alicloud/table_alicloud_kms_key.go @@ -21,7 +21,7 @@ func tableAlicloudKmsKey(ctx context.Context) *plugin.Table { Name: "alicloud_kms_key", Description: "Alicloud KMS Key", Get: &plugin.GetConfig{ - KeyColumns: plugin.SingleColumn("key_id"), + KeyColumns: plugin.AllColumns([]string{"key_id", "region"}), IgnoreConfig: &plugin.IgnoreConfig{ ShouldIgnoreErrorFunc: isNotFoundError([]string{"EntityNotExist.Key", "Forbidden.KeyNotFound"}), }, diff --git a/alicloud/table_alicloud_kms_secret.go b/alicloud/table_alicloud_kms_secret.go index d19b014..f6ea673 100644 --- a/alicloud/table_alicloud_kms_secret.go +++ b/alicloud/table_alicloud_kms_secret.go @@ -25,7 +25,7 @@ func tableAlicloudKmsSecret(ctx context.Context) *plugin.Table { Hydrate: listKmsSecret, }, Get: &plugin.GetConfig{ - KeyColumns: plugin.SingleColumn("name"), + KeyColumns: plugin.AllColumns([]string{"name", "region"}), Hydrate: getKmsSecret, }, GetMatrixItemFunc: BuildRegionList,