diff --git a/internal/resources/cloud/resource_cloud_stack_service_account_token.go b/internal/resources/cloud/resource_cloud_stack_service_account_token.go index 0dfd5504d..398ab4740 100644 --- a/internal/resources/cloud/resource_cloud_stack_service_account_token.go +++ b/internal/resources/cloud/resource_cloud_stack_service_account_token.go @@ -94,7 +94,7 @@ func stackServiceAccountTokenCreate(ctx context.Context, d *schema.ResourceData, req := gcom.PostInstanceServiceAccountTokensRequest{ Name: d.Get("name").(string), - SecondsToLive: common.Ref(d.Get("seconds_to_live").(int32)), + SecondsToLive: common.Ref(int32(d.Get("seconds_to_live").(int))), //nolint:gosec } resp, _, err := cloudClient.InstancesAPI.PostInstanceServiceAccountTokens(ctx, stackSlug, strconv.FormatInt(serviceAccountID, 10)). diff --git a/internal/resources/machinelearning/resource_job.go b/internal/resources/machinelearning/resource_job.go index c5042c322..46bc3c6ba 100644 --- a/internal/resources/machinelearning/resource_job.go +++ b/internal/resources/machinelearning/resource_job.go @@ -190,11 +190,11 @@ func makeMLJob(d *schema.ResourceData, meta interface{}) (mlapi.Job, error) { DatasourceUID: d.Get("datasource_uid").(string), DatasourceType: d.Get("datasource_type").(string), QueryParams: d.Get("query_params").(map[string]interface{}), - Interval: d.Get("interval").(uint), + Interval: uint(d.Get("interval").(int)), //nolint:gosec Algorithm: "grafana_prophet_1_0_1", HyperParams: d.Get("hyper_params").(map[string]interface{}), CustomLabels: d.Get("custom_labels").(map[string]interface{}), - TrainingWindow: d.Get("training_window").(uint), + TrainingWindow: uint(d.Get("training_window").(int)), //nolint:gosec TrainingFrequency: uint(24 * time.Hour / time.Second), Holidays: common.ListToStringSlice(d.Get("holidays").([]interface{})), }, nil diff --git a/internal/resources/machinelearning/resource_outlier_detector.go b/internal/resources/machinelearning/resource_outlier_detector.go index fefc339e8..73872b655 100644 --- a/internal/resources/machinelearning/resource_outlier_detector.go +++ b/internal/resources/machinelearning/resource_outlier_detector.go @@ -239,7 +239,7 @@ func makeMLOutlier(d *schema.ResourceData, meta interface{}) (mlapi.OutlierDetec DatasourceUID: d.Get("datasource_uid").(string), DatasourceType: d.Get("datasource_type").(string), QueryParams: d.Get("query_params").(map[string]interface{}), - Interval: d.Get("interval").(uint), + Interval: uint(d.Get("interval").(int)), //nolint:gosec Algorithm: algorithm, }, nil } diff --git a/internal/resources/syntheticmonitoring/resource_check.go b/internal/resources/syntheticmonitoring/resource_check.go index 0744539c1..d54920f39 100644 --- a/internal/resources/syntheticmonitoring/resource_check.go +++ b/internal/resources/syntheticmonitoring/resource_check.go @@ -1430,7 +1430,7 @@ func makeCheckSettings(settings map[string]interface{}) (sm.CheckSettings, error IpVersion: sm.IpVersion(sm.IpVersion_value[d["ip_version"].(string)]), SourceIpAddress: d["source_ip_address"].(string), Server: d["server"].(string), - Port: d["port"].(int32), + Port: int32(d["port"].(int)), //nolint:gosec RecordType: sm.DnsRecordType(sm.DnsRecordType_value[d["record_type"].(string)]), Protocol: sm.DnsProtocol(sm.DnsProtocol_value[d["protocol"].(string)]), ValidRCodes: common.SetToStringSlice(d["valid_r_codes"].(*schema.Set)), @@ -1485,7 +1485,7 @@ func makeCheckSettings(settings map[string]interface{}) (sm.CheckSettings, error } if h["valid_status_codes"].(*schema.Set).Len() > 0 { for _, v := range h["valid_status_codes"].(*schema.Set).List() { - cs.Http.ValidStatusCodes = append(cs.Http.ValidStatusCodes, v.(int32)) + cs.Http.ValidStatusCodes = append(cs.Http.ValidStatusCodes, int32(v.(int))) //nolint:gosec } } headerMatch := func(hms *schema.Set) []sm.HeaderMatch {