diff --git a/resources/services/accessanalyzer/analyzers.go b/resources/services/accessanalyzer/analyzers.go index b36103568..2f756ead7 100644 --- a/resources/services/accessanalyzer/analyzers.go +++ b/resources/services/accessanalyzer/analyzers.go @@ -270,9 +270,7 @@ func fetchAccessAnalyzerAnalyzerFindings(ctx context.Context, meta schema.Client AnalyzerArn: analyzer.Arn, } for { - response, err := svc.ListFindings(ctx, &config, func(options *accessanalyzer.Options) { - options.Region = c.Region - }) + response, err := svc.ListFindings(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -298,9 +296,7 @@ func fetchAccessAnalyzerAnalyzerArchiveRules(ctx context.Context, meta schema.Cl AnalyzerName: analyzer.Name, } for { - response, err := svc.ListArchiveRules(ctx, &config, func(options *accessanalyzer.Options) { - options.Region = c.Region - }) + response, err := svc.ListArchiveRules(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/acm/certificates.go b/resources/services/acm/certificates.go index 189bbdc88..c945a75a3 100644 --- a/resources/services/acm/certificates.go +++ b/resources/services/acm/certificates.go @@ -204,17 +204,14 @@ func AcmCertificates() *schema.Table { func fetchAcmCertificates(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { cl := meta.(*client.Client) svc := cl.Services().ACM - optsFn := func(o *acm.Options) { - o.Region = cl.Region - } var input acm.ListCertificatesInput for { - output, err := svc.ListCertificates(ctx, &input, optsFn) + output, err := svc.ListCertificates(ctx, &input) if err != nil { return diag.WrapError(err) } for _, item := range output.CertificateSummaryList { - do, err := svc.DescribeCertificate(ctx, &acm.DescribeCertificateInput{CertificateArn: item.CertificateArn}, optsFn) + do, err := svc.DescribeCertificate(ctx, &acm.DescribeCertificateInput{CertificateArn: item.CertificateArn}) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/apigateway/api_keys.go b/resources/services/apigateway/api_keys.go index 6ffd2cb6f..4fbcfa78b 100644 --- a/resources/services/apigateway/api_keys.go +++ b/resources/services/apigateway/api_keys.go @@ -107,9 +107,7 @@ func fetchApigatewayApiKeys(ctx context.Context, meta schema.ClientMeta, parent c := meta.(*client.Client) svc := c.Services().Apigateway for { - response, err := svc.GetApiKeys(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetApiKeys(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/apigateway/client_certificates.go b/resources/services/apigateway/client_certificates.go index cd52a1455..2329447a2 100644 --- a/resources/services/apigateway/client_certificates.go +++ b/resources/services/apigateway/client_certificates.go @@ -85,9 +85,7 @@ func fetchApigatewayClientCertificates(ctx context.Context, meta schema.ClientMe c := meta.(*client.Client) svc := c.Services().Apigateway for { - response, err := svc.GetClientCertificates(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetClientCertificates(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/apigateway/domain_names.go b/resources/services/apigateway/domain_names.go index 0318ffe78..8c55420c7 100644 --- a/resources/services/apigateway/domain_names.go +++ b/resources/services/apigateway/domain_names.go @@ -202,9 +202,7 @@ func fetchApigatewayDomainNames(ctx context.Context, meta schema.ClientMeta, par c := meta.(*client.Client) svc := c.Services().Apigateway for { - response, err := svc.GetDomainNames(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetDomainNames(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -222,9 +220,7 @@ func fetchApigatewayDomainNameBasePathMappings(ctx context.Context, meta schema. svc := c.Services().Apigateway config := apigateway.GetBasePathMappingsInput{DomainName: r.DomainName} for { - response, err := svc.GetBasePathMappings(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetBasePathMappings(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/apigateway/rest_apis.go b/resources/services/apigateway/rest_apis.go index 62af53239..089f83d92 100644 --- a/resources/services/apigateway/rest_apis.go +++ b/resources/services/apigateway/rest_apis.go @@ -744,9 +744,7 @@ func fetchApigatewayRestApis(ctx context.Context, meta schema.ClientMeta, parent c := meta.(*client.Client) svc := c.Services().Apigateway for { - response, err := svc.GetRestApis(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetRestApis(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -764,9 +762,7 @@ func fetchApigatewayRestApiAuthorizers(ctx context.Context, meta schema.ClientMe svc := c.Services().Apigateway config := apigateway.GetAuthorizersInput{RestApiId: r.Id} for { - response, err := svc.GetAuthorizers(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetAuthorizers(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil @@ -787,9 +783,7 @@ func fetchApigatewayRestApiDeployments(ctx context.Context, meta schema.ClientMe svc := c.Services().Apigateway config := apigateway.GetDeploymentsInput{RestApiId: r.Id} for { - response, err := svc.GetDeployments(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetDeployments(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil @@ -810,9 +804,7 @@ func fetchApigatewayRestApiDocumentationParts(ctx context.Context, meta schema.C svc := c.Services().Apigateway config := apigateway.GetDocumentationPartsInput{RestApiId: r.Id} for { - response, err := svc.GetDocumentationParts(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetDocumentationParts(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil @@ -833,9 +825,7 @@ func fetchApigatewayRestApiDocumentationVersions(ctx context.Context, meta schem svc := c.Services().Apigateway config := apigateway.GetDocumentationVersionsInput{RestApiId: r.Id} for { - response, err := svc.GetDocumentationVersions(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetDocumentationVersions(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil @@ -856,9 +846,7 @@ func fetchApigatewayRestApiGatewayResponses(ctx context.Context, meta schema.Cli svc := c.Services().Apigateway config := apigateway.GetGatewayResponsesInput{RestApiId: r.Id} for { - response, err := svc.GetGatewayResponses(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetGatewayResponses(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil @@ -879,9 +867,7 @@ func fetchApigatewayRestApiModels(ctx context.Context, meta schema.ClientMeta, p svc := c.Services().Apigateway config := apigateway.GetModelsInput{RestApiId: r.Id} for { - response, err := svc.GetModels(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetModels(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil @@ -911,9 +897,7 @@ func resolveApigatewayRestAPIModelModelTemplate(ctx context.Context, meta schema ModelName: r.Name, } - response, err := svc.GetModelTemplate(ctx, &config, func(options *apigateway.Options) { - options.Region = cl.Region - }) + response, err := svc.GetModelTemplate(ctx, &config) if err != nil { if client.IsAWSError(err, "BadRequestException") { // This is an application level error and the user has nothing to do with that. @@ -935,9 +919,7 @@ func fetchApigatewayRestApiRequestValidators(ctx context.Context, meta schema.Cl svc := c.Services().Apigateway config := apigateway.GetRequestValidatorsInput{RestApiId: r.Id} for { - response, err := svc.GetRequestValidators(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetRequestValidators(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil @@ -958,9 +940,7 @@ func fetchApigatewayRestApiResources(ctx context.Context, meta schema.ClientMeta svc := c.Services().Apigateway config := apigateway.GetResourcesInput{RestApiId: r.Id} for { - response, err := svc.GetResources(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetResources(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil @@ -981,9 +961,7 @@ func fetchApigatewayRestApiStages(ctx context.Context, meta schema.ClientMeta, p svc := c.Services().Apigateway config := apigateway.GetStagesInput{RestApiId: r.Id} - response, err := svc.GetStages(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetStages(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil diff --git a/resources/services/apigateway/usage_plans.go b/resources/services/apigateway/usage_plans.go index fc0a9b4e0..bd4adc174 100644 --- a/resources/services/apigateway/usage_plans.go +++ b/resources/services/apigateway/usage_plans.go @@ -200,9 +200,7 @@ func fetchApigatewayUsagePlans(ctx context.Context, meta schema.ClientMeta, pare c := meta.(*client.Client) svc := c.Services().Apigateway for { - response, err := svc.GetUsagePlans(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetUsagePlans(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -225,9 +223,7 @@ func fetchApigatewayUsagePlanKeys(ctx context.Context, meta schema.ClientMeta, p svc := c.Services().Apigateway config := apigateway.GetUsagePlanKeysInput{UsagePlanId: r.Id} for { - response, err := svc.GetUsagePlanKeys(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetUsagePlanKeys(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/apigateway/vpc_links.go b/resources/services/apigateway/vpc_links.go index ac855a4c1..59c7f9009 100644 --- a/resources/services/apigateway/vpc_links.go +++ b/resources/services/apigateway/vpc_links.go @@ -89,9 +89,7 @@ func fetchApigatewayVpcLinks(ctx context.Context, meta schema.ClientMeta, parent c := meta.(*client.Client) svc := c.Services().Apigateway for { - response, err := svc.GetVpcLinks(ctx, &config, func(options *apigateway.Options) { - options.Region = c.Region - }) + response, err := svc.GetVpcLinks(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/apigatewayv2/apis.go b/resources/services/apigatewayv2/apis.go index 34bc98867..b0a151530 100644 --- a/resources/services/apigatewayv2/apis.go +++ b/resources/services/apigatewayv2/apis.go @@ -891,9 +891,7 @@ func fetchApigatewayv2Apis(ctx context.Context, meta schema.ClientMeta, parent * c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetApis(ctx, &config, func(o *apigatewayv2.Options) { - // o.Region = c.Region - }) + response, err := svc.GetApis(ctx, &config) if err != nil { return diag.WrapError(err) @@ -914,9 +912,7 @@ func fetchApigatewayv2ApiAuthorizers(ctx context.Context, meta schema.ClientMeta c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetAuthorizers(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = c.Region - }) + response, err := svc.GetAuthorizers(ctx, &config) if err != nil { return diag.WrapError(err) @@ -937,9 +933,7 @@ func fetchApigatewayv2ApiDeployments(ctx context.Context, meta schema.ClientMeta c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetDeployments(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = c.Region - }) + response, err := svc.GetDeployments(ctx, &config) if err != nil { return diag.WrapError(err) @@ -960,9 +954,7 @@ func fetchApigatewayv2ApiIntegrations(ctx context.Context, meta schema.ClientMet c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetIntegrations(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = c.Region - }) + response, err := svc.GetIntegrations(ctx, &config) if err != nil { return diag.WrapError(err) @@ -985,9 +977,7 @@ func fetchApigatewayv2ApiIntegrationResponses(ctx context.Context, meta schema.C c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetIntegrationResponses(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = c.Region - }) + response, err := svc.GetIntegrationResponses(ctx, &config) if err != nil { return diag.WrapError(err) @@ -1008,9 +998,7 @@ func fetchApigatewayv2ApiModels(ctx context.Context, meta schema.ClientMeta, par c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetModels(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = c.Region - }) + response, err := svc.GetModels(ctx, &config) if err != nil { return diag.WrapError(err) @@ -1033,9 +1021,7 @@ func resolveApigatewayv2apiModelModelTemplate(ctx context.Context, meta schema.C cl := meta.(*client.Client) svc := cl.Services().Apigatewayv2 - response, err := svc.GetModelTemplate(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = cl.Region - }) + response, err := svc.GetModelTemplate(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -1049,9 +1035,7 @@ func fetchApigatewayv2ApiRoutes(ctx context.Context, meta schema.ClientMeta, par c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetRoutes(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = c.Region - }) + response, err := svc.GetRoutes(ctx, &config) if err != nil { return diag.WrapError(err) @@ -1074,9 +1058,7 @@ func fetchApigatewayv2ApiRouteResponses(ctx context.Context, meta schema.ClientM c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetRouteResponses(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = c.Region - }) + response, err := svc.GetRouteResponses(ctx, &config) if err != nil { return diag.WrapError(err) @@ -1097,9 +1079,7 @@ func fetchApigatewayv2ApiStages(ctx context.Context, meta schema.ClientMeta, par c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetStages(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = c.Region - }) + response, err := svc.GetStages(ctx, &config) if err != nil { return diag.WrapError(err) diff --git a/resources/services/apigatewayv2/domain_names.go b/resources/services/apigatewayv2/domain_names.go index e9cf958ee..293d49618 100644 --- a/resources/services/apigatewayv2/domain_names.go +++ b/resources/services/apigatewayv2/domain_names.go @@ -226,9 +226,7 @@ func fetchApigatewayv2DomainNameRestApiMappings(ctx context.Context, meta schema c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetApiMappings(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = c.Region - }) + response, err := svc.GetApiMappings(ctx, &config) if err != nil { return diag.WrapError(err) diff --git a/resources/services/apigatewayv2/vpc_links.go b/resources/services/apigatewayv2/vpc_links.go index c47da258e..130482820 100644 --- a/resources/services/apigatewayv2/vpc_links.go +++ b/resources/services/apigatewayv2/vpc_links.go @@ -99,9 +99,7 @@ func fetchApigatewayv2VpcLinks(ctx context.Context, meta schema.ClientMeta, pare c := meta.(*client.Client) svc := c.Services().Apigatewayv2 for { - response, err := svc.GetVpcLinks(ctx, &config, func(o *apigatewayv2.Options) { - o.Region = c.Region - }) + response, err := svc.GetVpcLinks(ctx, &config) if err != nil { return diag.WrapError(err) diff --git a/resources/services/applicationautoscaling/policies.go b/resources/services/applicationautoscaling/policies.go index 150b096e6..bc3cc5e5f 100644 --- a/resources/services/applicationautoscaling/policies.go +++ b/resources/services/applicationautoscaling/policies.go @@ -110,9 +110,7 @@ func fetchApplicationautoscalingPolicies(ctx context.Context, meta schema.Client ServiceNamespace: types.ServiceNamespace(c.AutoscalingNamespace), } for { - output, err := svc.DescribeScalingPolicies(ctx, &config, func(o *applicationautoscaling.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeScalingPolicies(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/athena/data_catalogs.go b/resources/services/athena/data_catalogs.go index aee5ed823..62574d60a 100644 --- a/resources/services/athena/data_catalogs.go +++ b/resources/services/athena/data_catalogs.go @@ -217,9 +217,7 @@ func listDataCatalogs(ctx context.Context, meta schema.ClientMeta, detailChan ch svc := c.Services().Athena input := athena.ListDataCatalogsInput{} for { - response, err := svc.ListDataCatalogs(ctx, &input, func(options *athena.Options) { - options.Region = c.Region - }) + response, err := svc.ListDataCatalogs(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -268,9 +266,7 @@ func fetchAthenaDataCatalogDatabases(ctx context.Context, meta schema.ClientMeta CatalogName: parent.Item.(types.DataCatalog).Name, } for { - response, err := svc.ListDatabases(ctx, &input, func(options *athena.Options) { - options.Region = c.Region - }) + response, err := svc.ListDatabases(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -291,9 +287,7 @@ func fetchAthenaDataCatalogDatabaseTables(ctx context.Context, meta schema.Clien DatabaseName: parent.Item.(types.Database).Name, } for { - response, err := svc.ListTableMetadata(ctx, &input, func(options *athena.Options) { - options.Region = cl.Region - }) + response, err := svc.ListTableMetadata(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -325,8 +319,6 @@ func dataCatalogDetail(ctx context.Context, meta schema.ClientMeta, resultsChan svc := c.Services().Athena dc, err := svc.GetDataCatalog(ctx, &athena.GetDataCatalogInput{ Name: catalogSummary.CatalogName, - }, func(options *athena.Options) { - options.Region = c.Region }) if err != nil { // retrieving of default data catalog (AwsDataCatalog) returns "not found error" but it exists and its diff --git a/resources/services/athena/work_groups.go b/resources/services/athena/work_groups.go index f7653d3d7..65aa7b3e0 100644 --- a/resources/services/athena/work_groups.go +++ b/resources/services/athena/work_groups.go @@ -416,9 +416,7 @@ func listWorkGroups(ctx context.Context, meta schema.ClientMeta, detailChan chan svc := c.Services().Athena input := athena.ListWorkGroupsInput{} for { - response, err := svc.ListWorkGroups(ctx, &input, func(options *athena.Options) { - options.Region = c.Region - }) + response, err := svc.ListWorkGroups(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -469,9 +467,7 @@ func fetchAthenaWorkGroupPreparedStatements(ctx context.Context, meta schema.Cli wg := parent.Item.(types.WorkGroup) input := athena.ListPreparedStatementsInput{WorkGroup: wg.Name} for { - response, err := svc.ListPreparedStatements(ctx, &input, func(options *athena.Options) { - options.Region = c.Region - }) + response, err := svc.ListPreparedStatements(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -479,8 +475,6 @@ func fetchAthenaWorkGroupPreparedStatements(ctx context.Context, meta schema.Cli dc, err := svc.GetPreparedStatement(ctx, &athena.GetPreparedStatementInput{ WorkGroup: wg.Name, StatementName: d.StatementName, - }, func(options *athena.Options) { - options.Region = c.Region }) if err != nil { if c.IsNotFoundError(err) { @@ -504,17 +498,13 @@ func fetchAthenaWorkGroupQueryExecutions(ctx context.Context, meta schema.Client wg := parent.Item.(types.WorkGroup) input := athena.ListQueryExecutionsInput{WorkGroup: wg.Name} for { - response, err := svc.ListQueryExecutions(ctx, &input, func(options *athena.Options) { - options.Region = c.Region - }) + response, err := svc.ListQueryExecutions(ctx, &input) if err != nil { return diag.WrapError(err) } for _, d := range response.QueryExecutionIds { dc, err := svc.GetQueryExecution(ctx, &athena.GetQueryExecutionInput{ QueryExecutionId: aws.String(d), - }, func(options *athena.Options) { - options.Region = c.Region }) if err != nil { if c.IsNotFoundError(err) || isQueryExecutionNotFound(err) { @@ -538,17 +528,13 @@ func fetchAthenaWorkGroupNamedQueries(ctx context.Context, meta schema.ClientMet wg := parent.Item.(types.WorkGroup) input := athena.ListNamedQueriesInput{WorkGroup: wg.Name} for { - response, err := svc.ListNamedQueries(ctx, &input, func(options *athena.Options) { - options.Region = c.Region - }) + response, err := svc.ListNamedQueries(ctx, &input) if err != nil { return diag.WrapError(err) } for _, d := range response.NamedQueryIds { dc, err := svc.GetNamedQuery(ctx, &athena.GetNamedQueryInput{ NamedQueryId: aws.String(d), - }, func(options *athena.Options) { - options.Region = c.Region }) if err != nil { if c.IsNotFoundError(err) { @@ -577,8 +563,6 @@ func workGroupDetail(ctx context.Context, meta schema.ClientMeta, resultsChan ch wg := summary.(types.WorkGroupSummary) dc, err := svc.GetWorkGroup(ctx, &athena.GetWorkGroupInput{ WorkGroup: wg.Name, - }, func(options *athena.Options) { - options.Region = c.Region }) if err != nil { if c.IsNotFoundError(err) { diff --git a/resources/services/autoscaling/configurations.go b/resources/services/autoscaling/configurations.go index a40a54beb..ddc4a2fd5 100644 --- a/resources/services/autoscaling/configurations.go +++ b/resources/services/autoscaling/configurations.go @@ -232,9 +232,7 @@ func fetchAutoscalingLaunchConfigurations(ctx context.Context, meta schema.Clien svc := c.Services().Autoscaling config := autoscaling.DescribeLaunchConfigurationsInput{} for { - output, err := svc.DescribeLaunchConfigurations(ctx, &config, func(o *autoscaling.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeLaunchConfigurations(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/autoscaling/groups.go b/resources/services/autoscaling/groups.go index f1337ac0d..8043e0d93 100644 --- a/resources/services/autoscaling/groups.go +++ b/resources/services/autoscaling/groups.go @@ -576,9 +576,7 @@ func fetchAutoscalingGroups(ctx context.Context, meta schema.ClientMeta, parent config := autoscaling.DescribeAutoScalingGroupsInput{} for { - output, err := svc.DescribeAutoScalingGroups(ctx, &config, func(o *autoscaling.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeAutoScalingGroups(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -610,9 +608,7 @@ func resolveAutoscalingGroupLoadBalancers(ctx context.Context, meta schema.Clien config := autoscaling.DescribeLoadBalancersInput{AutoScalingGroupName: p.AutoScalingGroupName} j := map[string]interface{}{} for { - output, err := svc.DescribeLoadBalancers(ctx, &config, func(o *autoscaling.Options) { - o.Region = cl.Region - }) + output, err := svc.DescribeLoadBalancers(ctx, &config) if err != nil { if isAutoScalingGroupNotExistsError(err) { return nil @@ -637,9 +633,7 @@ func resolveAutoscalingGroupLoadBalancerTargetGroups(ctx context.Context, meta s config := autoscaling.DescribeLoadBalancerTargetGroupsInput{AutoScalingGroupName: p.AutoScalingGroupName} j := map[string]interface{}{} for { - output, err := svc.DescribeLoadBalancerTargetGroups(ctx, &config, func(o *autoscaling.Options) { - o.Region = cl.Region - }) + output, err := svc.DescribeLoadBalancerTargetGroups(ctx, &config) if err != nil { if isAutoScalingGroupNotExistsError(err) { return nil @@ -690,9 +684,7 @@ func fetchAutoscalingGroupScalingPolicies(ctx context.Context, meta schema.Clien config := autoscaling.DescribePoliciesInput{AutoScalingGroupName: p.AutoScalingGroupName} for { - output, err := svc.DescribePolicies(ctx, &config, func(o *autoscaling.Options) { - o.Region = cl.Region - }) + output, err := svc.DescribePolicies(ctx, &config) if err != nil { if isAutoScalingGroupNotExistsError(err) { return nil @@ -733,9 +725,7 @@ func fetchAutoscalingGroupLifecycleHooks(ctx context.Context, meta schema.Client svc := cl.Services().Autoscaling config := autoscaling.DescribeLifecycleHooksInput{AutoScalingGroupName: p.AutoScalingGroupName} - output, err := svc.DescribeLifecycleHooks(ctx, &config, func(o *autoscaling.Options) { - o.Region = cl.Region - }) + output, err := svc.DescribeLifecycleHooks(ctx, &config) if err != nil { if isAutoScalingGroupNotExistsError(err) { return nil diff --git a/resources/services/autoscaling/scheduled_actions.go b/resources/services/autoscaling/scheduled_actions.go index 5a0d8620f..7450237be 100644 --- a/resources/services/autoscaling/scheduled_actions.go +++ b/resources/services/autoscaling/scheduled_actions.go @@ -107,9 +107,7 @@ func fetchAutoscalingScheduledActions(ctx context.Context, meta schema.ClientMet MaxRecords: aws.Int32(100), } for { - output, err := svc.DescribeScheduledActions(ctx, params, func(options *autoscaling.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeScheduledActions(ctx, params) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/backup/global_settings.go b/resources/services/backup/global_settings.go index 867eb6fdd..575fadb1d 100644 --- a/resources/services/backup/global_settings.go +++ b/resources/services/backup/global_settings.go @@ -48,9 +48,7 @@ func fetchBackupGlobalSettings(ctx context.Context, meta schema.ClientMeta, pare svc := c.Services().Backup input := backup.DescribeGlobalSettingsInput{} - output, err := svc.DescribeGlobalSettings(ctx, &input, func(o *backup.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeGlobalSettings(ctx, &input) if err != nil { if client.IgnoreAccessDeniedServiceDisabled(err) || client.IsAWSError(err, "ERROR_9601") /* "Your account is not a member of an organization" */ { meta.Logger().Debug("received access denied on DescribeGlobalSettings", "err", err) diff --git a/resources/services/backup/plans.go b/resources/services/backup/plans.go index e6fae9f5f..02bc23312 100644 --- a/resources/services/backup/plans.go +++ b/resources/services/backup/plans.go @@ -244,9 +244,7 @@ func fetchBackupPlans(ctx context.Context, meta schema.ClientMeta, parent *schem svc := cl.Services().Backup params := backup.ListBackupPlansInput{MaxResults: aws.Int32(1000)} // maximum value from https://docs.aws.amazon.com/aws-backup/latest/devguide/API_ListBackupPlans.html for { - result, err := svc.ListBackupPlans(ctx, ¶ms, func(o *backup.Options) { - o.Region = cl.Region - }) + result, err := svc.ListBackupPlans(ctx, ¶ms) if err != nil { return diag.WrapError(err) } @@ -305,9 +303,7 @@ func fetchBackupSelections(ctx context.Context, meta schema.ClientMeta, parent * MaxResults: aws.Int32(1000), // maximum value from https://docs.aws.amazon.com/aws-backup/latest/devguide/API_ListBackupSelections.html } for { - result, err := svc.ListBackupSelections(ctx, ¶ms, func(o *backup.Options) { - o.Region = cl.Region - }) + result, err := svc.ListBackupSelections(ctx, ¶ms) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/backup/region_settings.go b/resources/services/backup/region_settings.go index af7ba77af..32f2c3343 100644 --- a/resources/services/backup/region_settings.go +++ b/resources/services/backup/region_settings.go @@ -54,9 +54,7 @@ func fetchBackupRegionSettings(ctx context.Context, meta schema.ClientMeta, pare svc := c.Services().Backup input := backup.DescribeRegionSettingsInput{} - output, err := svc.DescribeRegionSettings(ctx, &input, func(o *backup.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeRegionSettings(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/backup/vaults.go b/resources/services/backup/vaults.go index 788ac9108..69637d0b1 100644 --- a/resources/services/backup/vaults.go +++ b/resources/services/backup/vaults.go @@ -250,9 +250,7 @@ func fetchBackupVaults(ctx context.Context, meta schema.ClientMeta, parent *sche svc := cl.Services().Backup params := backup.ListBackupVaultsInput{MaxResults: aws.Int32(1000)} // maximum value from https://docs.aws.amazon.com/aws-backup/latest/devguide/API_ListBackupVaults.html for { - result, err := svc.ListBackupVaults(ctx, ¶ms, func(o *backup.Options) { - o.Region = cl.Region - }) + result, err := svc.ListBackupVaults(ctx, ¶ms) if err != nil { return diag.WrapError(err) } @@ -340,9 +338,7 @@ func fetchVaultRecoveryPoints(ctx context.Context, meta schema.ClientMeta, paren vault := parent.Item.(types.BackupVaultListMember) params := backup.ListRecoveryPointsByBackupVaultInput{BackupVaultName: vault.BackupVaultName, MaxResults: aws.Int32(100)} for { - result, err := svc.ListRecoveryPointsByBackupVault(ctx, ¶ms, func(o *backup.Options) { - o.Region = cl.Region - }) + result, err := svc.ListRecoveryPointsByBackupVault(ctx, ¶ms) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/cloudformation/stacks.go b/resources/services/cloudformation/stacks.go index da1eff51f..d72fa0453 100644 --- a/resources/services/cloudformation/stacks.go +++ b/resources/services/cloudformation/stacks.go @@ -302,9 +302,7 @@ func fetchCloudformationStacks(ctx context.Context, meta schema.ClientMeta, _ *s c := meta.(*client.Client) svc := c.Services().Cloudformation for { - output, err := svc.DescribeStacks(ctx, &config, func(options *cloudformation.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeStacks(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -337,9 +335,7 @@ func fetchCloudformationStackResources(ctx context.Context, meta schema.ClientMe c := meta.(*client.Client) svc := c.Services().Cloudformation for { - output, err := svc.ListStackResources(ctx, &config, func(options *cloudformation.Options) { - options.Region = c.Region - }) + output, err := svc.ListStackResources(ctx, &config) if err != nil { if client.IsErrorRegex(err, "ValidationError", validStackNotFoundRegex) { meta.Logger().Debug("received ValidationError on ListStackResources, stack does not exist", "region", c.Region, "err", err) diff --git a/resources/services/cloudfront/cache_policies.go b/resources/services/cloudfront/cache_policies.go index 2b9dda500..a0bd8c0a1 100644 --- a/resources/services/cloudfront/cache_policies.go +++ b/resources/services/cloudfront/cache_policies.go @@ -163,9 +163,7 @@ func fetchCloudfrontCachePolicies(ctx context.Context, meta schema.ClientMeta, p s := c.Services() svc := s.Cloudfront for { - response, err := svc.ListCachePolicies(ctx, nil, func(options *cloudfront.Options) { - options.Region = c.Region - }) + response, err := svc.ListCachePolicies(ctx, nil) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/cloudfront/distributions.go b/resources/services/cloudfront/distributions.go index 4d391beeb..f6bbcb2f7 100644 --- a/resources/services/cloudfront/distributions.go +++ b/resources/services/cloudfront/distributions.go @@ -764,9 +764,7 @@ func fetchCloudfrontDistributions(ctx context.Context, meta schema.ClientMeta, p c := meta.(*client.Client) svc := c.Services().Cloudfront for { - response, err := svc.ListDistributions(ctx, &config, func(options *cloudfront.Options) { - options.Region = c.Region - }) + response, err := svc.ListDistributions(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/cloudwatch/alarms.go b/resources/services/cloudwatch/alarms.go index 7172c0949..944f41cb6 100644 --- a/resources/services/cloudwatch/alarms.go +++ b/resources/services/cloudwatch/alarms.go @@ -277,9 +277,7 @@ func fetchCloudwatchAlarms(ctx context.Context, meta schema.ClientMeta, parent * c := meta.(*client.Client) svc := c.Services().Cloudwatch for { - response, err := svc.DescribeAlarms(ctx, &config, func(o *cloudwatch.Options) { - o.Region = c.Region - }) + response, err := svc.DescribeAlarms(ctx, &config) if err != nil { return diag.WrapError(err) diff --git a/resources/services/cloudwatchlogs/filters.go b/resources/services/cloudwatchlogs/filters.go index 95cdf94e1..e9055c134 100644 --- a/resources/services/cloudwatchlogs/filters.go +++ b/resources/services/cloudwatchlogs/filters.go @@ -103,9 +103,7 @@ func fetchCloudwatchlogsFilters(ctx context.Context, meta schema.ClientMeta, par c := meta.(*client.Client) svc := c.Services().CloudwatchLogs for { - response, err := svc.DescribeMetricFilters(ctx, &config, func(options *cloudwatchlogs.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeMetricFilters(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/cloudwatchlogs/log_groups.go b/resources/services/cloudwatchlogs/log_groups.go index 35230c6ca..f9a22398d 100644 --- a/resources/services/cloudwatchlogs/log_groups.go +++ b/resources/services/cloudwatchlogs/log_groups.go @@ -90,9 +90,7 @@ func fetchCloudwatchlogsLogGroups(ctx context.Context, meta schema.ClientMeta, p c := meta.(*client.Client) svc := c.Services().CloudwatchLogs for { - response, err := svc.DescribeLogGroups(ctx, &config, func(options *cloudwatchlogs.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeLogGroups(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/codebuild/projects.go b/resources/services/codebuild/projects.go index 0cb55fa25..3264c0857 100644 --- a/resources/services/codebuild/projects.go +++ b/resources/services/codebuild/projects.go @@ -691,18 +691,14 @@ func fetchCodebuildProjects(ctx context.Context, meta schema.ClientMeta, parent svc := c.Services().Codebuild config := codebuild.ListProjectsInput{} for { - response, err := svc.ListProjects(ctx, &config, func(options *codebuild.Options) { - options.Region = c.Region - }) + response, err := svc.ListProjects(ctx, &config) if err != nil { return diag.WrapError(err) } if len(response.Projects) == 0 { break } - projectsOutput, err := svc.BatchGetProjects(ctx, &codebuild.BatchGetProjectsInput{Names: response.Projects}, func(options *codebuild.Options) { - options.Region = c.Region - }) + projectsOutput, err := svc.BatchGetProjects(ctx, &codebuild.BatchGetProjectsInput{Names: response.Projects}) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/codepipeline/pipelines.go b/resources/services/codepipeline/pipelines.go index 29c85ec13..b29f9b04a 100644 --- a/resources/services/codepipeline/pipelines.go +++ b/resources/services/codepipeline/pipelines.go @@ -235,16 +235,12 @@ func fetchCodepipelinePipelines(ctx context.Context, meta schema.ClientMeta, par svc := c.Services().CodePipeline config := codepipeline.ListPipelinesInput{} for { - response, err := svc.ListPipelines(ctx, &config, func(options *codepipeline.Options) { - options.Region = c.Region - }) + response, err := svc.ListPipelines(ctx, &config) if err != nil { return diag.WrapError(err) } for i := range response.Pipelines { - response, err := svc.GetPipeline(ctx, &codepipeline.GetPipelineInput{Name: response.Pipelines[i].Name}, func(o *codepipeline.Options) { - o.Region = c.Region - }) + response, err := svc.GetPipeline(ctx, &codepipeline.GetPipelineInput{Name: response.Pipelines[i].Name}) if err != nil { if c.IsNotFoundError(err) { continue @@ -268,8 +264,6 @@ func resolveCodepipelinePipelineTags(ctx context.Context, meta schema.ClientMeta svc := cl.Services().CodePipeline response, err := svc.ListTagsForResource(ctx, &codepipeline.ListTagsForResourceInput{ ResourceArn: pipeline.Metadata.PipelineArn, - }, func(options *codepipeline.Options) { - options.Region = cl.Region }) if err != nil { return diag.WrapError(err) diff --git a/resources/services/codepipeline/webhooks.go b/resources/services/codepipeline/webhooks.go index 4b0668d62..efdcf8b80 100644 --- a/resources/services/codepipeline/webhooks.go +++ b/resources/services/codepipeline/webhooks.go @@ -138,9 +138,7 @@ func fetchCodepipelineWebhooks(ctx context.Context, meta schema.ClientMeta, pare svc := c.Services().CodePipeline config := codepipeline.ListWebhooksInput{} for { - response, err := svc.ListWebhooks(ctx, &config, func(options *codepipeline.Options) { - options.Region = c.Region - }) + response, err := svc.ListWebhooks(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/config/configuration_recorders.go b/resources/services/config/configuration_recorders.go index 6b3f5fcf0..8b338cdd4 100644 --- a/resources/services/config/configuration_recorders.go +++ b/resources/services/config/configuration_recorders.go @@ -125,9 +125,7 @@ func ConfigConfigurationRecorders() *schema.Table { func fetchConfigConfigurationRecorders(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { c := meta.(*client.Client) - resp, err := c.Services().ConfigService.DescribeConfigurationRecorders(ctx, &configservice.DescribeConfigurationRecordersInput{}, func(options *configservice.Options) { - options.Region = c.Region - }) + resp, err := c.Services().ConfigService.DescribeConfigurationRecorders(ctx, &configservice.DescribeConfigurationRecordersInput{}) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/config/conformance_pack.go b/resources/services/config/conformance_pack.go index e0447a739..e78fc459d 100644 --- a/resources/services/config/conformance_pack.go +++ b/resources/services/config/conformance_pack.go @@ -161,9 +161,7 @@ func fetchConfigConformancePacks(ctx context.Context, meta schema.ClientMeta, pa config := configservice.DescribeConformancePacksInput{} var ae smithy.APIError for { - resp, err := c.Services().ConfigService.DescribeConformancePacks(ctx, &config, func(options *configservice.Options) { - options.Region = c.Region - }) + resp, err := c.Services().ConfigService.DescribeConformancePacks(ctx, &config) // This is a workaround until this bug is fixed = https://github.com/aws/aws-sdk-go-v2/issues/1539 if (c.Region == "af-south-1" || c.Region == "ap-northeast-3") && errors.As(err, &ae) && ae.ErrorCode() == "AccessDeniedException" { @@ -198,9 +196,7 @@ func fetchConfigConformancePackRuleCompliances(ctx context.Context, meta schema. ConformancePackName: conformancePackDetail.ConformancePackName, } for { - resp, err := cs.DescribeConformancePackCompliance(ctx, ¶ms, func(options *configservice.Options) { - options.Region = c.Region - }) + resp, err := cs.DescribeConformancePackCompliance(ctx, ¶ms) if err != nil { return diag.WrapError(err) } @@ -212,9 +208,7 @@ func fetchConfigConformancePackRuleCompliances(ctx context.Context, meta schema. }, } for { - output, err := cs.GetConformancePackComplianceDetails(ctx, detailParams, func(options *configservice.Options) { - options.Region = c.Region - }) + output, err := cs.GetConformancePackComplianceDetails(ctx, detailParams) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/dax/clusters.go b/resources/services/dax/clusters.go index 1b927344b..70cc0503d 100644 --- a/resources/services/dax/clusters.go +++ b/resources/services/dax/clusters.go @@ -232,9 +232,7 @@ func fetchDaxClusters(ctx context.Context, meta schema.ClientMeta, parent *schem config := dax.DescribeClustersInput{} for { - output, err := svc.DescribeClusters(ctx, &config, func(o *dax.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeClusters(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -256,8 +254,6 @@ func resolveDaxClusterTags(ctx context.Context, meta schema.ClientMeta, resource svc := cl.Services().DAX response, err := svc.ListTags(ctx, &dax.ListTagsInput{ ResourceName: cluster.ClusterArn, - }, func(options *dax.Options) { - options.Region = cl.Region }) if err != nil { return diag.WrapError(err) diff --git a/resources/services/directconnect/connections.go b/resources/services/directconnect/connections.go index 8edfc4c0c..56f985d63 100644 --- a/resources/services/directconnect/connections.go +++ b/resources/services/directconnect/connections.go @@ -188,9 +188,7 @@ func fetchDirectconnectConnections(ctx context.Context, meta schema.ClientMeta, var config directconnect.DescribeConnectionsInput c := meta.(*client.Client) svc := c.Services().Directconnect - output, err := svc.DescribeConnections(ctx, &config, func(options *directconnect.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeConnections(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/directconnect/gateways.go b/resources/services/directconnect/gateways.go index 90276e742..c3517f3c6 100644 --- a/resources/services/directconnect/gateways.go +++ b/resources/services/directconnect/gateways.go @@ -257,9 +257,7 @@ func fetchDirectconnectGatewayAttachments(ctx context.Context, meta schema.Clien svc := c.Services().Directconnect config := directconnect.DescribeDirectConnectGatewayAttachmentsInput{DirectConnectGatewayId: gateway.DirectConnectGatewayId} for { - output, err := svc.DescribeDirectConnectGatewayAttachments(ctx, &config, func(options *directconnect.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeDirectConnectGatewayAttachments(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/directconnect/lags.go b/resources/services/directconnect/lags.go index 7690aaf2b..3c70ff373 100644 --- a/resources/services/directconnect/lags.go +++ b/resources/services/directconnect/lags.go @@ -185,9 +185,7 @@ func fetchDirectconnectLags(ctx context.Context, meta schema.ClientMeta, parent var config directconnect.DescribeLagsInput c := meta.(*client.Client) svc := c.Services().Directconnect - output, err := svc.DescribeLags(ctx, &config, func(options *directconnect.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeLags(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/directconnect/virtual_gateways.go b/resources/services/directconnect/virtual_gateways.go index e9dd3395d..0702ce9b7 100644 --- a/resources/services/directconnect/virtual_gateways.go +++ b/resources/services/directconnect/virtual_gateways.go @@ -55,9 +55,7 @@ func fetchDirectconnectVirtualGateways(ctx context.Context, meta schema.ClientMe var config directconnect.DescribeVirtualGatewaysInput c := meta.(*client.Client) svc := c.Services().Directconnect - output, err := svc.DescribeVirtualGateways(ctx, &config, func(options *directconnect.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeVirtualGateways(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/directconnect/virtual_interfaces.go b/resources/services/directconnect/virtual_interfaces.go index 5ec751250..5f0cee9a6 100644 --- a/resources/services/directconnect/virtual_interfaces.go +++ b/resources/services/directconnect/virtual_interfaces.go @@ -231,9 +231,7 @@ func fetchDirectconnectVirtualInterfaces(ctx context.Context, meta schema.Client var config directconnect.DescribeVirtualInterfacesInput c := meta.(*client.Client) svc := c.Services().Directconnect - output, err := svc.DescribeVirtualInterfaces(ctx, &config, func(options *directconnect.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeVirtualInterfaces(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/dms/replication_instances.go b/resources/services/dms/replication_instances.go index bf67573c6..da69f59a1 100644 --- a/resources/services/dms/replication_instances.go +++ b/resources/services/dms/replication_instances.go @@ -268,9 +268,7 @@ func fetchDmsReplicationInstances(ctx context.Context, meta schema.ClientMeta, _ svc := c.Services().DMS var describeReplicationInstancesInput *databasemigrationservice.DescribeReplicationInstancesInput - describeReplicationInstancesOutput, err := svc.DescribeReplicationInstances(ctx, describeReplicationInstancesInput, func(options *databasemigrationservice.Options) { - options.Region = c.Region - }) + describeReplicationInstancesOutput, err := svc.DescribeReplicationInstances(ctx, describeReplicationInstancesInput) if err != nil { return diag.WrapError(err) } @@ -283,9 +281,7 @@ func fetchDmsReplicationInstances(ctx context.Context, meta schema.ClientMeta, _ listTagsForResourceInput.ResourceArnList = append(listTagsForResourceInput.ResourceArnList, *replicationInstance.ReplicationInstanceArn) } var listTagsForResourceOutput *databasemigrationservice.ListTagsForResourceOutput - listTagsForResourceOutput, err = svc.ListTagsForResource(ctx, &listTagsForResourceInput, func(options *databasemigrationservice.Options) { - options.Region = c.Region - }) + listTagsForResourceOutput, err = svc.ListTagsForResource(ctx, &listTagsForResourceInput) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/dynamodb/tables.go b/resources/services/dynamodb/tables.go index eec68bebb..70a53210d 100644 --- a/resources/services/dynamodb/tables.go +++ b/resources/services/dynamodb/tables.go @@ -511,17 +511,13 @@ func fetchDynamodbTables(ctx context.Context, meta schema.ClientMeta, parent *sc config := dynamodb.ListTablesInput{} for { - output, err := svc.ListTables(ctx, &config, func(o *dynamodb.Options) { - o.Region = c.Region - }) + output, err := svc.ListTables(ctx, &config) if err != nil { return diag.WrapError(err) } for i := range output.TableNames { - response, err := svc.DescribeTable(ctx, &dynamodb.DescribeTableInput{TableName: &output.TableNames[i]}, func(o *dynamodb.Options) { - o.Region = c.Region - }) + response, err := svc.DescribeTable(ctx, &dynamodb.DescribeTableInput{TableName: &output.TableNames[i]}) if err != nil { if c.IsNotFoundError(err) { continue @@ -546,8 +542,6 @@ func resolveDynamodbTableTags(ctx context.Context, meta schema.ClientMeta, resou svc := cl.Services().DynamoDB response, err := svc.ListTagsOfResource(ctx, &dynamodb.ListTagsOfResourceInput{ ResourceArn: table.TableArn, - }, func(options *dynamodb.Options) { - options.Region = cl.Region }) if err != nil { if cl.IsNotFoundError(err) { @@ -672,8 +666,6 @@ func fetchDynamodbTableReplicaAutoScalings(ctx context.Context, meta schema.Clie output, err := svc.DescribeTableReplicaAutoScaling(ctx, &dynamodb.DescribeTableReplicaAutoScalingInput{ TableName: par.TableName, - }, func(o *dynamodb.Options) { - o.Region = c.Region }) if err != nil { if c.IsNotFoundError(err) { @@ -728,8 +720,6 @@ func fetchDynamodbTableContinuousBackups(ctx context.Context, meta schema.Client output, err := svc.DescribeContinuousBackups(ctx, &dynamodb.DescribeContinuousBackupsInput{ TableName: par.TableName, - }, func(o *dynamodb.Options) { - o.Region = c.Region }) if err != nil { if c.IsNotFoundError(err) { diff --git a/resources/services/ec2/byoip_cidrs.go b/resources/services/ec2/byoip_cidrs.go index 98ca72379..d9270ef4a 100644 --- a/resources/services/ec2/byoip_cidrs.go +++ b/resources/services/ec2/byoip_cidrs.go @@ -75,9 +75,7 @@ func fetchEc2ByoipCidrs(ctx context.Context, meta schema.ClientMeta, parent *sch } svc := c.Services().EC2 for { - response, err := svc.DescribeByoipCidrs(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeByoipCidrs(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/ebs_snapshots.go b/resources/services/ec2/ebs_snapshots.go index 620d35735..7bab45949 100644 --- a/resources/services/ec2/ebs_snapshots.go +++ b/resources/services/ec2/ebs_snapshots.go @@ -129,9 +129,7 @@ func fetchEc2EbsSnapshots(ctx context.Context, meta schema.ClientMeta, parent *s svc := c.Services().EC2 config.OwnerIds = []string{c.AccountID} for { - output, err := svc.DescribeSnapshots(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeSnapshots(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -150,8 +148,6 @@ func resolveEc2ebsSnapshotCreateVolumePermissions(ctx context.Context, meta sche output, err := svc.DescribeSnapshotAttribute(ctx, &ec2.DescribeSnapshotAttributeInput{ Attribute: types.SnapshotAttributeNameCreateVolumePermission, SnapshotId: r.SnapshotId, - }, func(options *ec2.Options) { - options.Region = cl.Region }) if err != nil { diff --git a/resources/services/ec2/ebs_volumes.go b/resources/services/ec2/ebs_volumes.go index 1e0ac72d5..94ad8653f 100644 --- a/resources/services/ec2/ebs_volumes.go +++ b/resources/services/ec2/ebs_volumes.go @@ -151,9 +151,7 @@ func fetchEc2EbsVolumes(ctx context.Context, meta schema.ClientMeta, _ *schema.R svc := c.Services().EC2 config := ec2.DescribeVolumesInput{} for { - response, err := svc.DescribeVolumes(ctx, &config, func(o *ec2.Options) { - o.Region = c.Region - }) + response, err := svc.DescribeVolumes(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/egress_only_internet_gateways.go b/resources/services/ec2/egress_only_internet_gateways.go index 4bb32807f..f08a0e7c8 100644 --- a/resources/services/ec2/egress_only_internet_gateways.go +++ b/resources/services/ec2/egress_only_internet_gateways.go @@ -73,9 +73,7 @@ func fetchEc2EgressOnlyInternetGateways(ctx context.Context, meta schema.ClientM svc := c.Services().EC2 input := ec2.DescribeEgressOnlyInternetGatewaysInput{} for { - output, err := svc.DescribeEgressOnlyInternetGateways(ctx, &input, func(o *ec2.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeEgressOnlyInternetGateways(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/flow_logs.go b/resources/services/ec2/flow_logs.go index 68a161a85..9aa012f4b 100644 --- a/resources/services/ec2/flow_logs.go +++ b/resources/services/ec2/flow_logs.go @@ -131,9 +131,7 @@ func fetchEc2FlowLogs(ctx context.Context, meta schema.ClientMeta, parent *schem c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeFlowLogs(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeFlowLogs(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/images.go b/resources/services/ec2/images.go index 6876bf045..e6ac20e39 100644 --- a/resources/services/ec2/images.go +++ b/resources/services/ec2/images.go @@ -290,9 +290,7 @@ func fetchEc2Images(ctx context.Context, meta schema.ClientMeta, parent *schema. g, ctx := errgroup.WithContext(ctx) g.Go(func() error { // fetch ec2.Images owned by this account - response, err := svc.DescribeImages(ctx, &ec2.DescribeImagesInput{Owners: []string{"self"}}, func(options *ec2.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeImages(ctx, &ec2.DescribeImagesInput{Owners: []string{"self"}}) if err != nil { return diag.WrapError(err) } @@ -302,9 +300,7 @@ func fetchEc2Images(ctx context.Context, meta schema.ClientMeta, parent *schema. g.Go(func() error { // fetch ec2.Images that are shared with this account - response, err := svc.DescribeImages(ctx, &ec2.DescribeImagesInput{ExecutableUsers: []string{"self"}}, func(options *ec2.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeImages(ctx, &ec2.DescribeImagesInput{ExecutableUsers: []string{"self"}}) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/instance_statuses.go b/resources/services/ec2/instance_statuses.go index 8dbd9a8e0..34d3f4019 100644 --- a/resources/services/ec2/instance_statuses.go +++ b/resources/services/ec2/instance_statuses.go @@ -153,9 +153,7 @@ func fetchEc2InstanceStatuses(ctx context.Context, meta schema.ClientMeta, paren c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeInstanceStatus(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeInstanceStatus(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/internet_gateways.go b/resources/services/ec2/internet_gateways.go index 8e341eee8..d7a9fe734 100644 --- a/resources/services/ec2/internet_gateways.go +++ b/resources/services/ec2/internet_gateways.go @@ -95,9 +95,7 @@ func fetchEc2InternetGateways(ctx context.Context, meta schema.ClientMeta, paren c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeInternetGateways(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeInternetGateways(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/nat_gateways.go b/resources/services/ec2/nat_gateways.go index 0255a749b..6cd56d982 100644 --- a/resources/services/ec2/nat_gateways.go +++ b/resources/services/ec2/nat_gateways.go @@ -173,9 +173,7 @@ func fetchEc2NatGateways(ctx context.Context, meta schema.ClientMeta, parent *sc c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeNatGateways(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeNatGateways(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/network_acls.go b/resources/services/ec2/network_acls.go index 580743e09..0c6bb62af 100644 --- a/resources/services/ec2/network_acls.go +++ b/resources/services/ec2/network_acls.go @@ -176,9 +176,7 @@ func fetchEc2NetworkAcls(ctx context.Context, meta schema.ClientMeta, parent *sc c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeNetworkAcls(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeNetworkAcls(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/route_tables.go b/resources/services/ec2/route_tables.go index 81359a1c9..621134ee1 100644 --- a/resources/services/ec2/route_tables.go +++ b/resources/services/ec2/route_tables.go @@ -242,9 +242,7 @@ func fetchEc2RouteTables(ctx context.Context, meta schema.ClientMeta, parent *sc c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeRouteTables(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeRouteTables(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/subnets.go b/resources/services/ec2/subnets.go index d24cfa6c1..42ad76b75 100644 --- a/resources/services/ec2/subnets.go +++ b/resources/services/ec2/subnets.go @@ -168,9 +168,7 @@ func fetchEc2Subnets(ctx context.Context, meta schema.ClientMeta, parent *schema c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeSubnets(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeSubnets(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/transit_gateways.go b/resources/services/ec2/transit_gateways.go index 62ac974cd..a1b2011a8 100644 --- a/resources/services/ec2/transit_gateways.go +++ b/resources/services/ec2/transit_gateways.go @@ -388,9 +388,7 @@ func fetchEc2TransitGateways(ctx context.Context, meta schema.ClientMeta, parent c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeTransitGateways(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeTransitGateways(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -417,9 +415,7 @@ func fetchEc2TransitGatewayAttachments(ctx context.Context, meta schema.ClientMe c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeTransitGatewayAttachments(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeTransitGatewayAttachments(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -446,9 +442,7 @@ func fetchEc2TransitGatewayRouteTables(ctx context.Context, meta schema.ClientMe c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeTransitGatewayRouteTables(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeTransitGatewayRouteTables(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -475,9 +469,7 @@ func fetchEc2TransitGatewayVpcAttachments(ctx context.Context, meta schema.Clien c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeTransitGatewayVpcAttachments(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeTransitGatewayVpcAttachments(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -505,9 +497,7 @@ func fetchEc2TransitGatewayPeeringAttachments(ctx context.Context, meta schema.C c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeTransitGatewayPeeringAttachments(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeTransitGatewayPeeringAttachments(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -535,9 +525,7 @@ func fetchEc2TransitGatewayMulticastDomains(ctx context.Context, meta schema.Cli c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeTransitGatewayMulticastDomains(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeTransitGatewayMulticastDomains(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/vpc_endpoint_service_configuration.go b/resources/services/ec2/vpc_endpoint_service_configuration.go index 8a0b0b376..256ea6d06 100644 --- a/resources/services/ec2/vpc_endpoint_service_configuration.go +++ b/resources/services/ec2/vpc_endpoint_service_configuration.go @@ -149,9 +149,7 @@ func fetchEc2VpcEndpointServiceConfigurations(ctx context.Context, meta schema.C c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeVpcEndpointServiceConfigurations(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeVpcEndpointServiceConfigurations(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/vpc_endpoint_services.go b/resources/services/ec2/vpc_endpoint_services.go index 803acf5d3..045c6ae68 100644 --- a/resources/services/ec2/vpc_endpoint_services.go +++ b/resources/services/ec2/vpc_endpoint_services.go @@ -127,9 +127,7 @@ func fetchEc2VpcEndpointServices(ctx context.Context, meta schema.ClientMeta, _ c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeVpcEndpointServices(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeVpcEndpointServices(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ec2/vpcs.go b/resources/services/ec2/vpcs.go index bef4eec77..de9c6fe3d 100644 --- a/resources/services/ec2/vpcs.go +++ b/resources/services/ec2/vpcs.go @@ -179,9 +179,7 @@ func fetchEc2Vpcs(ctx context.Context, meta schema.ClientMeta, parent *schema.Re c := meta.(*client.Client) svc := c.Services().EC2 for { - output, err := svc.DescribeVpcs(ctx, &config, func(options *ec2.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeVpcs(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ecr/repositories.go b/resources/services/ecr/repositories.go index c6b245f62..5fc7f115a 100644 --- a/resources/services/ecr/repositories.go +++ b/resources/services/ecr/repositories.go @@ -207,9 +207,7 @@ func fetchEcrRepositories(ctx context.Context, meta schema.ClientMeta, parent *s c := meta.(*client.Client) svc := c.Services().ECR for { - output, err := svc.DescribeRepositories(ctx, &config, func(options *ecr.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeRepositories(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -246,9 +244,7 @@ func fetchEcrRepositoryImages(ctx context.Context, meta schema.ClientMeta, paren c := meta.(*client.Client) svc := c.Services().ECR for { - output, err := svc.DescribeImages(ctx, &config, func(options *ecr.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeImages(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ecs/task_definitions.go b/resources/services/ecs/task_definitions.go index c87a9fb4a..dc94dbcac 100644 --- a/resources/services/ecs/task_definitions.go +++ b/resources/services/ecs/task_definitions.go @@ -618,8 +618,6 @@ func ecsTaskDefinitionDetail(ctx context.Context, meta schema.ClientMeta, result describeTaskDefinitionOutput, err := svc.DescribeTaskDefinition(ctx, &ecs.DescribeTaskDefinitionInput{ TaskDefinition: aws.String(taskArn), Include: []types.TaskDefinitionField{types.TaskDefinitionFieldTags}, - }, func(o *ecs.Options) { - o.Region = c.Region }) if err != nil { errorChan <- diag.WrapError(err) diff --git a/resources/services/efs/filesystems.go b/resources/services/efs/filesystems.go index 5efec6879..56a37066f 100644 --- a/resources/services/efs/filesystems.go +++ b/resources/services/efs/filesystems.go @@ -160,9 +160,7 @@ func fetchEfsFilesystems(ctx context.Context, meta schema.ClientMeta, parent *sc c := meta.(*client.Client) svc := c.Services().EFS for { - response, err := svc.DescribeFileSystems(ctx, &config, func(options *efs.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeFileSystems(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -181,9 +179,7 @@ func ResolveEfsFilesystemBackupPolicyStatus(ctx context.Context, meta schema.Cli } cl := meta.(*client.Client) svc := cl.Services().EFS - response, err := svc.DescribeBackupPolicy(ctx, &config, func(options *efs.Options) { - options.Region = cl.Region - }) + response, err := svc.DescribeBackupPolicy(ctx, &config) if err != nil { if cl.IsNotFoundError(err) { return diag.WrapError(resource.Set(c.Name, types.StatusDisabled)) diff --git a/resources/services/eks/clusters.go b/resources/services/eks/clusters.go index 8834da693..ed7c52739 100644 --- a/resources/services/eks/clusters.go +++ b/resources/services/eks/clusters.go @@ -206,9 +206,7 @@ func fetchEksClusters(ctx context.Context, meta schema.ClientMeta, parent *schem c := meta.(*client.Client) svc := c.Services().Eks for { - listClustersOutput, err := svc.ListClusters(ctx, &config, func(options *eks.Options) { - options.Region = c.Region - }) + listClustersOutput, err := svc.ListClusters(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/elasticbeanstalk/application_versions.go b/resources/services/elasticbeanstalk/application_versions.go index 17f6885f9..c148b7c92 100644 --- a/resources/services/elasticbeanstalk/application_versions.go +++ b/resources/services/elasticbeanstalk/application_versions.go @@ -120,9 +120,7 @@ func fetchElasticbeanstalkApplicationVersions(ctx context.Context, meta schema.C svc := c.Services().ElasticBeanstalk for { - output, err := svc.DescribeApplicationVersions(ctx, &config, func(options *elasticbeanstalk.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeApplicationVersions(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/elasticbeanstalk/applications.go b/resources/services/elasticbeanstalk/applications.go index 29cbdabf4..09444af26 100644 --- a/resources/services/elasticbeanstalk/applications.go +++ b/resources/services/elasticbeanstalk/applications.go @@ -122,9 +122,7 @@ func fetchElasticbeanstalkApplications(ctx context.Context, meta schema.ClientMe var config elasticbeanstalk.DescribeApplicationsInput c := meta.(*client.Client) svc := c.Services().ElasticBeanstalk - output, err := svc.DescribeApplications(ctx, &config, func(options *elasticbeanstalk.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeApplications(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/elasticbeanstalk/environments.go b/resources/services/elasticbeanstalk/environments.go index 43611b00c..de57d08ae 100644 --- a/resources/services/elasticbeanstalk/environments.go +++ b/resources/services/elasticbeanstalk/environments.go @@ -406,9 +406,7 @@ func fetchElasticbeanstalkEnvironments(ctx context.Context, meta schema.ClientMe c := meta.(*client.Client) svc := c.Services().ElasticBeanstalk for { - response, err := svc.DescribeEnvironments(ctx, &config, func(options *elasticbeanstalk.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeEnvironments(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -464,9 +462,7 @@ func fetchElasticbeanstalkConfigurationOptions(ctx context.Context, meta schema. ApplicationName: p.ApplicationName, EnvironmentName: p.EnvironmentName, } - output, err := svc.DescribeConfigurationOptions(ctx, &configOptionsIn, func(options *elasticbeanstalk.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeConfigurationOptions(ctx, &configOptionsIn) if err != nil { // It takes a few minutes for an environment to be terminated // This ensures we don't error while trying to fetch related resources for a terminated environment @@ -495,9 +491,7 @@ func fetchElasticbeanstalkConfigurationSettings(ctx context.Context, meta schema ApplicationName: p.ApplicationName, EnvironmentName: p.EnvironmentName, } - output, err := svc.DescribeConfigurationSettings(ctx, &configOptionsIn, func(options *elasticbeanstalk.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeConfigurationSettings(ctx, &configOptionsIn) if err != nil { // It takes a few minutes for an environment to be terminated // This ensures we don't error while trying to fetch related resources for a terminated environment diff --git a/resources/services/elbv1/load_balancers.go b/resources/services/elbv1/load_balancers.go index 89f6096d8..4eef7ce88 100644 --- a/resources/services/elbv1/load_balancers.go +++ b/resources/services/elbv1/load_balancers.go @@ -429,9 +429,7 @@ func fetchElbv1LoadBalancers(ctx context.Context, meta schema.ClientMeta, parent var config elbv1.DescribeLoadBalancersInput for { - response, err := svc.DescribeLoadBalancers(ctx, &config, func(options *elbv1.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeLoadBalancers(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/elbv2/listeners.go b/resources/services/elbv2/listeners.go index 553e1d06b..69d83ffbd 100644 --- a/resources/services/elbv2/listeners.go +++ b/resources/services/elbv2/listeners.go @@ -360,9 +360,7 @@ func fetchElbv2Listeners(ctx context.Context, meta schema.ClientMeta, parent *sc c := meta.(*client.Client) svc := c.Services().ELBv2 for { - response, err := svc.DescribeListeners(ctx, &config, func(options *elbv2.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeListeners(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil diff --git a/resources/services/elbv2/load_balancers.go b/resources/services/elbv2/load_balancers.go index 1c64d4c99..86035d780 100644 --- a/resources/services/elbv2/load_balancers.go +++ b/resources/services/elbv2/load_balancers.go @@ -310,9 +310,7 @@ func fetchElbv2LoadBalancers(ctx context.Context, meta schema.ClientMeta, parent c := meta.(*client.Client) svc := c.Services().ELBv2 for { - response, err := svc.DescribeLoadBalancers(ctx, &config, func(options *elbv2.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeLoadBalancers(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/elbv2/target_groups.go b/resources/services/elbv2/target_groups.go index 3e3d9da00..228a0c464 100644 --- a/resources/services/elbv2/target_groups.go +++ b/resources/services/elbv2/target_groups.go @@ -202,9 +202,7 @@ func fetchElbv2TargetGroups(ctx context.Context, meta schema.ClientMeta, parent c := meta.(*client.Client) svc := c.Services().ELBv2 for { - response, err := svc.DescribeTargetGroups(ctx, &config, func(options *elbv2.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeTargetGroups(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/emr/block_public_access_configs.go b/resources/services/emr/block_public_access_configs.go index e37724da5..8ce797606 100644 --- a/resources/services/emr/block_public_access_configs.go +++ b/resources/services/emr/block_public_access_configs.go @@ -104,9 +104,7 @@ func EmrBlockPublicAccessConfigs() *schema.Table { func fetchEmrBlockPublicAccessConfigs(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { c := meta.(*client.Client) svc := c.Services().EMR - out, err := svc.GetBlockPublicAccessConfiguration(ctx, &emr.GetBlockPublicAccessConfigurationInput{}, func(options *emr.Options) { - options.Region = c.Region - }) + out, err := svc.GetBlockPublicAccessConfiguration(ctx, &emr.GetBlockPublicAccessConfigurationInput{}) if err != nil { if client.IgnoreNotAvailableRegion(err) { meta.Logger().Debug("received InvalidRequestException on GetBlockPublicAccessConfiguration, api is not available in the current Region.", "err", err) diff --git a/resources/services/emr/clusters.go b/resources/services/emr/clusters.go index 52c548f10..fa75d5c63 100644 --- a/resources/services/emr/clusters.go +++ b/resources/services/emr/clusters.go @@ -328,9 +328,7 @@ func fetchEmrClusters(ctx context.Context, meta schema.ClientMeta, parent *schem c := meta.(*client.Client) svc := c.Services().EMR for { - response, err := svc.ListClusters(ctx, &config, func(options *emr.Options) { - options.Region = c.Region - }) + response, err := svc.ListClusters(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/fsx/backups.go b/resources/services/fsx/backups.go index 7ac7c430f..0e111ca36 100644 --- a/resources/services/fsx/backups.go +++ b/resources/services/fsx/backups.go @@ -108,9 +108,7 @@ func fetchFsxBackups(ctx context.Context, meta schema.ClientMeta, parent *schema c := meta.(*client.Client) svc := c.Services().FSX for { - response, err := svc.DescribeBackups(ctx, &config, func(options *fsx.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeBackups(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/glue/crawlers.go b/resources/services/glue/crawlers.go index 819271123..81464afcb 100644 --- a/resources/services/glue/crawlers.go +++ b/resources/services/glue/crawlers.go @@ -392,9 +392,7 @@ func fetchGlueCrawlers(ctx context.Context, meta schema.ClientMeta, parent *sche svc := c.Services().Glue input := glue.GetCrawlersInput{} for { - output, err := svc.GetCrawlers(ctx, &input, func(o *glue.Options) { - o.Region = c.Region - }) + output, err := svc.GetCrawlers(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -419,9 +417,7 @@ func resolveGlueCrawlerTags(ctx context.Context, meta schema.ClientMeta, resourc ResourceArn: aws.String(crawlerARN(cl, aws.ToString(resource.Item.(types.Crawler).Name))), } - response, err := svc.GetTags(ctx, &input, func(options *glue.Options) { - options.Region = cl.Region - }) + response, err := svc.GetTags(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/guardduty/detectors.go b/resources/services/guardduty/detectors.go index aef436cca..563638d10 100644 --- a/resources/services/guardduty/detectors.go +++ b/resources/services/guardduty/detectors.go @@ -172,9 +172,7 @@ func fetchGuarddutyDetectors(ctx context.Context, meta schema.ClientMeta, parent svc := c.Services().GuardDuty config := &guardduty.ListDetectorsInput{} for { - output, err := svc.ListDetectors(ctx, config, func(o *guardduty.Options) { - o.Region = c.Region - }) + output, err := svc.ListDetectors(ctx, config) if err != nil { return diag.WrapError(err) } @@ -200,9 +198,7 @@ func fetchGuarddutyDetectorMembers(ctx context.Context, meta schema.ClientMeta, svc := c.Services().GuardDuty config := &guardduty.ListMembersInput{DetectorId: aws.String(detector.Id)} for { - output, err := svc.ListMembers(ctx, config, func(options *guardduty.Options) { - options.Region = c.Region - }) + output, err := svc.ListMembers(ctx, config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/iot/iot_billing_groups.go b/resources/services/iot/iot_billing_groups.go index a5c41a2a5..436f9e89c 100644 --- a/resources/services/iot/iot_billing_groups.go +++ b/resources/services/iot/iot_billing_groups.go @@ -96,9 +96,7 @@ func fetchIotBillingGroups(ctx context.Context, meta schema.ClientMeta, parent * svc := c.Services().IOT for { - response, err := svc.ListBillingGroups(ctx, &input, func(options *iot.Options) { - options.Region = c.Region - }) + response, err := svc.ListBillingGroups(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -132,9 +130,7 @@ func ResolveIotBillingGroupThingsInGroup(ctx context.Context, meta schema.Client var things []string for { - response, err := svc.ListThingsInBillingGroup(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListThingsInBillingGroup(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -158,9 +154,7 @@ func ResolveIotBillingGroupTags(ctx context.Context, meta schema.ClientMeta, res tags := make(map[string]string) for { - response, err := svc.ListTagsForResource(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListTagsForResource(ctx, &input) if err != nil { return diag.WrapError(err) diff --git a/resources/services/iot/iot_ca_certificates.go b/resources/services/iot/iot_ca_certificates.go index bfc449a2f..939ddce94 100644 --- a/resources/services/iot/iot_ca_certificates.go +++ b/resources/services/iot/iot_ca_certificates.go @@ -121,9 +121,7 @@ func fetchIotCaCertificates(ctx context.Context, meta schema.ClientMeta, parent svc := c.Services().IOT for { - response, err := svc.ListCACertificates(ctx, &input, func(options *iot.Options) { - options.Region = c.Region - }) + response, err := svc.ListCACertificates(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -156,9 +154,7 @@ func ResolveIotCaCertificateCertificates(ctx context.Context, meta schema.Client var certs []string for { - response, err := svc.ListCertificatesByCA(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListCertificatesByCA(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/iot/iot_certificates.go b/resources/services/iot/iot_certificates.go index fbe24bf6d..4654fc4dc 100644 --- a/resources/services/iot/iot_certificates.go +++ b/resources/services/iot/iot_certificates.go @@ -168,9 +168,7 @@ func fetchIotCertificates(ctx context.Context, meta schema.ClientMeta, parent *s } for { - response, err := svc.ListCertificates(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListCertificates(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -205,9 +203,7 @@ func ResolveIotCertificatePolicies(ctx context.Context, meta schema.ClientMeta, var policies []string for { - response, err := svc.ListAttachedPolicies(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListAttachedPolicies(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/iot/iot_jobs.go b/resources/services/iot/iot_jobs.go index f8d22ddb6..192392453 100644 --- a/resources/services/iot/iot_jobs.go +++ b/resources/services/iot/iot_jobs.go @@ -269,9 +269,7 @@ func fetchIotJobs(ctx context.Context, meta schema.ClientMeta, parent *schema.Re } for { - response, err := svc.ListJobs(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListJobs(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -305,9 +303,7 @@ func ResolveIotJobTags(ctx context.Context, meta schema.ClientMeta, resource *sc tags := make(map[string]string) for { - response, err := svc.ListTagsForResource(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListTagsForResource(ctx, &input) if err != nil { return diag.WrapError(err) diff --git a/resources/services/iot/iot_policies.go b/resources/services/iot/iot_policies.go index fa55a2428..bb65c7f97 100644 --- a/resources/services/iot/iot_policies.go +++ b/resources/services/iot/iot_policies.go @@ -92,9 +92,7 @@ func fetchIotPolicies(ctx context.Context, meta schema.ClientMeta, parent *schem } for { - response, err := svc.ListPolicies(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListPolicies(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -128,9 +126,7 @@ func ResolveIotPolicyTags(ctx context.Context, meta schema.ClientMeta, resource tags := make(map[string]string) for { - response, err := svc.ListTagsForResource(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListTagsForResource(ctx, &input) if err != nil { return diag.WrapError(err) diff --git a/resources/services/iot/iot_security_profiles.go b/resources/services/iot/iot_security_profiles.go index 08b7c3a9b..48af2965e 100644 --- a/resources/services/iot/iot_security_profiles.go +++ b/resources/services/iot/iot_security_profiles.go @@ -192,9 +192,7 @@ func fetchIotSecurityProfiles(ctx context.Context, meta schema.ClientMeta, paren } for { - response, err := svc.ListSecurityProfiles(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListSecurityProfiles(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -229,9 +227,7 @@ func ResolveIotSecurityProfileTargets(ctx context.Context, meta schema.ClientMet var targets []string for { - response, err := svc.ListTargetsForSecurityProfile(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListTargetsForSecurityProfile(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -257,9 +253,7 @@ func ResolveIotSecurityProfileTags(ctx context.Context, meta schema.ClientMeta, tags := make(map[string]string) for { - response, err := svc.ListTagsForResource(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListTagsForResource(ctx, &input) if err != nil { return diag.WrapError(err) diff --git a/resources/services/iot/iot_streams.go b/resources/services/iot/iot_streams.go index a69579e9f..6cddd09c9 100644 --- a/resources/services/iot/iot_streams.go +++ b/resources/services/iot/iot_streams.go @@ -126,9 +126,7 @@ func fetchIotStreams(ctx context.Context, meta schema.ClientMeta, parent *schema svc := c.Services().IOT for { - response, err := svc.ListStreams(ctx, &input, func(options *iot.Options) { - options.Region = c.Region - }) + response, err := svc.ListStreams(ctx, &input) if err != nil { return diags.Add(diag.FromError(diag.WrapError(err), diag.RESOLVING, diag.WithSeverity(diag.ERROR))) } diff --git a/resources/services/iot/iot_thing_groups.go b/resources/services/iot/iot_thing_groups.go index f80567e12..d19ef7ed0 100644 --- a/resources/services/iot/iot_thing_groups.go +++ b/resources/services/iot/iot_thing_groups.go @@ -149,9 +149,7 @@ func fetchIotThingGroups(ctx context.Context, meta schema.ClientMeta, parent *sc svc := c.Services().IOT for { - response, err := svc.ListThingGroups(ctx, &input, func(options *iot.Options) { - options.Region = c.Region - }) + response, err := svc.ListThingGroups(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -185,9 +183,7 @@ func ResolveIotThingGroupThingsInGroup(ctx context.Context, meta schema.ClientMe var things []string for { - response, err := svc.ListThingsInThingGroup(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListThingsInThingGroup(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -212,9 +208,7 @@ func ResolveIotThingGroupPolicies(ctx context.Context, meta schema.ClientMeta, r var policies []string for { - response, err := svc.ListAttachedPolicies(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListAttachedPolicies(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -240,9 +234,7 @@ func ResolveIotThingGroupTags(ctx context.Context, meta schema.ClientMeta, resou tags := make(map[string]string) for { - response, err := svc.ListTagsForResource(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListTagsForResource(ctx, &input) if err != nil { return diag.WrapError(err) diff --git a/resources/services/iot/iot_thing_types.go b/resources/services/iot/iot_thing_types.go index bef0ad6a5..5cc086d90 100644 --- a/resources/services/iot/iot_thing_types.go +++ b/resources/services/iot/iot_thing_types.go @@ -100,9 +100,7 @@ func fetchIotThingTypes(ctx context.Context, meta schema.ClientMeta, parent *sch svc := c.Services().IOT for { - response, err := svc.ListThingTypes(ctx, &input, func(options *iot.Options) { - options.Region = c.Region - }) + response, err := svc.ListThingTypes(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -126,9 +124,7 @@ func ResolveIotThingTypeTags(ctx context.Context, meta schema.ClientMeta, resour tags := make(map[string]string) for { - response, err := svc.ListTagsForResource(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListTagsForResource(ctx, &input) if err != nil { return diag.WrapError(err) diff --git a/resources/services/iot/iot_things.go b/resources/services/iot/iot_things.go index 1c1045d2d..7b1b824e3 100644 --- a/resources/services/iot/iot_things.go +++ b/resources/services/iot/iot_things.go @@ -84,9 +84,7 @@ func fetchIotThings(ctx context.Context, meta schema.ClientMeta, parent *schema. svc := c.Services().IOT for { - response, err := svc.ListThings(ctx, &input, func(options *iot.Options) { - options.Region = c.Region - }) + response, err := svc.ListThings(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -109,9 +107,7 @@ func ResolveIotThingPrincipals(ctx context.Context, meta schema.ClientMeta, reso var principals []string for { - response, err := svc.ListThingPrincipals(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListThingPrincipals(ctx, &input) if err != nil { return diag.WrapError(err) diff --git a/resources/services/iot/iot_topic_rules.go b/resources/services/iot/iot_topic_rules.go index 282465c6c..55a55451b 100644 --- a/resources/services/iot/iot_topic_rules.go +++ b/resources/services/iot/iot_topic_rules.go @@ -1310,9 +1310,7 @@ func fetchIotTopicRules(ctx context.Context, meta schema.ClientMeta, parent *sch } for { - response, err := svc.ListTopicRules(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListTopicRules(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -1346,9 +1344,7 @@ func ResolveIotTopicRuleTags(ctx context.Context, meta schema.ClientMeta, resour tags := make(map[string]string) for { - response, err := svc.ListTagsForResource(ctx, &input, func(options *iot.Options) { - options.Region = cl.Region - }) + response, err := svc.ListTagsForResource(ctx, &input) if err != nil { return diag.WrapError(err) diff --git a/resources/services/kms/keys.go b/resources/services/kms/keys.go index 30591ccad..c747184ed 100644 --- a/resources/services/kms/keys.go +++ b/resources/services/kms/keys.go @@ -202,9 +202,7 @@ func fetchKmsKeys(ctx context.Context, meta schema.ClientMeta, parent *schema.Re c := meta.(*client.Client) svc := c.Services().KMS for { - response, err := svc.ListKeys(ctx, &input, func(options *kms.Options) { - options.Region = c.Region - }) + response, err := svc.ListKeys(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -250,9 +248,7 @@ func resolveKeysTags(ctx context.Context, meta schema.ClientMeta, resource *sche params := kms.ListResourceTagsInput{KeyId: key.KeyId} tags := make(map[string]string) for { - result, err := svc.ListResourceTags(ctx, ¶ms, func(options *kms.Options) { - options.Region = cl.Region - }) + result, err := svc.ListResourceTags(ctx, ¶ms) if err != nil { return diag.WrapError(err) } @@ -273,9 +269,7 @@ func resolveKeysRotationEnabled(ctx context.Context, meta schema.ClientMeta, res if key.Origin == "EXTERNAL" || key.KeyManager == "AWS" { return nil } - result, err := svc.GetKeyRotationStatus(ctx, &kms.GetKeyRotationStatusInput{KeyId: key.KeyId}, func(options *kms.Options) { - options.Region = cl.Region - }) + result, err := svc.GetKeyRotationStatus(ctx, &kms.GetKeyRotationStatusInput{KeyId: key.KeyId}) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lambda/functions.go b/resources/services/lambda/functions.go index 250f5d04a..49db6f9d4 100644 --- a/resources/services/lambda/functions.go +++ b/resources/services/lambda/functions.go @@ -1094,9 +1094,7 @@ func fetchLambdaFunctions(ctx context.Context, meta schema.ClientMeta, parent *s c := meta.(*client.Client) svc := c.Services().Lambda for { - response, err := svc.ListFunctions(ctx, &input, func(options *lambda.Options) { - options.Region = c.Region - }) + response, err := svc.ListFunctions(ctx, &input) if err != nil { return diags.Add(diag.FromError(diag.WrapError(err), diag.RESOLVING, diag.WithSeverity(diag.ERROR))) } @@ -1140,8 +1138,6 @@ func resolvePolicyCodeSigningConfig(ctx context.Context, meta schema.ClientMeta, response, err := svc.GetPolicy(ctx, &lambda.GetPolicyInput{ FunctionName: r.Configuration.FunctionName, - }, func(options *lambda.Options) { - options.Region = c.Region }) if err != nil { if client.IsAWSError(err, "ResourceNotFoundException") { @@ -1173,8 +1169,6 @@ func resolvePolicyCodeSigningConfig(ctx context.Context, meta schema.ClientMeta, functionSigning, err := svc.GetFunctionCodeSigningConfig(ctx, &lambda.GetFunctionCodeSigningConfigInput{ FunctionName: r.Configuration.FunctionName, - }, func(options *lambda.Options) { - options.Region = c.Region }) if err != nil { return diag.WrapError(err) @@ -1185,8 +1179,6 @@ func resolvePolicyCodeSigningConfig(ctx context.Context, meta schema.ClientMeta, signing, err := svc.GetCodeSigningConfig(ctx, &lambda.GetCodeSigningConfigInput{ CodeSigningConfigArn: functionSigning.CodeSigningConfigArn, - }, func(options *lambda.Options) { - options.Region = c.Region }) if err != nil { if c.IsNotFoundError(err) { diff --git a/resources/services/lambda/layers.go b/resources/services/lambda/layers.go index 2cc77762e..9577d98c2 100644 --- a/resources/services/lambda/layers.go +++ b/resources/services/lambda/layers.go @@ -177,9 +177,7 @@ func fetchLambdaLayers(ctx context.Context, meta schema.ClientMeta, parent *sche c := meta.(*client.Client) svc := c.Services().Lambda for { - response, err := svc.ListLayers(ctx, &input, func(options *lambda.Options) { - options.Region = c.Region - }) + response, err := svc.ListLayers(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lightsail/alarms.go b/resources/services/lightsail/alarms.go index 80b99aec5..eb07dec25 100644 --- a/resources/services/lightsail/alarms.go +++ b/resources/services/lightsail/alarms.go @@ -161,9 +161,7 @@ func fetchLightsailAlarms(ctx context.Context, meta schema.ClientMeta, parent *s c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetAlarms(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetAlarms(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lightsail/buckets.go b/resources/services/lightsail/buckets.go index 64d428d97..39721b34a 100644 --- a/resources/services/lightsail/buckets.go +++ b/resources/services/lightsail/buckets.go @@ -221,9 +221,7 @@ func fetchLightsailBuckets(ctx context.Context, meta schema.ClientMeta, parent * c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetBuckets(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetBuckets(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -242,9 +240,7 @@ func fetchLightsailBucketAccessKeys(ctx context.Context, meta schema.ClientMeta, input := lightsail.GetBucketAccessKeysInput{ BucketName: r.Name, } - response, err := svc.GetBucketAccessKeys(ctx, &input, func(options *lightsail.Options) { - options.Region = cl.Region - }) + response, err := svc.GetBucketAccessKeys(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lightsail/certificates.go b/resources/services/lightsail/certificates.go index ba6330ba2..7e207ee90 100644 --- a/resources/services/lightsail/certificates.go +++ b/resources/services/lightsail/certificates.go @@ -246,9 +246,7 @@ func fetchLightsailCertificates(ctx context.Context, meta schema.ClientMeta, par } c := meta.(*client.Client) svc := c.Services().Lightsail - response, err := svc.GetCertificates(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetCertificates(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lightsail/container_services.go b/resources/services/lightsail/container_services.go index 9165384a4..c651aa0dc 100644 --- a/resources/services/lightsail/container_services.go +++ b/resources/services/lightsail/container_services.go @@ -320,9 +320,7 @@ func fetchLightsailContainerServices(ctx context.Context, meta schema.ClientMeta var input lightsail.GetContainerServicesInput c := meta.(*client.Client) svc := c.Services().Lightsail - response, err := svc.GetContainerServices(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetContainerServices(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -336,9 +334,7 @@ func fetchLightsailContainerServiceDeployments(ctx context.Context, meta schema. } c := meta.(*client.Client) svc := c.Services().Lightsail - deployments, err := svc.GetContainerServiceDeployments(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + deployments, err := svc.GetContainerServiceDeployments(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -352,9 +348,7 @@ func fetchLightsailContainerServiceImages(ctx context.Context, meta schema.Clien } c := meta.(*client.Client) svc := c.Services().Lightsail - deployments, err := svc.GetContainerImages(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + deployments, err := svc.GetContainerImages(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lightsail/database_snapshots.go b/resources/services/lightsail/database_snapshots.go index 6b9aa7ba1..1680523dc 100644 --- a/resources/services/lightsail/database_snapshots.go +++ b/resources/services/lightsail/database_snapshots.go @@ -124,9 +124,7 @@ func fetchLightsailDatabaseSnapshots(ctx context.Context, meta schema.ClientMeta c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetRelationalDatabaseSnapshots(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetRelationalDatabaseSnapshots(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lightsail/databases.go b/resources/services/lightsail/databases.go index 6c4da7bf0..0c0504acb 100644 --- a/resources/services/lightsail/databases.go +++ b/resources/services/lightsail/databases.go @@ -347,9 +347,7 @@ func fetchLightsailDatabases(ctx context.Context, meta schema.ClientMeta, parent c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetRelationalDatabases(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetRelationalDatabases(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -374,9 +372,7 @@ func fetchLightsailDatabaseParameters(ctx context.Context, meta schema.ClientMet c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetRelationalDatabaseParameters(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetRelationalDatabaseParameters(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -397,9 +393,7 @@ func fetchLightsailDatabaseEvents(ctx context.Context, meta schema.ClientMeta, p c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetRelationalDatabaseEvents(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetRelationalDatabaseEvents(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -418,9 +412,7 @@ func fetchLightsailDatabaseLogEvents(ctx context.Context, meta schema.ClientMeta } c := meta.(*client.Client) svc := c.Services().Lightsail - streams, err := svc.GetRelationalDatabaseLogStreams(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + streams, err := svc.GetRelationalDatabaseLogStreams(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -455,9 +447,7 @@ func fetchLogEvents(ctx context.Context, res chan<- interface{}, c *client.Clien EndTime: &endTime, } for { - response, err := svc.GetRelationalDatabaseLogEvents(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetRelationalDatabaseLogEvents(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lightsail/disks.go b/resources/services/lightsail/disks.go index 66b744889..4dddd1855 100644 --- a/resources/services/lightsail/disks.go +++ b/resources/services/lightsail/disks.go @@ -269,9 +269,7 @@ func fetchLightsailDisks(ctx context.Context, meta schema.ClientMeta, parent *sc c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetDisks(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetDisks(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -293,9 +291,7 @@ func fetchLightsailDiskSnapshots(ctx context.Context, meta schema.ClientMeta, pa c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetDiskSnapshots(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetDiskSnapshots(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lightsail/instance_snapshots.go b/resources/services/lightsail/instance_snapshots.go index 6716adb39..3caedc913 100644 --- a/resources/services/lightsail/instance_snapshots.go +++ b/resources/services/lightsail/instance_snapshots.go @@ -263,9 +263,7 @@ func fetchLightsailInstanceSnapshots(ctx context.Context, meta schema.ClientMeta c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetInstanceSnapshots(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetInstanceSnapshots(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lightsail/instances.go b/resources/services/lightsail/instances.go index 3c138219f..75cb731c5 100644 --- a/resources/services/lightsail/instances.go +++ b/resources/services/lightsail/instances.go @@ -456,9 +456,7 @@ func fetchLightsailInstances(ctx context.Context, meta schema.ClientMeta, parent svc := c.Services().Lightsail input := lightsail.GetInstancesInput{} for { - output, err := svc.GetInstances(ctx, &input, func(o *lightsail.Options) { - o.Region = c.Region - }) + output, err := svc.GetInstances(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -476,9 +474,7 @@ func ResolveLightsailInstanceAccessDetails(ctx context.Context, meta schema.Clie cli := meta.(*client.Client) svc := cli.Services().Lightsail input := lightsail.GetInstanceAccessDetailsInput{InstanceName: r.Name} - output, err := svc.GetInstanceAccessDetails(ctx, &input, func(o *lightsail.Options) { - o.Region = cli.Region - }) + output, err := svc.GetInstanceAccessDetails(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -519,9 +515,7 @@ func fetchLightsailInstancePortStates(ctx context.Context, meta schema.ClientMet cli := meta.(*client.Client) svc := cli.Services().Lightsail input := lightsail.GetInstancePortStatesInput{InstanceName: r.Name} - output, err := svc.GetInstancePortStates(ctx, &input, func(o *lightsail.Options) { - o.Region = cli.Region - }) + output, err := svc.GetInstancePortStates(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/lightsail/load_balancers.go b/resources/services/lightsail/load_balancers.go index f769bb2e1..f6f53d64e 100644 --- a/resources/services/lightsail/load_balancers.go +++ b/resources/services/lightsail/load_balancers.go @@ -343,9 +343,7 @@ func fetchLightsailLoadBalancers(ctx context.Context, meta schema.ClientMeta, pa c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetLoadBalancers(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetLoadBalancers(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -382,9 +380,7 @@ func fetchLightsailLoadBalancerTlsCertificates(ctx context.Context, meta schema. } c := meta.(*client.Client) svc := c.Services().Lightsail - response, err := svc.GetLoadBalancerTlsCertificates(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetLoadBalancerTlsCertificates(ctx, &input) if err != nil { if c.IsNotFoundError(err) { return nil diff --git a/resources/services/lightsail/static_ips.go b/resources/services/lightsail/static_ips.go index 7ec9e1321..4e263ab82 100644 --- a/resources/services/lightsail/static_ips.go +++ b/resources/services/lightsail/static_ips.go @@ -92,9 +92,7 @@ func fetchLightsailStaticIps(ctx context.Context, meta schema.ClientMeta, parent c := meta.(*client.Client) svc := c.Services().Lightsail for { - response, err := svc.GetStaticIps(ctx, &input, func(options *lightsail.Options) { - options.Region = c.Region - }) + response, err := svc.GetStaticIps(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/mq/brokers.go b/resources/services/mq/brokers.go index afadbdf98..bbb033534 100644 --- a/resources/services/mq/brokers.go +++ b/resources/services/mq/brokers.go @@ -371,9 +371,7 @@ func fetchMqBrokers(ctx context.Context, meta schema.ClientMeta, parent *schema. c := meta.(*client.Client) svc := c.Services().MQ for { - response, err := svc.ListBrokers(ctx, &config, func(options *mq.Options) { - options.Region = c.Region - }) + response, err := svc.ListBrokers(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -463,9 +461,7 @@ func fetchMqBrokerConfigurations(ctx context.Context, meta schema.ClientMeta, pa dupes[*cfg.Id] = struct{}{} input := mq.DescribeConfigurationInput{ConfigurationId: cfg.Id} - output, err := svc.DescribeConfiguration(ctx, &input, func(options *mq.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeConfiguration(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -481,9 +477,7 @@ func fetchMqBrokerConfigurationRevisions(ctx context.Context, meta schema.Client input := mq.ListConfigurationRevisionsInput{ConfigurationId: cfg.Id} for { - output, err := svc.ListConfigurationRevisions(ctx, &input, func(options *mq.Options) { - options.Region = c.Region - }) + output, err := svc.ListConfigurationRevisions(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -529,9 +523,7 @@ func fetchMqBrokerUsers(ctx context.Context, meta schema.ClientMeta, parent *sch BrokerId: broker.BrokerId, Username: us.Username, } - output, err := svc.DescribeUser(ctx, &input, func(options *mq.Options) { - options.Region = c.Region - }) + output, err := svc.DescribeUser(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/qldb/ledgers.go b/resources/services/qldb/ledgers.go index 833edc403..410b84a3e 100644 --- a/resources/services/qldb/ledgers.go +++ b/resources/services/qldb/ledgers.go @@ -257,9 +257,7 @@ func fetchQldbLedgers(ctx context.Context, meta schema.ClientMeta, _ *schema.Res svc := c.Services().QLDB config := qldb.ListLedgersInput{} for { - response, err := svc.ListLedgers(ctx, &config, func(options *qldb.Options) { - options.Region = c.Region - }) + response, err := svc.ListLedgers(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -291,8 +289,6 @@ func ResolveQldbLedgerTags(ctx context.Context, meta schema.ClientMeta, resource svc := cl.Services().QLDB response, err := svc.ListTagsForResource(ctx, &qldb.ListTagsForResourceInput{ ResourceArn: ledger.Arn, - }, func(options *qldb.Options) { - options.Region = cl.Region }) if err != nil { return diag.WrapError(err) @@ -307,9 +303,7 @@ func fetchQldbLedgerJournalKinesisStreams(ctx context.Context, meta schema.Clien MaxResults: aws.Int32(100), } for { - response, err := cl.Services().QLDB.ListJournalKinesisStreamsForLedger(ctx, config, func(options *qldb.Options) { - options.Region = cl.Region - }) + response, err := cl.Services().QLDB.ListJournalKinesisStreamsForLedger(ctx, config) if err != nil { return diag.WrapError(err) } @@ -331,9 +325,7 @@ func fetchQldbLedgerJournalS3Exports(ctx context.Context, meta schema.ClientMeta MaxResults: aws.Int32(100), } for { - response, err := cl.Services().QLDB.ListJournalS3ExportsForLedger(ctx, config, func(options *qldb.Options) { - options.Region = cl.Region - }) + response, err := cl.Services().QLDB.ListJournalS3ExportsForLedger(ctx, config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/rds/certificates.go b/resources/services/rds/certificates.go index 185b306fa..2d2193fde 100644 --- a/resources/services/rds/certificates.go +++ b/resources/services/rds/certificates.go @@ -85,9 +85,7 @@ func fetchRdsCertificates(ctx context.Context, meta schema.ClientMeta, parent *s c := meta.(*client.Client) svc := c.Services().RDS for { - response, err := svc.DescribeCertificates(ctx, &config, func(o *rds.Options) { - o.Region = c.Region - }) + response, err := svc.DescribeCertificates(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/rds/cluster_parameter_groups.go b/resources/services/rds/cluster_parameter_groups.go index a91d75b2c..b5e7e92e4 100644 --- a/resources/services/rds/cluster_parameter_groups.go +++ b/resources/services/rds/cluster_parameter_groups.go @@ -146,9 +146,7 @@ func fetchRdsClusterParameterGroups(ctx context.Context, meta schema.ClientMeta, svc := cl.Services().RDS var input rds.DescribeDBClusterParameterGroupsInput for { - output, err := svc.DescribeDBClusterParameterGroups(ctx, &input, func(o *rds.Options) { - o.Region = cl.Region - }) + output, err := svc.DescribeDBClusterParameterGroups(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -167,9 +165,7 @@ func fetchRdsClusterParameterGroupDbParameters(ctx context.Context, meta schema. g := parent.Item.(types.DBClusterParameterGroup) input := rds.DescribeDBClusterParametersInput{DBClusterParameterGroupName: g.DBClusterParameterGroupName} for { - output, err := svc.DescribeDBClusterParameters(ctx, &input, func(o *rds.Options) { - o.Region = cl.Region - }) + output, err := svc.DescribeDBClusterParameters(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -186,9 +182,7 @@ func resolveRdsClusterParameterGroupTags(ctx context.Context, meta schema.Client g := resource.Item.(types.DBClusterParameterGroup) cl := meta.(*client.Client) svc := cl.Services().RDS - out, err := svc.ListTagsForResource(ctx, &rds.ListTagsForResourceInput{ResourceName: g.DBClusterParameterGroupArn}, func(o *rds.Options) { - o.Region = cl.Region - }) + out, err := svc.ListTagsForResource(ctx, &rds.ListTagsForResourceInput{ResourceName: g.DBClusterParameterGroupArn}) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/rds/cluster_snapshots.go b/resources/services/rds/cluster_snapshots.go index 724be0e53..4e4ad990a 100644 --- a/resources/services/rds/cluster_snapshots.go +++ b/resources/services/rds/cluster_snapshots.go @@ -169,9 +169,7 @@ func fetchRdsClusterSnapshots(ctx context.Context, meta schema.ClientMeta, paren svc := c.Services().RDS var input rds.DescribeDBClusterSnapshotsInput for { - output, err := svc.DescribeDBClusterSnapshots(ctx, &input, func(o *rds.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeDBClusterSnapshots(ctx, &input) if err != nil { return nil } diff --git a/resources/services/rds/clusters.go b/resources/services/rds/clusters.go index 3aec18779..f55968e36 100644 --- a/resources/services/rds/clusters.go +++ b/resources/services/rds/clusters.go @@ -494,9 +494,7 @@ func fetchRdsClusters(ctx context.Context, meta schema.ClientMeta, parent *schem c := meta.(*client.Client) svc := c.Services().RDS for { - response, err := svc.DescribeDBClusters(ctx, &config, func(o *rds.Options) { - o.Region = c.Region - }) + response, err := svc.DescribeDBClusters(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/rds/db_parameter_groups.go b/resources/services/rds/db_parameter_groups.go index 5715fb1ea..6c58e61eb 100644 --- a/resources/services/rds/db_parameter_groups.go +++ b/resources/services/rds/db_parameter_groups.go @@ -146,9 +146,7 @@ func fetchRdsDbParameterGroups(ctx context.Context, meta schema.ClientMeta, pare svc := cl.Services().RDS var input rds.DescribeDBParameterGroupsInput for { - output, err := svc.DescribeDBParameterGroups(ctx, &input, func(o *rds.Options) { - o.Region = cl.Region - }) + output, err := svc.DescribeDBParameterGroups(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -167,9 +165,7 @@ func fetchRdsDbParameterGroupDbParameters(ctx context.Context, meta schema.Clien g := parent.Item.(types.DBParameterGroup) input := rds.DescribeDBParametersInput{DBParameterGroupName: g.DBParameterGroupName} for { - output, err := svc.DescribeDBParameters(ctx, &input, func(o *rds.Options) { - o.Region = cl.Region - }) + output, err := svc.DescribeDBParameters(ctx, &input) if err != nil { if client.IsAWSError(err, "DBParameterGroupNotFound") { cl.Logger().Debug("received DBParameterGroupNotFound on DescribeDBParameters", "region", cl.Region, "err", err) @@ -190,9 +186,7 @@ func resolveRdsDbParameterGroupTags(ctx context.Context, meta schema.ClientMeta, g := resource.Item.(types.DBParameterGroup) cl := meta.(*client.Client) svc := cl.Services().RDS - out, err := svc.ListTagsForResource(ctx, &rds.ListTagsForResourceInput{ResourceName: g.DBParameterGroupArn}, func(o *rds.Options) { - o.Region = cl.Region - }) + out, err := svc.ListTagsForResource(ctx, &rds.ListTagsForResourceInput{ResourceName: g.DBParameterGroupArn}) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/rds/db_security_groups.go b/resources/services/rds/db_security_groups.go index e0fc394cc..3a8bd5e2f 100644 --- a/resources/services/rds/db_security_groups.go +++ b/resources/services/rds/db_security_groups.go @@ -93,9 +93,7 @@ func fetchRdsDbSecurityGroups(ctx context.Context, meta schema.ClientMeta, paren svc := cl.Services().RDS var input rds.DescribeDBSecurityGroupsInput for { - output, err := svc.DescribeDBSecurityGroups(ctx, &input, func(o *rds.Options) { - o.Region = cl.Region - }) + output, err := svc.DescribeDBSecurityGroups(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -123,9 +121,7 @@ func resolveRdsDbSecurityGroupTags(ctx context.Context, meta schema.ClientMeta, g := resource.Item.(types.DBSecurityGroup) cl := meta.(*client.Client) svc := cl.Services().RDS - out, err := svc.ListTagsForResource(ctx, &rds.ListTagsForResourceInput{ResourceName: g.DBSecurityGroupArn}, func(o *rds.Options) { - o.Region = cl.Region - }) + out, err := svc.ListTagsForResource(ctx, &rds.ListTagsForResourceInput{ResourceName: g.DBSecurityGroupArn}) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/rds/db_snapshots.go b/resources/services/rds/db_snapshots.go index efd5ed5d4..93c694c47 100644 --- a/resources/services/rds/db_snapshots.go +++ b/resources/services/rds/db_snapshots.go @@ -210,9 +210,7 @@ func fetchRdsDbSnapshots(ctx context.Context, meta schema.ClientMeta, parent *sc svc := c.Services().RDS var input rds.DescribeDBSnapshotsInput for { - output, err := svc.DescribeDBSnapshots(ctx, &input, func(o *rds.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeDBSnapshots(ctx, &input) if err != nil { return nil } diff --git a/resources/services/rds/event_subscriptions.go b/resources/services/rds/event_subscriptions.go index 65866ba3d..3d2169942 100644 --- a/resources/services/rds/event_subscriptions.go +++ b/resources/services/rds/event_subscriptions.go @@ -103,9 +103,7 @@ func fetchRdsEventSubscriptions(ctx context.Context, meta schema.ClientMeta, par svc := cl.Services().RDS var input rds.DescribeEventSubscriptionsInput for { - out, err := svc.DescribeEventSubscriptions(ctx, &input, func(o *rds.Options) { - o.Region = cl.Region - }) + out, err := svc.DescribeEventSubscriptions(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -122,9 +120,7 @@ func resolveRDSEventSubscriptionTags(ctx context.Context, meta schema.ClientMeta s := resource.Item.(types.EventSubscription) cl := meta.(*client.Client) svc := cl.Services().RDS - out, err := svc.ListTagsForResource(ctx, &rds.ListTagsForResourceInput{ResourceName: s.EventSubscriptionArn}, func(o *rds.Options) { - o.Region = cl.Region - }) + out, err := svc.ListTagsForResource(ctx, &rds.ListTagsForResourceInput{ResourceName: s.EventSubscriptionArn}) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/rds/instances.go b/resources/services/rds/instances.go index 603f040e5..c84d5f312 100644 --- a/resources/services/rds/instances.go +++ b/resources/services/rds/instances.go @@ -754,9 +754,7 @@ func fetchRdsInstances(ctx context.Context, meta schema.ClientMeta, parent *sche c := meta.(*client.Client) svc := c.Services().RDS for { - response, err := svc.DescribeDBInstances(ctx, &config, func(o *rds.Options) { - o.Region = c.Region - }) + response, err := svc.DescribeDBInstances(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/rds/subnet_groups.go b/resources/services/rds/subnet_groups.go index caf766b85..5424e167d 100644 --- a/resources/services/rds/subnet_groups.go +++ b/resources/services/rds/subnet_groups.go @@ -112,9 +112,7 @@ func fetchRdsSubnetGroups(ctx context.Context, meta schema.ClientMeta, parent *s c := meta.(*client.Client) svc := c.Services().RDS for { - response, err := svc.DescribeDBSubnetGroups(ctx, &config, func(o *rds.Options) { - o.Region = c.Region - }) + response, err := svc.DescribeDBSubnetGroups(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/redshift/clusters.go b/resources/services/redshift/clusters.go index 74695d1af..4e6c9ea1c 100644 --- a/resources/services/redshift/clusters.go +++ b/resources/services/redshift/clusters.go @@ -791,9 +791,7 @@ func fetchRedshiftClusters(ctx context.Context, meta schema.ClientMeta, parent * c := meta.(*client.Client) svc := c.Services().Redshift for { - response, err := svc.DescribeClusters(ctx, &config, func(o *redshift.Options) { - o.Region = c.Region - }) + response, err := svc.DescribeClusters(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -814,9 +812,7 @@ func resolveRedshiftClusterLoggingStatus(ctx context.Context, meta schema.Client cfg := redshift.DescribeLoggingStatusInput{ ClusterIdentifier: r.ClusterIdentifier, } - response, err := svc.DescribeLoggingStatus(ctx, &cfg, func(o *redshift.Options) { - o.Region = cl.Region - }) + response, err := svc.DescribeLoggingStatus(ctx, &cfg) if err != nil { return diag.WrapError(err) } @@ -832,9 +828,7 @@ func fetchRedshiftClusterParameter(ctx context.Context, meta schema.ClientMeta, c := meta.(*client.Client) svc := c.Services().Redshift for { - response, err := svc.DescribeClusterParameters(ctx, &config, func(o *redshift.Options) { - o.Region = c.Region - }) + response, err := svc.DescribeClusterParameters(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/redshift/event_subscriptions.go b/resources/services/redshift/event_subscriptions.go index 010519804..1f624cd8e 100644 --- a/resources/services/redshift/event_subscriptions.go +++ b/resources/services/redshift/event_subscriptions.go @@ -111,9 +111,7 @@ func fetchRedshiftEventSubscriptions(ctx context.Context, meta schema.ClientMeta var params redshift.DescribeEventSubscriptionsInput params.MaxRecords = aws.Int32(100) for { - result, err := svc.DescribeEventSubscriptions(ctx, ¶ms, func(o *redshift.Options) { - o.Region = cl.Region - }) + result, err := svc.DescribeEventSubscriptions(ctx, ¶ms) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/redshift/snapshots.go b/resources/services/redshift/snapshots.go index b86f78075..c51a97794 100644 --- a/resources/services/redshift/snapshots.go +++ b/resources/services/redshift/snapshots.go @@ -247,9 +247,7 @@ func fetchRedshiftSnapshots(ctx context.Context, meta schema.ClientMeta, parent MaxRecords: aws.Int32(100), } for { - result, err := svc.DescribeClusterSnapshots(ctx, ¶ms, func(o *redshift.Options) { - o.Region = cl.Region - }) + result, err := svc.DescribeClusterSnapshots(ctx, ¶ms) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/redshift/subnet_groups.go b/resources/services/redshift/subnet_groups.go index 19e7b95a1..2d1417cf8 100644 --- a/resources/services/redshift/subnet_groups.go +++ b/resources/services/redshift/subnet_groups.go @@ -117,9 +117,7 @@ func fetchRedshiftSubnetGroups(ctx context.Context, meta schema.ClientMeta, pare c := meta.(*client.Client) svc := c.Services().Redshift for { - response, err := svc.DescribeClusterSubnetGroups(ctx, &config, func(o *redshift.Options) { - o.Region = c.Region - }) + response, err := svc.DescribeClusterSubnetGroups(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/sagemaker/endpoint_configurations.go b/resources/services/sagemaker/endpoint_configurations.go index b69677856..9af1e72c9 100644 --- a/resources/services/sagemaker/endpoint_configurations.go +++ b/resources/services/sagemaker/endpoint_configurations.go @@ -136,9 +136,7 @@ func fetchSagemakerEndpointConfigurations(ctx context.Context, meta schema.Clien svc := c.Services().SageMaker config := sagemaker.ListEndpointConfigsInput{} for { - response, err := svc.ListEndpointConfigs(ctx, &config, func(options *sagemaker.Options) { - options.Region = c.Region - }) + response, err := svc.ListEndpointConfigs(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -177,9 +175,7 @@ func resolveSagemakerEndpointConfigurationTags(ctx context.Context, meta schema. config := sagemaker.ListTagsInput{ ResourceArn: r.EndpointConfigArn, } - response, err := svc.ListTags(ctx, &config, func(options *sagemaker.Options) { - options.Region = c.Region - }) + response, err := svc.ListTags(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/sagemaker/models.go b/resources/services/sagemaker/models.go index a200085dc..61190703c 100644 --- a/resources/services/sagemaker/models.go +++ b/resources/services/sagemaker/models.go @@ -183,9 +183,7 @@ func fetchSagemakerModels(ctx context.Context, meta schema.ClientMeta, _ *schema svc := c.Services().SageMaker config := sagemaker.ListModelsInput{} for { - response, err := svc.ListModels(ctx, &config, func(options *sagemaker.Options) { - options.Region = c.Region - }) + response, err := svc.ListModels(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -226,9 +224,7 @@ func resolveSagemakerModelTags(ctx context.Context, meta schema.ClientMeta, reso config := sagemaker.ListTagsInput{ ResourceArn: r.ModelArn, } - response, err := svc.ListTags(ctx, &config, func(options *sagemaker.Options) { - options.Region = c.Region - }) + response, err := svc.ListTags(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/sagemaker/notebook_instances.go b/resources/services/sagemaker/notebook_instances.go index 8e354d35c..95ee0c32a 100644 --- a/resources/services/sagemaker/notebook_instances.go +++ b/resources/services/sagemaker/notebook_instances.go @@ -154,9 +154,7 @@ func fetchSagemakerNotebookInstances(ctx context.Context, meta schema.ClientMeta svc := c.Services().SageMaker config := sagemaker.ListNotebookInstancesInput{} for { - response, err := svc.ListNotebookInstances(ctx, &config, func(options *sagemaker.Options) { - options.Region = c.Region - }) + response, err := svc.ListNotebookInstances(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -197,9 +195,7 @@ func resolveSagemakerNotebookInstanceTags(ctx context.Context, meta schema.Clien config := sagemaker.ListTagsInput{ ResourceArn: &r.NotebookInstanceArn, } - response, err := svc.ListTags(ctx, &config, func(options *sagemaker.Options) { - options.Region = c.Region - }) + response, err := svc.ListTags(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/sagemaker/training_jobs.go b/resources/services/sagemaker/training_jobs.go index e75972ea2..5512d32e1 100644 --- a/resources/services/sagemaker/training_jobs.go +++ b/resources/services/sagemaker/training_jobs.go @@ -571,9 +571,7 @@ func sagemakerTrainingJobsDetail(ctx context.Context, meta schema.ClientMeta, re config := sagemaker.DescribeTrainingJobInput{ TrainingJobName: n.TrainingJobName, } - response, err := svc.DescribeTrainingJob(ctx, &config, func(options *sagemaker.Options) { - options.Region = c.Region - }) + response, err := svc.DescribeTrainingJob(ctx, &config) if err != nil { errorChan <- diag.WrapError(err) return @@ -587,9 +585,7 @@ func listSagemakerTrainingJobs(ctx context.Context, meta schema.ClientMeta, res config := sagemaker.ListTrainingJobsInput{} for { - response, err := svc.ListTrainingJobs(ctx, &config, func(options *sagemaker.Options) { - options.Region = c.Region - }) + response, err := svc.ListTrainingJobs(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -808,9 +804,7 @@ func resolveSagemakerTrainingJobTags(ctx context.Context, meta schema.ClientMeta config := sagemaker.ListTagsInput{ ResourceArn: r.TrainingJobArn, } - response, err := svc.ListTags(ctx, &config, func(options *sagemaker.Options) { - options.Region = c.Region - }) + response, err := svc.ListTags(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/secretsmanager/secrets.go b/resources/services/secretsmanager/secrets.go index e2cd1a46e..a56befb07 100644 --- a/resources/services/secretsmanager/secrets.go +++ b/resources/services/secretsmanager/secrets.go @@ -150,9 +150,7 @@ func fetchSecretsmanagerSecrets(ctx context.Context, meta schema.ClientMeta, _ * svc := c.Services().SecretsManager cfg := secretsmanager.ListSecretsInput{} for { - response, err := svc.ListSecrets(ctx, &cfg, func(options *secretsmanager.Options) { - options.Region = c.Region - }) + response, err := svc.ListSecrets(ctx, &cfg) if err != nil { return diag.WrapError(err) } @@ -195,9 +193,7 @@ func fetchSecretsmanagerSecretPolicy(ctx context.Context, meta schema.ClientMeta cfg := secretsmanager.GetResourcePolicyInput{ SecretId: r.ARN, } - response, err := svc.GetResourcePolicy(ctx, &cfg, func(options *secretsmanager.Options) { - options.Region = cl.Region - }) + response, err := svc.GetResourcePolicy(ctx, &cfg) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/shield/attacks.go b/resources/services/shield/attacks.go index 60d08a321..e71795255 100644 --- a/resources/services/shield/attacks.go +++ b/resources/services/shield/attacks.go @@ -158,9 +158,7 @@ func fetchShieldAttacks(ctx context.Context, meta schema.ClientMeta, parent *sch StartTime: &types.TimeRange{FromInclusive: &start}, } for { - output, err := svc.ListAttacks(ctx, &config, func(o *shield.Options) { - o.Region = c.Region - }) + output, err := svc.ListAttacks(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/shield/protection_groups.go b/resources/services/shield/protection_groups.go index e1ad65728..0e655a150 100644 --- a/resources/services/shield/protection_groups.go +++ b/resources/services/shield/protection_groups.go @@ -79,9 +79,7 @@ func fetchShieldProtectionGroups(ctx context.Context, meta schema.ClientMeta, pa svc := c.Services().Shield config := shield.ListProtectionGroupsInput{} for { - output, err := svc.ListProtectionGroups(ctx, &config, func(o *shield.Options) { - o.Region = c.Region - }) + output, err := svc.ListProtectionGroups(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil diff --git a/resources/services/shield/protections.go b/resources/services/shield/protections.go index 50698be65..0d10b3dcb 100644 --- a/resources/services/shield/protections.go +++ b/resources/services/shield/protections.go @@ -86,9 +86,7 @@ func fetchShieldProtections(ctx context.Context, meta schema.ClientMeta, parent svc := c.Services().Shield config := shield.ListProtectionsInput{} for { - output, err := svc.ListProtections(ctx, &config, func(o *shield.Options) { - o.Region = c.Region - }) + output, err := svc.ListProtections(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil diff --git a/resources/services/shield/subscriptions.go b/resources/services/shield/subscriptions.go index 474c65f97..7fa1c081d 100644 --- a/resources/services/shield/subscriptions.go +++ b/resources/services/shield/subscriptions.go @@ -96,9 +96,7 @@ func fetchShieldSubscriptions(ctx context.Context, meta schema.ClientMeta, paren c := meta.(*client.Client) svc := c.Services().Shield config := shield.DescribeSubscriptionInput{} - output, err := svc.DescribeSubscription(ctx, &config, func(o *shield.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeSubscription(ctx, &config) if err != nil { if c.IsNotFoundError(err) { return nil diff --git a/resources/services/sns/subscriptions.go b/resources/services/sns/subscriptions.go index 6c61ecc13..26b9252fe 100644 --- a/resources/services/sns/subscriptions.go +++ b/resources/services/sns/subscriptions.go @@ -71,9 +71,7 @@ func fetchSnsSubscriptions(ctx context.Context, meta schema.ClientMeta, parent * svc := c.Services().SNS config := sns.ListSubscriptionsInput{} for { - output, err := svc.ListSubscriptions(ctx, &config, func(o *sns.Options) { - o.Region = c.Region - }) + output, err := svc.ListSubscriptions(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/sns/topics.go b/resources/services/sns/topics.go index 5aef79639..7a3376db1 100644 --- a/resources/services/sns/topics.go +++ b/resources/services/sns/topics.go @@ -115,9 +115,7 @@ func fetchSnsTopics(ctx context.Context, meta schema.ClientMeta, parent *schema. svc := c.Services().SNS config := sns.ListTopicsInput{} for { - output, err := svc.ListTopics(ctx, &config, func(o *sns.Options) { - o.Region = c.Region - }) + output, err := svc.ListTopics(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -138,9 +136,7 @@ func resolveTopicAttributes(ctx context.Context, meta schema.ClientMeta, resourc params := sns.GetTopicAttributesInput{ TopicArn: topic.TopicArn, } - output, err := svc.GetTopicAttributes(ctx, ¶ms, func(o *sns.Options) { - o.Region = c.Region - }) + output, err := svc.GetTopicAttributes(ctx, ¶ms) if err != nil { return diag.WrapError(err) } @@ -197,9 +193,7 @@ func resolveTopicTags(ctx context.Context, meta schema.ClientMeta, resource *sch tagParams := sns.ListTagsForResourceInput{ ResourceArn: topic.TopicArn, } - tags, err := svc.ListTagsForResource(ctx, &tagParams, func(o *sns.Options) { - o.Region = c.Region - }) + tags, err := svc.ListTagsForResource(ctx, &tagParams) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ssm/documents.go b/resources/services/ssm/documents.go index a4b1998d6..692ed03d8 100644 --- a/resources/services/ssm/documents.go +++ b/resources/services/ssm/documents.go @@ -219,20 +219,18 @@ func SsmDocuments() *schema.Table { func fetchSsmDocuments(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { cl := meta.(*client.Client) svc := cl.Services().SSM - optsFn := func(o *ssm.Options) { - o.Region = cl.Region - } + params := ssm.ListDocumentsInput{ Filters: []types.DocumentKeyValuesFilter{{Key: aws.String("Owner"), Values: []string{"Self"}}}, } for { - output, err := svc.ListDocuments(ctx, ¶ms, optsFn) + output, err := svc.ListDocuments(ctx, ¶ms) if err != nil { return diag.WrapError(err) } for _, d := range output.DocumentIdentifiers { - dd, err := svc.DescribeDocument(ctx, &ssm.DescribeDocumentInput{Name: d.Name}, optsFn) + dd, err := svc.DescribeDocument(ctx, &ssm.DescribeDocumentInput{Name: d.Name}) if err != nil { return diag.WrapError(err) } @@ -261,9 +259,7 @@ func ssmDocumentPostResolver(ctx context.Context, meta schema.ClientMeta, resour d := resource.Item.(*types.DocumentDescription) cl := meta.(*client.Client) svc := cl.Services().SSM - optsFn := func(o *ssm.Options) { - o.Region = cl.Region - } + input := ssm.DescribeDocumentPermissionInput{ Name: d.Name, PermissionType: types.DocumentPermissionTypeShare, @@ -271,7 +267,7 @@ func ssmDocumentPostResolver(ctx context.Context, meta schema.ClientMeta, resour var accountIDs []string var infoList []types.AccountSharingInfo for { - output, err := svc.DescribeDocumentPermission(ctx, &input, optsFn) + output, err := svc.DescribeDocumentPermission(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/ssm/instances.go b/resources/services/ssm/instances.go index 88ba13837..b3a4a1b3f 100644 --- a/resources/services/ssm/instances.go +++ b/resources/services/ssm/instances.go @@ -227,12 +227,10 @@ func SsmInstances() *schema.Table { func fetchSsmInstances(ctx context.Context, meta schema.ClientMeta, parent *schema.Resource, res chan<- interface{}) error { cl := meta.(*client.Client) svc := cl.Services().SSM - optsFn := func(o *ssm.Options) { - o.Region = cl.Region - } + var input ssm.DescribeInstanceInformationInput for { - output, err := svc.DescribeInstanceInformation(ctx, &input, optsFn) + output, err := svc.DescribeInstanceInformation(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -249,14 +247,12 @@ func fetchSsmInstanceComplianceItems(ctx context.Context, meta schema.ClientMeta instance := parent.Item.(types.InstanceInformation) cl := meta.(*client.Client) svc := cl.Services().SSM - optsFn := func(o *ssm.Options) { - o.Region = cl.Region - } + input := ssm.ListComplianceItemsInput{ ResourceIds: []string{*instance.InstanceId}, } for { - output, err := svc.ListComplianceItems(ctx, &input, optsFn) + output, err := svc.ListComplianceItems(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/waf/rule_groups.go b/resources/services/waf/rule_groups.go index d5cece582..ebc9b769c 100644 --- a/resources/services/waf/rule_groups.go +++ b/resources/services/waf/rule_groups.go @@ -71,9 +71,7 @@ func fetchWafRuleGroups(ctx context.Context, meta schema.ClientMeta, parent *sch service := c.Services().Waf config := waf.ListRuleGroupsInput{} for { - output, err := service.ListRuleGroups(ctx, &config, func(options *waf.Options) { - options.Region = c.Region - }) + output, err := service.ListRuleGroups(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -108,9 +106,7 @@ func resolveWafRuleGroupRuleIds(ctx context.Context, meta schema.ClientMeta, res listActivatedRulesConfig := waf.ListActivatedRulesInRuleGroupInput{RuleGroupId: ruleGroup.RuleGroupId} var ruleIDs []string for { - rules, err := service.ListActivatedRulesInRuleGroup(ctx, &listActivatedRulesConfig, func(options *waf.Options) { - options.Region = awsClient.Region - }) + rules, err := service.ListActivatedRulesInRuleGroup(ctx, &listActivatedRulesConfig) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/waf/rules.go b/resources/services/waf/rules.go index d100a64d3..58e096e07 100644 --- a/resources/services/waf/rules.go +++ b/resources/services/waf/rules.go @@ -94,9 +94,7 @@ func fetchWafRules(ctx context.Context, meta schema.ClientMeta, parent *schema.R service := c.Services().Waf config := waf.ListRulesInput{} for { - output, err := service.ListRules(ctx, &config, func(options *waf.Options) { - options.Region = c.Region - }) + output, err := service.ListRules(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/waf/web_acls.go b/resources/services/waf/web_acls.go index d75a62816..1fdd9efe5 100644 --- a/resources/services/waf/web_acls.go +++ b/resources/services/waf/web_acls.go @@ -161,9 +161,7 @@ func fetchWafWebAcls(ctx context.Context, meta schema.ClientMeta, _ *schema.Reso service := c.Services().Waf config := waf.ListWebACLsInput{} for { - output, err := service.ListWebACLs(ctx, &config, func(options *waf.Options) { - options.Region = c.Region - }) + output, err := service.ListWebACLs(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -217,9 +215,7 @@ func resolveWafWebACLTags(ctx context.Context, meta schema.ClientMeta, resource outputTags := make(map[string]*string) tagsConfig := waf.ListTagsForResourceInput{ResourceARN: webACL.WebACLArn} for { - tags, err := service.ListTagsForResource(ctx, &tagsConfig, func(options *waf.Options) { - options.Region = awsClient.Region - }) + tags, err := service.ListTagsForResource(ctx, &tagsConfig) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/wafv2/ipsets.go b/resources/services/wafv2/ipsets.go index e39a87afe..41d7a3467 100644 --- a/resources/services/wafv2/ipsets.go +++ b/resources/services/wafv2/ipsets.go @@ -97,9 +97,7 @@ func fetchWafv2Ipsets(ctx context.Context, meta schema.ClientMeta, parent *schem Limit: aws.Int32(100), // maximum value: https://docs.aws.amazon.com/waf/latest/APIReference/API_ListIPSets.html } for { - result, err := svc.ListIPSets(ctx, ¶ms, func(options *wafv2.Options) { - options.Region = cl.Region - }) + result, err := svc.ListIPSets(ctx, ¶ms) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/wafv2/managed_rule_groups.go b/resources/services/wafv2/managed_rule_groups.go index c4754a93e..f4e66ad23 100644 --- a/resources/services/wafv2/managed_rule_groups.go +++ b/resources/services/wafv2/managed_rule_groups.go @@ -90,9 +90,7 @@ func fetchWafv2ManagedRuleGroups(ctx context.Context, meta schema.ClientMeta, pa config := wafv2.ListAvailableManagedRuleGroupsInput{Scope: c.WAFScope} for { - output, err := service.ListAvailableManagedRuleGroups(ctx, &config, func(options *wafv2.Options) { - options.Region = c.Region - }) + output, err := service.ListAvailableManagedRuleGroups(ctx, &config) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/wafv2/regex_pattern_sets.go b/resources/services/wafv2/regex_pattern_sets.go index d42bbc5d6..06a01b585 100644 --- a/resources/services/wafv2/regex_pattern_sets.go +++ b/resources/services/wafv2/regex_pattern_sets.go @@ -90,9 +90,7 @@ func fetchWafv2RegexPatternSets(ctx context.Context, meta schema.ClientMeta, par Limit: aws.Int32(100), // maximum value: https://docs.aws.amazon.com/waf/latest/APIReference/API_ListRegexPatternSets.html } for { - result, err := svc.ListRegexPatternSets(ctx, ¶ms, func(options *wafv2.Options) { - options.Region = cl.Region - }) + result, err := svc.ListRegexPatternSets(ctx, ¶ms) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/wafv2/rule_groups.go b/resources/services/wafv2/rule_groups.go index 0e3dd1096..a31552455 100644 --- a/resources/services/wafv2/rule_groups.go +++ b/resources/services/wafv2/rule_groups.go @@ -138,9 +138,7 @@ func fetchWafv2RuleGroups(ctx context.Context, meta schema.ClientMeta, parent *s config := wafv2.ListRuleGroupsInput{Scope: c.WAFScope} for { - output, err := service.ListRuleGroups(ctx, &config, func(options *wafv2.Options) { - options.Region = c.Region - }) + output, err := service.ListRuleGroups(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -175,9 +173,7 @@ func resolveWafv2ruleGroupTags(ctx context.Context, meta schema.ClientMeta, reso outputTags := make(map[string]*string) tagsConfig := wafv2.ListTagsForResourceInput{ResourceARN: ruleGroup.ARN} for { - tags, err := service.ListTagsForResource(ctx, &tagsConfig, func(options *wafv2.Options) { - options.Region = cl.Region - }) + tags, err := service.ListTagsForResource(ctx, &tagsConfig) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/wafv2/web_acls.go b/resources/services/wafv2/web_acls.go index 164a01046..29681e8f7 100644 --- a/resources/services/wafv2/web_acls.go +++ b/resources/services/wafv2/web_acls.go @@ -356,9 +356,7 @@ func fetchWafv2WebAcls(ctx context.Context, meta schema.ClientMeta, parent *sche Limit: aws.Int32(100), } for { - output, err := service.ListWebACLs(ctx, &config, func(options *wafv2.Options) { - options.Region = c.Region - }) + output, err := service.ListWebACLs(ctx, &config) if err != nil { return diag.WrapError(err) } @@ -433,9 +431,7 @@ func resolveWafv2webACLResourcesForWebACL(ctx context.Context, meta schema.Clien params.Marker = output.DistributionList.NextMarker } } else { - output, err := service.ListResourcesForWebACL(ctx, &wafv2.ListResourcesForWebACLInput{WebACLArn: webACL.ARN}, func(options *wafv2.Options) { - options.Region = cl.Region - }) + output, err := service.ListResourcesForWebACL(ctx, &wafv2.ListResourcesForWebACLInput{WebACLArn: webACL.ARN}) if err != nil { return diag.WrapError(err) } @@ -453,9 +449,7 @@ func resolveWafv2webACLTags(ctx context.Context, meta schema.ClientMeta, resourc outputTags := make(map[string]*string) tagsConfig := wafv2.ListTagsForResourceInput{ResourceARN: webACL.ARN} for { - tags, err := service.ListTagsForResource(ctx, &tagsConfig, func(options *wafv2.Options) { - options.Region = cl.Region - }) + tags, err := service.ListTagsForResource(ctx, &tagsConfig) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/workspaces/directories.go b/resources/services/workspaces/directories.go index 819e5c236..c116f5b48 100644 --- a/resources/services/workspaces/directories.go +++ b/resources/services/workspaces/directories.go @@ -240,9 +240,7 @@ func fetchWorkspacesDirectories(ctx context.Context, meta schema.ClientMeta, _ * svc := c.Services().Workspaces input := workspaces.DescribeWorkspaceDirectoriesInput{} for { - output, err := svc.DescribeWorkspaceDirectories(ctx, &input, func(o *workspaces.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeWorkspaceDirectories(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/workspaces/workspaces.go b/resources/services/workspaces/workspaces.go index 1e2690919..60c7cac85 100644 --- a/resources/services/workspaces/workspaces.go +++ b/resources/services/workspaces/workspaces.go @@ -163,9 +163,7 @@ func fetchWorkspacesWorkspaces(ctx context.Context, meta schema.ClientMeta, _ *s svc := c.Services().Workspaces input := workspaces.DescribeWorkspacesInput{} for { - output, err := svc.DescribeWorkspaces(ctx, &input, func(o *workspaces.Options) { - o.Region = c.Region - }) + output, err := svc.DescribeWorkspaces(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/xray/encryption_config.go b/resources/services/xray/encryption_config.go index 55853b459..03d3d11f5 100644 --- a/resources/services/xray/encryption_config.go +++ b/resources/services/xray/encryption_config.go @@ -60,9 +60,7 @@ func fetchXrayEncryptionConfigs(ctx context.Context, meta schema.ClientMeta, par c := meta.(*client.Client) svc := c.Services().Xray input := xray.GetEncryptionConfigInput{} - output, err := svc.GetEncryptionConfig(ctx, &input, func(o *xray.Options) { - o.Region = c.Region - }) + output, err := svc.GetEncryptionConfig(ctx, &input) if err != nil { return diag.WrapError(err) } diff --git a/resources/services/xray/groups.go b/resources/services/xray/groups.go index 4b5e91231..7378d874a 100644 --- a/resources/services/xray/groups.go +++ b/resources/services/xray/groups.go @@ -81,9 +81,7 @@ func fetchXrayGroups(ctx context.Context, meta schema.ClientMeta, parent *schema svc := c.Services().Xray input := xray.GetGroupsInput{} for { - output, err := svc.GetGroups(ctx, &input, func(o *xray.Options) { - o.Region = c.Region - }) + output, err := svc.GetGroups(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -102,9 +100,7 @@ func ResolveXrayGroupTags(ctx context.Context, meta schema.ClientMeta, resource svc := cl.Services().Xray params := xray.ListTagsForResourceInput{ResourceARN: group.GroupARN} - output, err := svc.ListTagsForResource(ctx, ¶ms, func(o *xray.Options) { - o.Region = cl.Region - }) + output, err := svc.ListTagsForResource(ctx, ¶ms) if err != nil { if cl.IsNotFoundError(err) { return nil diff --git a/resources/services/xray/sampling_rules.go b/resources/services/xray/sampling_rules.go index 05366cd66..14d8c43e7 100644 --- a/resources/services/xray/sampling_rules.go +++ b/resources/services/xray/sampling_rules.go @@ -141,9 +141,7 @@ func fetchXraySamplingRules(ctx context.Context, meta schema.ClientMeta, parent svc := c.Services().Xray input := xray.GetSamplingRulesInput{} for { - output, err := svc.GetSamplingRules(ctx, &input, func(o *xray.Options) { - o.Region = c.Region - }) + output, err := svc.GetSamplingRules(ctx, &input) if err != nil { return diag.WrapError(err) } @@ -162,9 +160,7 @@ func ResolveXraySamplingRuleTags(ctx context.Context, meta schema.ClientMeta, re svc := cl.Services().Xray params := xray.ListTagsForResourceInput{ResourceARN: sr.SamplingRule.RuleARN} - output, err := svc.ListTagsForResource(ctx, ¶ms, func(o *xray.Options) { - o.Region = cl.Region - }) + output, err := svc.ListTagsForResource(ctx, ¶ms) if err != nil { if cl.IsNotFoundError(err) { return nil