From 7d4d9315487cfc30cf4fdb62dac6456cbeead28c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 4 Jun 2024 15:19:59 -0700 Subject: [PATCH 01/15] Always overrides the region for API calls --- internal/service/route53/service_package.go | 31 +++++++++++---------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/internal/service/route53/service_package.go b/internal/service/route53/service_package.go index aa8344e8697..ab76a4d82c1 100644 --- a/internal/service/route53/service_package.go +++ b/internal/service/route53/service_package.go @@ -17,6 +17,22 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( cfg := *(config["aws_sdkv2_config"].(*aws.Config)) return route53.NewFromConfig(cfg, func(o *route53.Options) { + // Always override the service region + switch config["partition"].(string) { + case names.StandardPartitionID: + // https://docs.aws.amazon.com/general/latest/gr/r53.html Setting default to us-east-1. + o.Region = names.USEast1RegionID + case names.ChinaPartitionID: + // The AWS Go SDK is missing endpoint information for Route 53 in the AWS China partition. + // This can likely be removed in the future. + if aws.ToString(o.BaseEndpoint) == "" { + o.BaseEndpoint = aws.String("https://api.route53.cn") + } + o.Region = names.CNNorthwest1RegionID + case names.USGovCloudPartitionID: + o.Region = names.USGovWest1RegionID + } + if endpoint := config[names.AttrEndpoint].(string); endpoint != "" { tflog.Debug(ctx, "setting endpoint", map[string]any{ "tf_aws.endpoint": endpoint, @@ -27,21 +43,6 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( tflog.Debug(ctx, "endpoint set, ignoring UseFIPSEndpoint setting") o.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateDisabled } - } else { - switch config["partition"].(string) { - case names.StandardPartitionID: - // https://docs.aws.amazon.com/general/latest/gr/r53.html Setting default to us-east-1. - o.Region = names.USEast1RegionID - case names.ChinaPartitionID: - // The AWS Go SDK is missing endpoint information for Route 53 in the AWS China partition. - // This can likely be removed in the future. - if aws.ToString(o.BaseEndpoint) == "" { - o.BaseEndpoint = aws.String("https://api.route53.cn") - } - o.Region = names.CNNorthwest1RegionID - case names.USGovCloudPartitionID: - o.Region = names.USGovWest1RegionID - } } }), nil } From ba46345f6e20186805ef207c8d0d6a004701f006 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 4 Jun 2024 15:37:15 -0700 Subject: [PATCH 02/15] Adds `EndpointOverrideRegion` column --- names/data/names_data.csv | 796 +++++++++++++++++++------------------- names/data/read.go | 5 + 2 files changed, 403 insertions(+), 398 deletions(-) diff --git a/names/data/names_data.csv b/names/data/names_data.csv index 1b5728c66c5..51b2e09c189 100644 --- a/names/data/names_data.csv +++ b/names/data/names_data.csv @@ -1,398 +1,398 @@ -AWSCLIV2Command,AWSCLIV2CommandNoDashes,GoV1Package,GoV2Package,ProviderPackageActual,ProviderPackageCorrect,SplitPackageRealPackage,Aliases,ProviderNameUpper,GoV1ClientTypeName,SkipClientGenerate,ClientSDKV1,ClientSDKV2,ResourcePrefixActual,ResourcePrefixCorrect,FilePrefix,DocPrefix,HumanFriendly,Brand,Exclude,NotImplemented,EndpointOnly,AllowedSubcategory,DeprecatedEnvVar,TFAWSEnvVar,SDKID,EndpointAPICall,EndpointAPIParams,Note -accessanalyzer,accessanalyzer,accessanalyzer,accessanalyzer,,accessanalyzer,,,AccessAnalyzer,AccessAnalyzer,,,2,,aws_accessanalyzer_,,accessanalyzer_,IAM Access Analyzer,AWS,,,,,,,AccessAnalyzer,ListAnalyzers,, -account,account,account,account,,account,,,Account,Account,,,2,,aws_account_,,account_,Account Management,AWS,,,,,,,Account,ListRegions,, -acm,acm,acm,acm,,acm,,,ACM,ACM,,,2,,aws_acm_,,acm_,ACM (Certificate Manager),AWS,,,,,,,ACM,ListCertificates,, -acm-pca,acmpca,acmpca,acmpca,,acmpca,,,ACMPCA,ACMPCA,,,2,,aws_acmpca_,,acmpca_,ACM PCA (Certificate Manager Private Certificate Authority),AWS,,,,,,,ACM PCA,ListCertificateAuthorities,, -alexaforbusiness,alexaforbusiness,alexaforbusiness,alexaforbusiness,,alexaforbusiness,,,AlexaForBusiness,AlexaForBusiness,,1,,,aws_alexaforbusiness_,,alexaforbusiness_,Alexa for Business,,,x,,,,,Alexa For Business,,, -amp,amp,prometheusservice,amp,,amp,,prometheus;prometheusservice,AMP,PrometheusService,,,2,aws_prometheus_,aws_amp_,,prometheus_,AMP (Managed Prometheus),Amazon,,,,,,,amp,ListScrapers,, -amplify,amplify,amplify,amplify,,amplify,,,Amplify,Amplify,,,2,,aws_amplify_,,amplify_,Amplify,AWS,,,,,,,Amplify,ListApps,, -amplifybackend,amplifybackend,amplifybackend,amplifybackend,,amplifybackend,,,AmplifyBackend,AmplifyBackend,,1,,,aws_amplifybackend_,,amplifybackend_,Amplify Backend,AWS,,x,,,,,AmplifyBackend,,, -amplifyuibuilder,amplifyuibuilder,amplifyuibuilder,amplifyuibuilder,,amplifyuibuilder,,,AmplifyUIBuilder,AmplifyUIBuilder,,1,,,aws_amplifyuibuilder_,,amplifyuibuilder_,Amplify UI Builder,AWS,,x,,,,,AmplifyUIBuilder,,, -,,,,,,,,,,,,,,,,,Apache MXNet on AWS,AWS,x,,,,,,,,,Documentation -apigateway,apigateway,apigateway,apigateway,,apigateway,,,APIGateway,APIGateway,x,,2,aws_api_gateway_,aws_apigateway_,,api_gateway_,API Gateway,Amazon,,,,,,,API Gateway,GetAccount,, -apigatewaymanagementapi,apigatewaymanagementapi,apigatewaymanagementapi,apigatewaymanagementapi,,apigatewaymanagementapi,,,APIGatewayManagementAPI,ApiGatewayManagementApi,,1,,,aws_apigatewaymanagementapi_,,apigatewaymanagementapi_,API Gateway Management API,Amazon,,x,,,,,ApiGatewayManagementApi,,, -apigatewayv2,apigatewayv2,apigatewayv2,apigatewayv2,,apigatewayv2,,,APIGatewayV2,ApiGatewayV2,,,2,,aws_apigatewayv2_,,apigatewayv2_,API Gateway V2,Amazon,,,,,,,ApiGatewayV2,GetApis,, -appfabric,appfabric,appfabric,appfabric,,appfabric,,,AppFabric,AppFabric,,,2,,aws_appfabric_,,appfabric_,AppFabric,AWS,,,,,,,AppFabric,ListAppBundles,, -appmesh,appmesh,appmesh,appmesh,,appmesh,,,AppMesh,AppMesh,,1,,,aws_appmesh_,,appmesh_,App Mesh,AWS,,,,,,,App Mesh,ListMeshes,, -apprunner,apprunner,apprunner,apprunner,,apprunner,,,AppRunner,AppRunner,,,2,,aws_apprunner_,,apprunner_,App Runner,AWS,,,,,,,AppRunner,ListConnections,, -,,,,,,,,,,,,,,,,,App2Container,AWS,x,,,,,,,,,No SDK support -appconfig,appconfig,appconfig,appconfig,,appconfig,,,AppConfig,AppConfig,,,2,,aws_appconfig_,,appconfig_,AppConfig,AWS,,,,,,,AppConfig,ListApplications,, -appconfigdata,appconfigdata,appconfigdata,appconfigdata,,appconfigdata,,,AppConfigData,AppConfigData,,1,,,aws_appconfigdata_,,appconfigdata_,AppConfig Data,AWS,,x,,,,,AppConfigData,,, -appflow,appflow,appflow,appflow,,appflow,,,AppFlow,Appflow,,,2,,aws_appflow_,,appflow_,AppFlow,Amazon,,,,,,,Appflow,ListFlows,, -appintegrations,appintegrations,appintegrationsservice,appintegrations,,appintegrations,,appintegrationsservice,AppIntegrations,AppIntegrationsService,,,2,,aws_appintegrations_,,appintegrations_,AppIntegrations,Amazon,,,,,,,AppIntegrations,ListApplications,, -application-autoscaling,applicationautoscaling,applicationautoscaling,applicationautoscaling,appautoscaling,applicationautoscaling,,applicationautoscaling,AppAutoScaling,ApplicationAutoScaling,,,2,aws_appautoscaling_,aws_applicationautoscaling_,,appautoscaling_,Application Auto Scaling,,,,,,,,Application Auto Scaling,DescribeScalableTargets,ServiceNamespace: awstypes.ServiceNamespaceEcs, -applicationcostprofiler,applicationcostprofiler,applicationcostprofiler,applicationcostprofiler,,applicationcostprofiler,,,ApplicationCostProfiler,ApplicationCostProfiler,,1,,,aws_applicationcostprofiler_,,applicationcostprofiler_,Application Cost Profiler,AWS,,x,,,,,ApplicationCostProfiler,,, -discovery,discovery,applicationdiscoveryservice,applicationdiscoveryservice,,discovery,,applicationdiscovery;applicationdiscoveryservice,Discovery,ApplicationDiscoveryService,,1,,,aws_discovery_,,discovery_,Application Discovery,AWS,,x,,,,,Application Discovery Service,,, -mgn,mgn,mgn,mgn,,mgn,,,Mgn,Mgn,,1,,,aws_mgn_,,mgn_,Application Migration (Mgn),AWS,,x,,,,,mgn,,, -appstream,appstream,appstream,appstream,,appstream,,,AppStream,AppStream,,,2,,aws_appstream_,,appstream_,AppStream 2.0,Amazon,,,,,,,AppStream,ListAssociatedFleets,"StackName: aws_sdkv2.String(""test"")", -appsync,appsync,appsync,appsync,,appsync,,,AppSync,AppSync,,1,,,aws_appsync_,,appsync_,AppSync,AWS,,,,,,,AppSync,ListDomainNames,, -,,,,,,,,,,,,,,,,,Artifact,AWS,x,,,,,,,,,No SDK support -athena,athena,athena,athena,,athena,,,Athena,Athena,,,2,,aws_athena_,,athena_,Athena,Amazon,,,,,,,Athena,ListDataCatalogs,, -auditmanager,auditmanager,auditmanager,auditmanager,,auditmanager,,,AuditManager,AuditManager,,,2,,aws_auditmanager_,,auditmanager_,Audit Manager,AWS,,,,,,,AuditManager,GetAccountStatus,, -autoscaling,autoscaling,autoscaling,autoscaling,,autoscaling,,,AutoScaling,AutoScaling,,,2,aws_(autoscaling_|launch_configuration),aws_autoscaling_,,autoscaling_;launch_configuration,Auto Scaling,,,,,,,,Auto Scaling,DescribeAutoScalingGroups,, -autoscaling-plans,autoscalingplans,autoscalingplans,autoscalingplans,,autoscalingplans,,,AutoScalingPlans,AutoScalingPlans,,,2,,aws_autoscalingplans_,,autoscalingplans_,Auto Scaling Plans,,,,,,,,Auto Scaling Plans,DescribeScalingPlans,, -,,,,,,,,,,,,,,,,,Backint Agent for SAP HANA,AWS,x,,,,,,,,,No SDK support -backup,backup,backup,backup,,backup,,,Backup,Backup,,1,,,aws_backup_,,backup_,Backup,AWS,,,,,,,Backup,ListBackupPlans,, -backup-gateway,backupgateway,backupgateway,backupgateway,,backupgateway,,,BackupGateway,BackupGateway,,1,,,aws_backupgateway_,,backupgateway_,Backup Gateway,AWS,,x,,,,,Backup Gateway,,, -batch,batch,batch,batch,,batch,,,Batch,Batch,,1,2,,aws_batch_,,batch_,Batch,AWS,,,,,,,Batch,ListJobs,, -bedrock,bedrock,bedrock,bedrock,,bedrock,,,Bedrock,Bedrock,,,2,,aws_bedrock_,,bedrock_,Amazon Bedrock,Amazon,,,,,,,Bedrock,ListFoundationModels,, -bedrock-agent,bedrockagent,bedrockagent,bedrockagent,,bedrockagent,,,BedrockAgent,BedrockAgent,,,2,,aws_bedrockagent_,,bedrockagent_,Agents for Amazon Bedrock,Amazon,,,,,,,Bedrock Agent,ListAgents,, -bcmdataexports,bcmdataexports,bcmdataexports,bcmdataexports,,bcmdataexports,,,BCMDataExports,BCMDataExports,,,2,,aws_bcmdataexports_,,bcmdataexports_,BCM Data Exports,Amazon,,,,,,,BCM Data Exports,ListExports,, -billingconductor,billingconductor,billingconductor,,,billingconductor,,,BillingConductor,BillingConductor,,1,,,aws_billingconductor_,,billingconductor_,Billing Conductor,AWS,,x,,,,,billingconductor,,, -braket,braket,braket,braket,,braket,,,Braket,Braket,,1,,,aws_braket_,,braket_,Braket,Amazon,,x,,,,,Braket,,, -ce,ce,costexplorer,costexplorer,,ce,,costexplorer,CE,CostExplorer,,,2,,aws_ce_,,ce_,CE (Cost Explorer),AWS,,,,,,,Cost Explorer,ListCostCategoryDefinitions,, -chatbot,chatbot,chatbot,chatbot,,chatbot,,,Chatbot,,x,,2,,aws_chatbot_,,chatbot_,Chatbot,AWS,,,,,,,Chatbot,GetAccountPreferences,, -chime,chime,chime,chime,,chime,,,Chime,Chime,,1,,,aws_chime_,,chime_,Chime,Amazon,,,,,,,Chime,ListAccounts,, -chime-sdk-identity,chimesdkidentity,chimesdkidentity,chimesdkidentity,,chimesdkidentity,,,ChimeSDKIdentity,ChimeSDKIdentity,,1,,,aws_chimesdkidentity_,,chimesdkidentity_,Chime SDK Identity,Amazon,,x,,,,,Chime SDK Identity,,, -chime-sdk-mediapipelines,chimesdkmediapipelines,chimesdkmediapipelines,chimesdkmediapipelines,,chimesdkmediapipelines,,,ChimeSDKMediaPipelines,ChimeSDKMediaPipelines,,,2,,aws_chimesdkmediapipelines_,,chimesdkmediapipelines_,Chime SDK Media Pipelines,Amazon,,,,,,,Chime SDK Media Pipelines,ListMediaPipelines,, -chime-sdk-meetings,chimesdkmeetings,chimesdkmeetings,chimesdkmeetings,,chimesdkmeetings,,,ChimeSDKMeetings,ChimeSDKMeetings,,1,,,aws_chimesdkmeetings_,,chimesdkmeetings_,Chime SDK Meetings,Amazon,,x,,,,,Chime SDK Meetings,,, -chime-sdk-messaging,chimesdkmessaging,chimesdkmessaging,chimesdkmessaging,,chimesdkmessaging,,,ChimeSDKMessaging,ChimeSDKMessaging,,1,,,aws_chimesdkmessaging_,,chimesdkmessaging_,Chime SDK Messaging,Amazon,,x,,,,,Chime SDK Messaging,,, -chime-sdk-voice,chimesdkvoice,chimesdkvoice,chimesdkvoice,,chimesdkvoice,,,ChimeSDKVoice,ChimeSDKVoice,,,2,,aws_chimesdkvoice_,,chimesdkvoice_,Chime SDK Voice,Amazon,,,,,,,Chime SDK Voice,ListPhoneNumbers,, -cleanrooms,cleanrooms,cleanrooms,cleanrooms,,cleanrooms,,,CleanRooms,CleanRooms,,,2,,aws_cleanrooms_,,cleanrooms_,Clean Rooms,AWS,,,,,,,CleanRooms,ListCollaborations,, -,,,,,,,,,,,,,,,,,CLI (Command Line Interface),AWS,x,,,,,,,,,No SDK support -configure,configure,,,,,,,,,,,,,,,,CLI Configure options,AWS,x,,,,,,,,,CLI only -ddb,ddb,,,,,,,,,,,,,,,,CLI High-level DynamoDB commands,AWS,x,,,,,,,,,Part of DynamoDB -s3,s3,,,,,,,,,,,,,,,,CLI High-level S3 commands,AWS,x,,,,,,,,,CLI only -history,history,,,,,,,,,,,,,,,,CLI History of commands,AWS,x,,,,,,,,,CLI only -importexport,importexport,,,,,,,,,,,,,,,,CLI Import/Export,AWS,x,,,,,,,,,CLI only -cli-dev,clidev,,,,,,,,,,,,,,,,CLI Internal commands for development,AWS,x,,,,,,,,,CLI only -cloudcontrol,cloudcontrol,cloudcontrolapi,cloudcontrol,,cloudcontrol,,cloudcontrolapi,CloudControl,CloudControlApi,,,2,aws_cloudcontrolapi_,aws_cloudcontrol_,,cloudcontrolapi_,Cloud Control API,AWS,,,,,,,CloudControl,ListResourceRequests,, -,,,,,,,,,,,,,,,,,Cloud Digital Interface SDK,AWS,x,,,,,,,,,No SDK support -clouddirectory,clouddirectory,clouddirectory,clouddirectory,,clouddirectory,,,CloudDirectory,CloudDirectory,,1,,,aws_clouddirectory_,,clouddirectory_,Cloud Directory,Amazon,,x,,,,,CloudDirectory,,, -servicediscovery,servicediscovery,servicediscovery,servicediscovery,,servicediscovery,,,ServiceDiscovery,ServiceDiscovery,,1,,aws_service_discovery_,aws_servicediscovery_,,service_discovery_,Cloud Map,AWS,,,,,,,ServiceDiscovery,ListNamespaces,, -cloud9,cloud9,cloud9,cloud9,,cloud9,,,Cloud9,Cloud9,,,2,,aws_cloud9_,,cloud9_,Cloud9,AWS,,,,,,,Cloud9,ListEnvironments,, -cloudformation,cloudformation,cloudformation,cloudformation,,cloudformation,,,CloudFormation,CloudFormation,x,,2,,aws_cloudformation_,,cloudformation_,CloudFormation,AWS,,,,,,,CloudFormation,ListStackInstances,"StackSetName: aws_sdkv2.String(""test"")", -cloudfront,cloudfront,cloudfront,cloudfront,,cloudfront,,,CloudFront,CloudFront,,,2,,aws_cloudfront_,,cloudfront_,CloudFront,Amazon,,,,,,,CloudFront,ListDistributions,, -cloudfront-keyvaluestore,cloudfrontkeyvaluestore,,cloudfrontkeyvaluestore,,cloudfrontkeyvaluestore,,,CloudFrontKeyValueStore,CloudFrontKeyValueStore,,,2,,aws_cloudfrontkeyvaluestore_,,cloudfrontkeyvaluestore_,CloudFront KeyValueStore,Amazon,,,,,,,CloudFront KeyValueStore,ListKeys,"KvsARN: aws_sdkv2.String(""arn:aws:cloudfront::111122223333:key-value-store/MaxAge"")", -cloudhsm,cloudhsm,cloudhsm,cloudhsm,,,,,,,,,,,,,,CloudHSM,AWS,x,,,,,,,,,Legacy -cloudhsmv2,cloudhsmv2,cloudhsmv2,cloudhsmv2,,cloudhsmv2,,cloudhsm,CloudHSMV2,CloudHSMV2,x,,2,aws_cloudhsm_v2_,aws_cloudhsmv2_,,cloudhsm,CloudHSM,AWS,,,,,,,CloudHSM V2,DescribeClusters,, -cloudsearch,cloudsearch,cloudsearch,cloudsearch,,cloudsearch,,,CloudSearch,CloudSearch,,,2,,aws_cloudsearch_,,cloudsearch_,CloudSearch,Amazon,,,,,,,CloudSearch,ListDomainNames,, -cloudsearchdomain,cloudsearchdomain,cloudsearchdomain,cloudsearchdomain,,cloudsearchdomain,,,CloudSearchDomain,CloudSearchDomain,,1,,,aws_cloudsearchdomain_,,cloudsearchdomain_,CloudSearch Domain,Amazon,,x,,,,,CloudSearch Domain,,, -,,,,,,,,,,,,,,,,,CloudShell,AWS,x,,,,,,,,,No SDK support -cloudtrail,cloudtrail,cloudtrail,cloudtrail,,cloudtrail,,,CloudTrail,CloudTrail,,,2,aws_cloudtrail,aws_cloudtrail_,,cloudtrail,CloudTrail,AWS,,,,,,,CloudTrail,ListChannels,, -cloudwatch,cloudwatch,cloudwatch,cloudwatch,,cloudwatch,,,CloudWatch,CloudWatch,,,2,aws_cloudwatch_(?!(event_|log_|query_)),aws_cloudwatch_,,cloudwatch_dashboard;cloudwatch_metric_;cloudwatch_composite_,CloudWatch,Amazon,,,,,,,CloudWatch,ListDashboards,, -application-insights,applicationinsights,applicationinsights,applicationinsights,,applicationinsights,,,ApplicationInsights,ApplicationInsights,,1,,,aws_applicationinsights_,,applicationinsights_,CloudWatch Application Insights,Amazon,,,,,,,Application Insights,CreateApplication,, -evidently,evidently,cloudwatchevidently,evidently,,evidently,,cloudwatchevidently,Evidently,CloudWatchEvidently,,,2,,aws_evidently_,,evidently_,CloudWatch Evidently,Amazon,,,,,,,Evidently,ListProjects,, -internetmonitor,internetmonitor,internetmonitor,internetmonitor,,internetmonitor,,,InternetMonitor,InternetMonitor,,,2,,aws_internetmonitor_,,internetmonitor_,CloudWatch Internet Monitor,Amazon,,,,,,,InternetMonitor,ListMonitors,, -logs,logs,cloudwatchlogs,cloudwatchlogs,,logs,,cloudwatchlog;cloudwatchlogs,Logs,CloudWatchLogs,,,2,aws_cloudwatch_(log_|query_),aws_logs_,,cloudwatch_log_;cloudwatch_query_,CloudWatch Logs,Amazon,,,,,,,CloudWatch Logs,ListAnomalies,, -rum,rum,cloudwatchrum,rum,,rum,,cloudwatchrum,RUM,CloudWatchRUM,,1,,,aws_rum_,,rum_,CloudWatch RUM,Amazon,,,,,,,RUM,ListAppMonitors,, -synthetics,synthetics,synthetics,synthetics,,synthetics,,,Synthetics,Synthetics,,,2,,aws_synthetics_,,synthetics_,CloudWatch Synthetics,Amazon,,,,,,,synthetics,ListGroups,, -codeartifact,codeartifact,codeartifact,codeartifact,,codeartifact,,,CodeArtifact,CodeArtifact,,,2,,aws_codeartifact_,,codeartifact_,CodeArtifact,AWS,,,,,,,codeartifact,ListDomains,, -codebuild,codebuild,codebuild,codebuild,,codebuild,,,CodeBuild,CodeBuild,,,2,,aws_codebuild_,,codebuild_,CodeBuild,AWS,,,,,,,CodeBuild,ListBuildBatches,, -codecommit,codecommit,codecommit,codecommit,,codecommit,,,CodeCommit,CodeCommit,,,2,,aws_codecommit_,,codecommit_,CodeCommit,AWS,,,,,,,CodeCommit,ListRepositories,, -deploy,deploy,codedeploy,codedeploy,,deploy,,codedeploy,Deploy,CodeDeploy,,,2,aws_codedeploy_,aws_deploy_,,codedeploy_,CodeDeploy,AWS,,,,,,,CodeDeploy,ListApplications,, -codeguruprofiler,codeguruprofiler,codeguruprofiler,codeguruprofiler,,codeguruprofiler,,,CodeGuruProfiler,CodeGuruProfiler,,,2,,aws_codeguruprofiler_,,codeguruprofiler_,CodeGuru Profiler,Amazon,,,,,,,CodeGuruProfiler,ListProfilingGroups,, -codeguru-reviewer,codegurureviewer,codegurureviewer,codegurureviewer,,codegurureviewer,,,CodeGuruReviewer,CodeGuruReviewer,,,2,,aws_codegurureviewer_,,codegurureviewer_,CodeGuru Reviewer,Amazon,,,,,,,CodeGuru Reviewer,ListCodeReviews,Type: awstypes.TypePullRequest, -codepipeline,codepipeline,codepipeline,codepipeline,,codepipeline,,,CodePipeline,CodePipeline,,,2,aws_codepipeline,aws_codepipeline_,,codepipeline,CodePipeline,AWS,,,,,,,CodePipeline,ListPipelines,, -codestar,codestar,codestar,codestar,,codestar,,,CodeStar,CodeStar,,1,,,aws_codestar_,,codestar_,CodeStar,AWS,,x,,,,,CodeStar,,, -codestar-connections,codestarconnections,codestarconnections,codestarconnections,,codestarconnections,,,CodeStarConnections,CodeStarConnections,,,2,,aws_codestarconnections_,,codestarconnections_,CodeStar Connections,AWS,,,,,,,CodeStar connections,ListConnections,, -codestar-notifications,codestarnotifications,codestarnotifications,codestarnotifications,,codestarnotifications,,,CodeStarNotifications,CodeStarNotifications,,,2,,aws_codestarnotifications_,,codestarnotifications_,CodeStar Notifications,AWS,,,,,,,codestar notifications,ListTargets,, -cognito-identity,cognitoidentity,cognitoidentity,cognitoidentity,,cognitoidentity,,,CognitoIdentity,CognitoIdentity,,,2,aws_cognito_identity_(?!provider),aws_cognitoidentity_,,cognito_identity_pool,Cognito Identity,Amazon,,,,,,,Cognito Identity,ListIdentityPools,MaxResults: aws_sdkv2.Int32(1), -cognito-idp,cognitoidp,cognitoidentityprovider,cognitoidentityprovider,,cognitoidp,,cognitoidentityprovider,CognitoIDP,CognitoIdentityProvider,,1,,aws_cognito_(identity_provider|resource|user|risk),aws_cognitoidp_,,cognito_identity_provider;cognito_managed_user;cognito_resource_;cognito_user;cognito_risk,Cognito IDP (Identity Provider),Amazon,,,,,,,Cognito Identity Provider,ListUserPools,, -cognito-sync,cognitosync,cognitosync,cognitosync,,cognitosync,,,CognitoSync,CognitoSync,,1,,,aws_cognitosync_,,cognitosync_,Cognito Sync,Amazon,,x,,,,,Cognito Sync,,, -comprehend,comprehend,comprehend,comprehend,,comprehend,,,Comprehend,Comprehend,,,2,,aws_comprehend_,,comprehend_,Comprehend,Amazon,,,,,,,Comprehend,ListDocumentClassifiers,, -comprehendmedical,comprehendmedical,comprehendmedical,comprehendmedical,,comprehendmedical,,,ComprehendMedical,ComprehendMedical,,1,,,aws_comprehendmedical_,,comprehendmedical_,Comprehend Medical,Amazon,,x,,,,,ComprehendMedical,,, -compute-optimizer,computeoptimizer,computeoptimizer,computeoptimizer,,computeoptimizer,,,ComputeOptimizer,ComputeOptimizer,,,2,,aws_computeoptimizer_,,computeoptimizer_,Compute Optimizer,AWS,,,,,,,Compute Optimizer,GetEnrollmentStatus,, -configservice,configservice,configservice,configservice,,configservice,,config,ConfigService,ConfigService,,,2,aws_config_,aws_configservice_,,config_,Config,AWS,,,,,,,Config Service,ListStoredQueries,, -connect,connect,connect,connect,,connect,,,Connect,Connect,,1,,,aws_connect_,,connect_,Connect,Amazon,,,,,,,Connect,ListInstances,, -connectcases,connectcases,connectcases,connectcases,,connectcases,,,ConnectCases,ConnectCases,,,2,,aws_connectcases_,,connectcases_,Connect Cases,Amazon,,,,,,,ConnectCases,ListDomains,, -connect-contact-lens,connectcontactlens,connectcontactlens,connectcontactlens,,connectcontactlens,,,ConnectContactLens,ConnectContactLens,,1,,,aws_connectcontactlens_,,connectcontactlens_,Connect Contact Lens,Amazon,,x,,,,,Connect Contact Lens,,, -customer-profiles,customerprofiles,customerprofiles,customerprofiles,,customerprofiles,,,CustomerProfiles,CustomerProfiles,,,2,,aws_customerprofiles_,,customerprofiles_,Connect Customer Profiles,Amazon,,,,,,,Customer Profiles,ListDomains,, -connectparticipant,connectparticipant,connectparticipant,connectparticipant,,connectparticipant,,,ConnectParticipant,ConnectParticipant,,1,,,aws_connectparticipant_,,connectparticipant_,Connect Participant,Amazon,,x,,,,,ConnectParticipant,,, -voice-id,voiceid,voiceid,voiceid,,voiceid,,,VoiceID,VoiceID,,1,,,aws_voiceid_,,voiceid_,Connect Voice ID,Amazon,,x,,,,,Voice ID,,, -wisdom,wisdom,connectwisdomservice,wisdom,,wisdom,,connectwisdomservice,Wisdom,ConnectWisdomService,,1,,,aws_wisdom_,,wisdom_,Connect Wisdom,Amazon,,x,,,,,Wisdom,,, -,,,,,,,,,,,,,,,,,Console Mobile Application,AWS,x,,,,,,,,,No SDK support -controltower,controltower,controltower,controltower,,controltower,,,ControlTower,ControlTower,,,2,,aws_controltower_,,controltower_,Control Tower,AWS,,,,,,,ControlTower,ListLandingZones,, -cost-optimization-hub,costoptimizationhub,costoptimizationhub,costoptimizationhub,,costoptimizationhub,,,CostOptimizationHub,CostOptimizationHub,x,,2,,aws_costoptimizationhub_,,costoptimizationhub_,Cost Optimization Hub,AWS,,,,,,,Cost Optimization Hub,GetPreferences,, -cur,cur,costandusagereportservice,costandusagereportservice,,cur,,costandusagereportservice,CUR,CostandUsageReportService,x,,2,,aws_cur_,,cur_,Cost and Usage Report,AWS,,,,,,,Cost and Usage Report Service,DescribeReportDefinitions,, -,,,,,,,,,,,,,,,,,Crypto Tools,AWS,x,,,,,,,,,No SDK support -,,,,,,,,,,,,,,,,,Cryptographic Services Overview,AWS,x,,,,,,,,,No SDK support -dataexchange,dataexchange,dataexchange,dataexchange,,dataexchange,,,DataExchange,DataExchange,,1,,,aws_dataexchange_,,dataexchange_,Data Exchange,AWS,,,,,,,DataExchange,ListDataSets,, -datapipeline,datapipeline,datapipeline,datapipeline,,datapipeline,,,DataPipeline,DataPipeline,,1,,,aws_datapipeline_,,datapipeline_,Data Pipeline,AWS,,,,,,,Data Pipeline,ListPipelines,, -datasync,datasync,datasync,datasync,,datasync,,,DataSync,DataSync,,,2,,aws_datasync_,,datasync_,DataSync,AWS,,,,,,,DataSync,ListAgents,, -datazone,datazone,datazone,datazone,,datazone,,,DataZone,DataZone,,,2,,aws_datazone_,,datazone_,DataZone,Amazon,,,,,,,DataZone,ListDomains,, -,,,,,,,,,,,,,,,,,Deep Learning AMIs,AWS,x,,,,,,,,,No SDK support -,,,,,,,,,,,,,,,,,Deep Learning Containers,AWS,x,,,,,,,,,No SDK support -,,,,,,,,,,,,,,,,,DeepComposer,AWS,x,,,,,,,,,No SDK support -,,,,,,,,,,,,,,,,,DeepLens,AWS,x,,,,,,,,,No SDK support -,,,,,,,,,,,,,,,,,DeepRacer,AWS,x,,,,,,,,,No SDK support -detective,detective,detective,detective,,detective,,,Detective,Detective,,1,,,aws_detective_,,detective_,Detective,Amazon,,,,,,,Detective,ListGraphs,, -devicefarm,devicefarm,devicefarm,devicefarm,,devicefarm,,,DeviceFarm,DeviceFarm,,,2,,aws_devicefarm_,,devicefarm_,Device Farm,AWS,,,,,,,Device Farm,ListDeviceInstances,, -devops-guru,devopsguru,devopsguru,devopsguru,,devopsguru,,,DevOpsGuru,DevOpsGuru,,,2,,aws_devopsguru_,,devopsguru_,DevOps Guru,Amazon,,,,,,,DevOps Guru,DescribeAccountHealth,, -directconnect,directconnect,directconnect,directconnect,,directconnect,,,DirectConnect,DirectConnect,,1,,aws_dx_,aws_directconnect_,,dx_,Direct Connect,AWS,,,,,,,Direct Connect,DescribeConnections,, -dlm,dlm,dlm,dlm,,dlm,,,DLM,DLM,,,2,,aws_dlm_,,dlm_,DLM (Data Lifecycle Manager),Amazon,,,,,,,DLM,GetLifecyclePolicies,, -dms,dms,databasemigrationservice,databasemigrationservice,,dms,,databasemigration;databasemigrationservice,DMS,DatabaseMigrationService,,1,,,aws_dms_,,dms_,DMS (Database Migration),AWS,,,,,,,Database Migration Service,DescribeCertificates,, -docdb,docdb,docdb,docdb,,docdb,,,DocDB,DocDB,,1,,,aws_docdb_,,docdb_,DocumentDB,Amazon,,,,,,,DocDB,DescribeDBClusters,, -docdb-elastic,docdbelastic,docdbelastic,docdbelastic,,docdbelastic,,,DocDBElastic,DocDBElastic,,,2,,aws_docdbelastic_,,docdbelastic_,DocumentDB Elastic,Amazon,,,,,,,DocDB Elastic,ListClusters,, -drs,drs,drs,drs,,drs,,,DRS,Drs,,,2,,aws_drs_,,drs_,DRS (Elastic Disaster Recovery),AWS,,,,,,,DRS,DescribeJobs,, -ds,ds,directoryservice,directoryservice,,ds,,directoryservice,DS,DirectoryService,,1,2,aws_directory_service_,aws_ds_,,directory_service_,Directory Service,AWS,,,,,,,Directory Service,DescribeDirectories,, -dynamodb,dynamodb,dynamodb,dynamodb,,dynamodb,,,DynamoDB,DynamoDB,x,,2,,aws_dynamodb_,,dynamodb_,DynamoDB,Amazon,,,,,AWS_DYNAMODB_ENDPOINT,TF_AWS_DYNAMODB_ENDPOINT,DynamoDB,ListTables,, -dax,dax,dax,dax,,dax,,,DAX,DAX,,,2,,aws_dax_,,dax_,DynamoDB Accelerator (DAX),Amazon,,,,,,,DAX,DescribeClusters,, -dynamodbstreams,dynamodbstreams,dynamodbstreams,dynamodbstreams,,dynamodbstreams,,,DynamoDBStreams,DynamoDBStreams,,1,,,aws_dynamodbstreams_,,dynamodbstreams_,DynamoDB Streams,Amazon,,x,,,,,DynamoDB Streams,,, -,,,,,ec2ebs,ec2,,EC2EBS,,,,,aws_(ebs_|volume_attach|snapshot_create),aws_ec2ebs_,ebs_,ebs_;volume_attachment;snapshot_,EBS (EC2),Amazon,x,,,x,,,,,,Part of EC2 -ebs,ebs,ebs,ebs,,ebs,,,EBS,EBS,,1,,,aws_ebs_,,changewhenimplemented,EBS (Elastic Block Store),Amazon,,x,,,,,EBS,,, -ec2,ec2,ec2,ec2,,ec2,ec2,,EC2,EC2,x,1,2,aws_(ami|availability_zone|ec2_(availability|capacity|fleet|host|instance|public_ipv4_pool|serial|spot|tag)|eip|instance|key_pair|launch_template|placement_group|spot),aws_ec2_,ec2_,ami;availability_zone;ec2_availability_;ec2_capacity_;ec2_fleet;ec2_host;ec2_image_;ec2_instance_;ec2_public_ipv4_pool;ec2_serial_;ec2_spot_;ec2_tag;eip;instance;key_pair;launch_template;placement_group;spot_,EC2 (Elastic Compute Cloud),Amazon,,,,,,,EC2,DescribeVpcs,, -imagebuilder,imagebuilder,imagebuilder,imagebuilder,,imagebuilder,,,ImageBuilder,Imagebuilder,,1,,,aws_imagebuilder_,,imagebuilder_,EC2 Image Builder,Amazon,,,,,,,imagebuilder,ListImages,, -ec2-instance-connect,ec2instanceconnect,ec2instanceconnect,ec2instanceconnect,,ec2instanceconnect,,,EC2InstanceConnect,EC2InstanceConnect,,1,,,aws_ec2instanceconnect_,,ec2instanceconnect_,EC2 Instance Connect,AWS,,x,,,,,EC2 Instance Connect,,, -ecr,ecr,ecr,ecr,,ecr,,,ECR,ECR,,,2,,aws_ecr_,,ecr_,ECR (Elastic Container Registry),Amazon,,,,,,,ECR,DescribeRepositories,, -ecr-public,ecrpublic,ecrpublic,ecrpublic,,ecrpublic,,,ECRPublic,ECRPublic,,,2,,aws_ecrpublic_,,ecrpublic_,ECR Public,Amazon,,,,,,,ECR PUBLIC,DescribeRepositories,, -ecs,ecs,ecs,ecs,,ecs,,,ECS,ECS,,1,2,,aws_ecs_,,ecs_,ECS (Elastic Container),Amazon,,,,,,,ECS,ListClusters,, -efs,efs,efs,efs,,efs,,,EFS,EFS,,1,,,aws_efs_,,efs_,EFS (Elastic File System),Amazon,,,,,,,EFS,DescribeFileSystems,, -eks,eks,eks,eks,,eks,,,EKS,EKS,,,2,,aws_eks_,,eks_,EKS (Elastic Kubernetes),Amazon,,,,,,,EKS,ListClusters,, -elasticbeanstalk,elasticbeanstalk,elasticbeanstalk,elasticbeanstalk,,elasticbeanstalk,,beanstalk,ElasticBeanstalk,ElasticBeanstalk,,,2,aws_elastic_beanstalk_,aws_elasticbeanstalk_,,elastic_beanstalk_,Elastic Beanstalk,AWS,,,,,,,Elastic Beanstalk,ListAvailableSolutionStacks,, -elastic-inference,elasticinference,elasticinference,elasticinference,,elasticinference,,,ElasticInference,ElasticInference,,1,,,aws_elasticinference_,,elasticinference_,Elastic Inference,Amazon,,x,,,,,Elastic Inference,,, -elastictranscoder,elastictranscoder,elastictranscoder,elastictranscoder,,elastictranscoder,,,ElasticTranscoder,ElasticTranscoder,,1,,,aws_elastictranscoder_,,elastictranscoder_,Elastic Transcoder,Amazon,,,,,,,Elastic Transcoder,ListPipelines,, -elasticache,elasticache,elasticache,elasticache,,elasticache,,,ElastiCache,ElastiCache,,1,2,,aws_elasticache_,,elasticache_,ElastiCache,Amazon,,,,,,,ElastiCache,DescribeCacheClusters,, -es,es,elasticsearchservice,elasticsearchservice,elasticsearch,es,,es;elasticsearchservice,Elasticsearch,ElasticsearchService,,1,,aws_elasticsearch_,aws_es_,,elasticsearch_,Elasticsearch,Amazon,,,,,,,Elasticsearch Service,ListDomainNames,, -elbv2,elbv2,elbv2,elasticloadbalancingv2,,elbv2,,elasticloadbalancingv2,ELBV2,ELBV2,,1,2,aws_a?lb(\b|_listener|_target_group|s|_trust_store),aws_elbv2_,,lbs?\.;lb_listener;lb_target_group;lb_hosted;lb_trust_store,ELB (Elastic Load Balancing),,,,,,,,Elastic Load Balancing v2,DescribeLoadBalancers,, -elb,elb,elb,elasticloadbalancing,,elb,,elasticloadbalancing,ELB,ELB,,1,,aws_(app_cookie_stickiness_policy|elb|lb_cookie_stickiness_policy|lb_ssl_negotiation_policy|load_balancer_|proxy_protocol_policy),aws_elb_,,app_cookie_stickiness_policy;elb;lb_cookie_stickiness_policy;lb_ssl_negotiation_policy;load_balancer;proxy_protocol_policy,ELB Classic,,,,,,,,Elastic Load Balancing,DescribeLoadBalancers,, -mediaconnect,mediaconnect,mediaconnect,mediaconnect,,mediaconnect,,,MediaConnect,MediaConnect,,,2,,aws_mediaconnect_,,mediaconnect_,Elemental MediaConnect,AWS,,,,,,,MediaConnect,ListBridges,, -mediaconvert,mediaconvert,mediaconvert,mediaconvert,,mediaconvert,,,MediaConvert,MediaConvert,,,2,aws_media_convert_,aws_mediaconvert_,,media_convert_,Elemental MediaConvert,AWS,,,,,,,MediaConvert,ListJobs,, -medialive,medialive,medialive,medialive,,medialive,,,MediaLive,MediaLive,,,2,,aws_medialive_,,medialive_,Elemental MediaLive,AWS,,,,,,,MediaLive,ListOfferings,, -mediapackage,mediapackage,mediapackage,mediapackage,,mediapackage,,,MediaPackage,MediaPackage,,,2,aws_media_package_,aws_mediapackage_,,media_package_,Elemental MediaPackage,AWS,,,,,,,MediaPackage,ListChannels,, -mediapackage-vod,mediapackagevod,mediapackagevod,mediapackagevod,,mediapackagevod,,,MediaPackageVOD,MediaPackageVod,,1,,,aws_mediapackagevod_,,mediapackagevod_,Elemental MediaPackage VOD,AWS,,x,,,,,MediaPackage Vod,,, -mediastore,mediastore,mediastore,mediastore,,mediastore,,,MediaStore,MediaStore,,,2,aws_media_store_,aws_mediastore_,,media_store_,Elemental MediaStore,AWS,,,,,,,MediaStore,ListContainers,, -mediastore-data,mediastoredata,mediastoredata,mediastoredata,,mediastoredata,,,MediaStoreData,MediaStoreData,,1,,,aws_mediastoredata_,,mediastoredata_,Elemental MediaStore Data,AWS,,x,,,,,MediaStore Data,,, -mediatailor,mediatailor,mediatailor,mediatailor,,mediatailor,,,MediaTailor,MediaTailor,,1,,,aws_mediatailor_,,media_tailor_,Elemental MediaTailor,AWS,,x,,,,,MediaTailor,,, -,,,,,,,,,,,,,,,,,Elemental On-Premises,AWS,x,,,,,,,,,No SDK support -emr,emr,emr,emr,,emr,,,EMR,EMR,,1,2,,aws_emr_,,emr_,EMR,Amazon,,,,,,,EMR,ListClusters,, -emr-containers,emrcontainers,emrcontainers,emrcontainers,,emrcontainers,,,EMRContainers,EMRContainers,,1,,,aws_emrcontainers_,,emrcontainers_,EMR Containers,Amazon,,,,,,,EMR containers,ListVirtualClusters,, -emr-serverless,emrserverless,emrserverless,emrserverless,,emrserverless,,,EMRServerless,EMRServerless,,,2,,aws_emrserverless_,,emrserverless_,EMR Serverless,Amazon,,,,,,,EMR Serverless,ListApplications,, -,,,,,,,,,,,,,,,,,End-of-Support Migration Program (EMP) for Windows Server,AWS,x,,,,,,,,,No SDK support -events,events,eventbridge,eventbridge,,events,,eventbridge;cloudwatchevents,Events,EventBridge,,,2,aws_cloudwatch_event_,aws_events_,,cloudwatch_event_,EventBridge,Amazon,,,,,,,EventBridge,ListEventBuses,, -schemas,schemas,schemas,schemas,,schemas,,,Schemas,Schemas,,1,,,aws_schemas_,,schemas_,EventBridge Schemas,Amazon,,,,,,,schemas,ListRegistries,, -fis,fis,fis,fis,,fis,,,FIS,FIS,,,2,,aws_fis_,,fis_,FIS (Fault Injection Simulator),AWS,,,,,,,fis,ListExperiments,, -finspace,finspace,finspace,finspace,,finspace,,,FinSpace,Finspace,,,2,,aws_finspace_,,finspace_,FinSpace,Amazon,,,,,,,finspace,ListEnvironments,, -finspace-data,finspacedata,finspacedata,finspacedata,,finspacedata,,,FinSpaceData,FinSpaceData,,1,,,aws_finspacedata_,,finspacedata_,FinSpace Data,Amazon,,x,,,,,finspace data,,, -fms,fms,fms,fms,,fms,,,FMS,FMS,x,,2,,aws_fms_,,fms_,FMS (Firewall Manager),AWS,,,,,,,FMS,ListAppsLists,MaxResults: aws_sdkv2.Int32(1), -forecast,forecast,forecastservice,forecast,,forecast,,forecastservice,Forecast,ForecastService,,1,,,aws_forecast_,,forecast_,Forecast,Amazon,,x,,,,,forecast,,, -forecastquery,forecastquery,forecastqueryservice,forecastquery,,forecastquery,,forecastqueryservice,ForecastQuery,ForecastQueryService,,1,,,aws_forecastquery_,,forecastquery_,Forecast Query,Amazon,,x,,,,,forecastquery,,, -frauddetector,frauddetector,frauddetector,frauddetector,,frauddetector,,,FraudDetector,FraudDetector,,1,,,aws_frauddetector_,,frauddetector_,Fraud Detector,Amazon,,x,,,,,FraudDetector,,, -,,,,,,,,,,,,,,,,,FreeRTOS,,x,,,,,,,,,No SDK support -fsx,fsx,fsx,fsx,,fsx,,,FSx,FSx,,1,,,aws_fsx_,,fsx_,FSx,Amazon,,,,,,,FSx,DescribeFileSystems,, -gamelift,gamelift,gamelift,gamelift,,gamelift,,,GameLift,GameLift,,1,,,aws_gamelift_,,gamelift_,GameLift,Amazon,,,,,,,GameLift,ListGameServerGroups,, -globalaccelerator,globalaccelerator,globalaccelerator,globalaccelerator,,globalaccelerator,,,GlobalAccelerator,GlobalAccelerator,x,,2,,aws_globalaccelerator_,,globalaccelerator_,Global Accelerator,AWS,,,,,,,Global Accelerator,ListAccelerators,, -glue,glue,glue,glue,,glue,,,Glue,Glue,,1,,,aws_glue_,,glue_,Glue,AWS,,,,,,,Glue,ListRegistries,, -databrew,databrew,gluedatabrew,databrew,,databrew,,gluedatabrew,DataBrew,GlueDataBrew,,1,,,aws_databrew_,,databrew_,Glue DataBrew,AWS,,x,,,,,DataBrew,,, -groundstation,groundstation,groundstation,groundstation,,groundstation,,,GroundStation,GroundStation,,,2,,aws_groundstation_,,groundstation_,Ground Station,AWS,,,,,,,GroundStation,ListConfigs,, -guardduty,guardduty,guardduty,guardduty,,guardduty,,,GuardDuty,GuardDuty,,1,,,aws_guardduty_,,guardduty_,GuardDuty,Amazon,,,,,,,GuardDuty,ListDetectors,, -health,health,health,health,,health,,,Health,Health,,1,,,aws_health_,,health_,Health,AWS,,x,,,,,Health,,, -healthlake,healthlake,healthlake,healthlake,,healthlake,,,HealthLake,HealthLake,,,2,,aws_healthlake_,,healthlake_,HealthLake,Amazon,,,,,,,HealthLake,ListFHIRDatastores,, -honeycode,honeycode,honeycode,honeycode,,honeycode,,,Honeycode,Honeycode,,1,,,aws_honeycode_,,honeycode_,Honeycode,Amazon,,x,,,,,Honeycode,,, -iam,iam,iam,iam,,iam,,,IAM,IAM,,,2,,aws_iam_,,iam_,IAM (Identity & Access Management),AWS,,,,,AWS_IAM_ENDPOINT,TF_AWS_IAM_ENDPOINT,IAM,ListRoles,, -inspector,inspector,inspector,inspector,,inspector,,,Inspector,Inspector,,1,,,aws_inspector_,,inspector_,Inspector Classic,Amazon,,,,,,,Inspector,ListRulesPackages,, -inspector2,inspector2,inspector2,inspector2,,inspector2,,inspectorv2,Inspector2,Inspector2,,,2,,aws_inspector2_,,inspector2_,Inspector,Amazon,,,,,,,Inspector2,ListAccountPermissions,, -iot1click-devices,iot1clickdevices,iot1clickdevicesservice,iot1clickdevicesservice,,iot1clickdevices,,iot1clickdevicesservice,IoT1ClickDevices,IoT1ClickDevicesService,,1,,,aws_iot1clickdevices_,,iot1clickdevices_,IoT 1-Click Devices,AWS,,x,,,,,IoT 1Click Devices Service,,, -iot1click-projects,iot1clickprojects,iot1clickprojects,iot1clickprojects,,iot1clickprojects,,,IoT1ClickProjects,IoT1ClickProjects,,1,,,aws_iot1clickprojects_,,iot1clickprojects_,IoT 1-Click Projects,AWS,,x,,,,,IoT 1Click Projects,,, -iotanalytics,iotanalytics,iotanalytics,iotanalytics,,iotanalytics,,,IoTAnalytics,IoTAnalytics,,1,,,aws_iotanalytics_,,iotanalytics_,IoT Analytics,AWS,,,,,,,IoTAnalytics,ListChannels,, -iot,iot,iot,iot,,iot,,,IoT,IoT,,1,,,aws_iot_,,iot_,IoT Core,AWS,,,,,,,IoT,DescribeDefaultAuthorizer,, -iot-data,iotdata,iotdataplane,iotdataplane,,iotdata,,iotdataplane,IoTData,IoTDataPlane,,1,,,aws_iotdata_,,iotdata_,IoT Data Plane,AWS,,x,,,,,IoT Data Plane,,, -,,,,,,,,,,,,,,,,,IoT Device Defender,AWS,x,,,,,,,,,Part of IoT -iotdeviceadvisor,iotdeviceadvisor,iotdeviceadvisor,iotdeviceadvisor,,iotdeviceadvisor,,,IoTDeviceAdvisor,IoTDeviceAdvisor,,1,,,aws_iotdeviceadvisor_,,iotdeviceadvisor_,IoT Device Management,AWS,,x,,,,,IotDeviceAdvisor,,, -iotevents,iotevents,iotevents,iotevents,,iotevents,,,IoTEvents,IoTEvents,,1,,,aws_iotevents_,,iotevents_,IoT Events,AWS,,,,,,,IoT Events,ListAlarmModels,, -iotevents-data,ioteventsdata,ioteventsdata,ioteventsdata,,ioteventsdata,,,IoTEventsData,IoTEventsData,,1,,,aws_ioteventsdata_,,ioteventsdata_,IoT Events Data,AWS,,x,,,,,IoT Events Data,,, -,,,,,,,,,,,,,,,,,IoT ExpressLink,AWS,x,,,,,,,,,No SDK support -iotfleethub,iotfleethub,iotfleethub,iotfleethub,,iotfleethub,,,IoTFleetHub,IoTFleetHub,,1,,,aws_iotfleethub_,,iotfleethub_,IoT Fleet Hub,AWS,,x,,,,,IoTFleetHub,,, -,,,,,,,,,,,,,,,,,IoT FleetWise,AWS,x,,,,,,IoTFleetWise,,,No SDK support -greengrass,greengrass,greengrass,greengrass,,greengrass,,,Greengrass,Greengrass,,1,,,aws_greengrass_,,greengrass_,IoT Greengrass,AWS,,,,,,,Greengrass,ListGroups,, -greengrassv2,greengrassv2,greengrassv2,greengrassv2,,greengrassv2,,,GreengrassV2,GreengrassV2,,1,,,aws_greengrassv2_,,greengrassv2_,IoT Greengrass V2,AWS,,x,,,,,GreengrassV2,,, -iot-jobs-data,iotjobsdata,iotjobsdataplane,iotjobsdataplane,,iotjobsdata,,iotjobsdataplane,IoTJobsData,IoTJobsDataPlane,,1,,,aws_iotjobsdata_,,iotjobsdata_,IoT Jobs Data Plane,AWS,,x,,,,,IoT Jobs Data Plane,,, -,,,,,,,,,,,,,,,,,IoT RoboRunner,AWS,x,,,,,,,,,No SDK support -iotsecuretunneling,iotsecuretunneling,iotsecuretunneling,iotsecuretunneling,,iotsecuretunneling,,,IoTSecureTunneling,IoTSecureTunneling,,1,,,aws_iotsecuretunneling_,,iotsecuretunneling_,IoT Secure Tunneling,AWS,,x,,,,,IoTSecureTunneling,,, -iotsitewise,iotsitewise,iotsitewise,iotsitewise,,iotsitewise,,,IoTSiteWise,IoTSiteWise,,1,,,aws_iotsitewise_,,iotsitewise_,IoT SiteWise,AWS,,x,,,,,IoTSiteWise,,, -iotthingsgraph,iotthingsgraph,iotthingsgraph,iotthingsgraph,,iotthingsgraph,,,IoTThingsGraph,IoTThingsGraph,,1,,,aws_iotthingsgraph_,,iotthingsgraph_,IoT Things Graph,AWS,,x,,,,,IoTThingsGraph,,, -iottwinmaker,iottwinmaker,iottwinmaker,iottwinmaker,,iottwinmaker,,,IoTTwinMaker,IoTTwinMaker,,1,,,aws_iottwinmaker_,,iottwinmaker_,IoT TwinMaker,AWS,,x,,,,,IoTTwinMaker,,, -iotwireless,iotwireless,iotwireless,iotwireless,,iotwireless,,,IoTWireless,IoTWireless,,1,,,aws_iotwireless_,,iotwireless_,IoT Wireless,AWS,,x,,,,,IoT Wireless,,, -,,,,,,,,,,,,,,,,,IQ,AWS,x,,,,,,,,,No SDK support -ivs,ivs,ivs,ivs,,ivs,,,IVS,IVS,,1,,,aws_ivs_,,ivs_,IVS (Interactive Video),Amazon,,,,,,,ivs,ListChannels,, -ivschat,ivschat,ivschat,ivschat,,ivschat,,,IVSChat,Ivschat,,,2,,aws_ivschat_,,ivschat_,IVS (Interactive Video) Chat,Amazon,,,,,,,ivschat,ListRooms,, -kendra,kendra,kendra,kendra,,kendra,,,Kendra,Kendra,,,2,,aws_kendra_,,kendra_,Kendra,Amazon,,,,,,,kendra,ListIndices,, -keyspaces,keyspaces,keyspaces,keyspaces,,keyspaces,,,Keyspaces,Keyspaces,,,2,,aws_keyspaces_,,keyspaces_,Keyspaces (for Apache Cassandra),Amazon,,,,,,,Keyspaces,ListKeyspaces,, -kinesis,kinesis,kinesis,kinesis,,kinesis,,,Kinesis,Kinesis,x,,2,aws_kinesis_stream,aws_kinesis_,,kinesis_stream;kinesis_resource_policy,Kinesis,Amazon,,,,,,,Kinesis,ListStreams,, -kinesisanalytics,kinesisanalytics,kinesisanalytics,kinesisanalytics,,kinesisanalytics,,,KinesisAnalytics,KinesisAnalytics,,1,,aws_kinesis_analytics_,aws_kinesisanalytics_,,kinesis_analytics_,Kinesis Analytics,Amazon,,,,,,,Kinesis Analytics,ListApplications,, -kinesisanalyticsv2,kinesisanalyticsv2,kinesisanalyticsv2,kinesisanalyticsv2,,kinesisanalyticsv2,,,KinesisAnalyticsV2,KinesisAnalyticsV2,,1,,,aws_kinesisanalyticsv2_,,kinesisanalyticsv2_,Kinesis Analytics V2,Amazon,,,,,,,Kinesis Analytics V2,ListApplications,, -firehose,firehose,firehose,firehose,,firehose,,,Firehose,Firehose,,,2,aws_kinesis_firehose_,aws_firehose_,,kinesis_firehose_,Kinesis Firehose,Amazon,,,,,,,Firehose,ListDeliveryStreams,, -kinesisvideo,kinesisvideo,kinesisvideo,kinesisvideo,,kinesisvideo,,,KinesisVideo,KinesisVideo,,1,,,aws_kinesisvideo_,,kinesis_video_,Kinesis Video,Amazon,,,,,,,Kinesis Video,ListStreams,, -kinesis-video-archived-media,kinesisvideoarchivedmedia,kinesisvideoarchivedmedia,kinesisvideoarchivedmedia,,kinesisvideoarchivedmedia,,,KinesisVideoArchivedMedia,KinesisVideoArchivedMedia,,1,,,aws_kinesisvideoarchivedmedia_,,kinesisvideoarchivedmedia_,Kinesis Video Archived Media,Amazon,,x,,,,,Kinesis Video Archived Media,,, -kinesis-video-media,kinesisvideomedia,kinesisvideomedia,kinesisvideomedia,,kinesisvideomedia,,,KinesisVideoMedia,KinesisVideoMedia,,1,,,aws_kinesisvideomedia_,,kinesisvideomedia_,Kinesis Video Media,Amazon,,x,,,,,Kinesis Video Media,,, -kinesis-video-signaling,kinesisvideosignaling,kinesisvideosignalingchannels,kinesisvideosignaling,,kinesisvideosignaling,,kinesisvideosignalingchannels,KinesisVideoSignaling,KinesisVideoSignalingChannels,,1,,,aws_kinesisvideosignaling_,,kinesisvideosignaling_,Kinesis Video Signaling,Amazon,,x,,,,,Kinesis Video Signaling,,, -kms,kms,kms,kms,,kms,,,KMS,KMS,,,2,,aws_kms_,,kms_,KMS (Key Management),AWS,,,,,,,KMS,ListKeys,, -lakeformation,lakeformation,lakeformation,lakeformation,,lakeformation,,,LakeFormation,LakeFormation,,,2,,aws_lakeformation_,,lakeformation_,Lake Formation,AWS,,,,,,,LakeFormation,ListResources,, -lambda,lambda,lambda,lambda,,lambda,,,Lambda,Lambda,,,2,,aws_lambda_,,lambda_,Lambda,AWS,,,,,,,Lambda,ListFunctions,, -launch-wizard,launchwizard,launchwizard,launchwizard,,launchwizard,,,LaunchWizard,LaunchWizard,,,2,,aws_launchwizard_,,launchwizard_,Launch Wizard,AWS,,,,,,,Launch Wizard,ListWorkloads,, -lex-models,lexmodels,lexmodelbuildingservice,lexmodelbuildingservice,,lexmodels,,lexmodelbuilding;lexmodelbuildingservice;lex,LexModels,LexModelBuildingService,,1,,aws_lex_,aws_lexmodels_,,lex_,Lex Model Building,Amazon,,,,,,,Lex Model Building Service,GetBots,, -lexv2-models,lexv2models,lexmodelsv2,lexmodelsv2,,lexv2models,,lexmodelsv2,LexV2Models,LexModelsV2,,,2,,aws_lexv2models_,,lexv2models_,Lex V2 Models,Amazon,,,,,,,Lex Models V2,ListBots,, -lex-runtime,lexruntime,lexruntimeservice,lexruntimeservice,,lexruntime,,lexruntimeservice,LexRuntime,LexRuntimeService,,1,,,aws_lexruntime_,,lexruntime_,Lex Runtime,Amazon,,x,,,,,Lex Runtime Service,,, -lexv2-runtime,lexv2runtime,lexruntimev2,lexruntimev2,,lexruntimev2,,lexv2runtime,LexRuntimeV2,LexRuntimeV2,,1,,,aws_lexruntimev2_,,lexruntimev2_,Lex Runtime V2,Amazon,,x,,,,,Lex Runtime V2,,, -license-manager,licensemanager,licensemanager,licensemanager,,licensemanager,,,LicenseManager,LicenseManager,,1,,,aws_licensemanager_,,licensemanager_,License Manager,AWS,,,,,,,License Manager,ListLicenseConfigurations,, -lightsail,lightsail,lightsail,lightsail,,lightsail,,,Lightsail,Lightsail,x,,2,,aws_lightsail_,,lightsail_,Lightsail,Amazon,,,,,,,Lightsail,GetInstances,, -location,location,locationservice,location,,location,,locationservice,Location,LocationService,,1,,,aws_location_,,location_,Location,Amazon,,,,,,,Location,ListGeofenceCollections,, -lookoutequipment,lookoutequipment,lookoutequipment,lookoutequipment,,lookoutequipment,,,LookoutEquipment,LookoutEquipment,,1,,,aws_lookoutequipment_,,lookoutequipment_,Lookout for Equipment,Amazon,,x,,,,,LookoutEquipment,,, -lookoutmetrics,lookoutmetrics,lookoutmetrics,lookoutmetrics,,lookoutmetrics,,,LookoutMetrics,LookoutMetrics,,,2,,aws_lookoutmetrics_,,lookoutmetrics_,Lookout for Metrics,Amazon,,,,,,,LookoutMetrics,ListMetricSets,, -lookoutvision,lookoutvision,lookoutforvision,lookoutvision,,lookoutvision,,lookoutforvision,LookoutVision,LookoutForVision,,1,,,aws_lookoutvision_,,lookoutvision_,Lookout for Vision,Amazon,,x,,,,,LookoutVision,,, -,,,,,,,,,,,,,,,,,Lumberyard,Amazon,x,,,,,,,,,No SDK support -machinelearning,machinelearning,machinelearning,machinelearning,,machinelearning,,,MachineLearning,MachineLearning,,1,,,aws_machinelearning_,,machinelearning_,Machine Learning,Amazon,,x,,,,,Machine Learning,,, -macie2,macie2,macie2,macie2,,macie2,,,Macie2,Macie2,,1,,,aws_macie2_,,macie2_,Macie,Amazon,,,,,,,Macie2,ListFindings,, -macie,macie,macie,macie,,macie,,,Macie,Macie,,1,,,aws_macie_,,macie_,Macie Classic,Amazon,,x,,,,,Macie,,, -m2,m2,m2,m2,,m2,,,M2,M2,,,2,,aws_m2_,,m2_,Mainframe Modernization,AWS,,,,,,,m2,ListApplications,, -managedblockchain,managedblockchain,managedblockchain,managedblockchain,,managedblockchain,,,ManagedBlockchain,ManagedBlockchain,,1,,,aws_managedblockchain_,,managedblockchain_,Managed Blockchain,Amazon,,x,,,,,ManagedBlockchain,,, -grafana,grafana,managedgrafana,grafana,,grafana,,managedgrafana;amg,Grafana,ManagedGrafana,,1,,,aws_grafana_,,grafana_,Managed Grafana,Amazon,,,,,,,grafana,ListWorkspaces,, -kafka,kafka,kafka,kafka,,kafka,,msk,Kafka,Kafka,x,,2,aws_msk_,aws_kafka_,,msk_,Managed Streaming for Kafka,Amazon,,,,,,,Kafka,ListClusters,, -kafkaconnect,kafkaconnect,kafkaconnect,kafkaconnect,,kafkaconnect,,,KafkaConnect,KafkaConnect,,1,,aws_mskconnect_,aws_kafkaconnect_,,mskconnect_,Managed Streaming for Kafka Connect,Amazon,,,,,,,KafkaConnect,ListConnectors,, -,,,,,,,,,,,,,,,,,Management Console,AWS,x,,,,,,,,,No SDK support -marketplace-catalog,marketplacecatalog,marketplacecatalog,marketplacecatalog,,marketplacecatalog,,,MarketplaceCatalog,MarketplaceCatalog,,1,,,aws_marketplacecatalog_,,marketplace_catalog_,Marketplace Catalog,AWS,,x,,,,,Marketplace Catalog,,, -marketplacecommerceanalytics,marketplacecommerceanalytics,marketplacecommerceanalytics,marketplacecommerceanalytics,,marketplacecommerceanalytics,,,MarketplaceCommerceAnalytics,MarketplaceCommerceAnalytics,,1,,,aws_marketplacecommerceanalytics_,,marketplacecommerceanalytics_,Marketplace Commerce Analytics,AWS,,x,,,,,Marketplace Commerce Analytics,,, -marketplace-entitlement,marketplaceentitlement,marketplaceentitlementservice,marketplaceentitlementservice,,marketplaceentitlement,,marketplaceentitlementservice,MarketplaceEntitlement,MarketplaceEntitlementService,,1,,,aws_marketplaceentitlement_,,marketplaceentitlement_,Marketplace Entitlement,AWS,,x,,,,,Marketplace Entitlement Service,,, -meteringmarketplace,meteringmarketplace,marketplacemetering,marketplacemetering,,marketplacemetering,,meteringmarketplace,MarketplaceMetering,MarketplaceMetering,,1,,,aws_marketplacemetering_,,marketplacemetering_,Marketplace Metering,AWS,,x,,,,,Marketplace Metering,,, -memorydb,memorydb,memorydb,memorydb,,memorydb,,,MemoryDB,MemoryDB,,1,,,aws_memorydb_,,memorydb_,MemoryDB for Redis,Amazon,,,,,,,MemoryDB,DescribeClusters,, -,,,,,meta,,,Meta,,,,,aws_(arn|billing_service_account|default_tags|ip_ranges|partition|regions?|service)$,aws_meta_,,arn;ip_ranges;billing_service_account;default_tags;partition;region;service\.,Meta Data Sources,,x,,,x,,,,,,Not an AWS service (metadata) -mgh,mgh,migrationhub,migrationhub,,mgh,,migrationhub,MgH,MigrationHub,,1,,,aws_mgh_,,mgh_,MgH (Migration Hub),AWS,,x,,,,,Migration Hub,,, -,,,,,,,,,,,,,,,,,Microservice Extractor for .NET,AWS,x,,,,,,,,,No SDK support -migrationhub-config,migrationhubconfig,migrationhubconfig,migrationhubconfig,,migrationhubconfig,,,MigrationHubConfig,MigrationHubConfig,,1,,,aws_migrationhubconfig_,,migrationhubconfig_,Migration Hub Config,AWS,,x,,,,,MigrationHub Config,,, -migration-hub-refactor-spaces,migrationhubrefactorspaces,migrationhubrefactorspaces,migrationhubrefactorspaces,,migrationhubrefactorspaces,,,MigrationHubRefactorSpaces,MigrationHubRefactorSpaces,,1,,,aws_migrationhubrefactorspaces_,,migrationhubrefactorspaces_,Migration Hub Refactor Spaces,AWS,,x,,,,,Migration Hub Refactor Spaces,,, -migrationhubstrategy,migrationhubstrategy,migrationhubstrategyrecommendations,migrationhubstrategy,,migrationhubstrategy,,migrationhubstrategyrecommendations,MigrationHubStrategy,MigrationHubStrategyRecommendations,,1,,,aws_migrationhubstrategy_,,migrationhubstrategy_,Migration Hub Strategy,AWS,,x,,,,,MigrationHubStrategy,,, -mobile,mobile,mobile,mobile,,mobile,,,Mobile,Mobile,,1,,,aws_mobile_,,mobile_,Mobile,AWS,,x,,,,,Mobile,,, -,,mobileanalytics,,,,,,MobileAnalytics,MobileAnalytics,,,,,,,,Mobile Analytics,AWS,x,,,,,,,,,Only in Go SDK v1 -,,,,,,,,,,,,,,,,,Mobile SDK for Unity,AWS,x,,,,,,,,,No SDK support -,,,,,,,,,,,,,,,,,Mobile SDK for Xamarin,AWS,x,,,,,,,,,No SDK support -,,,,,,,,,,,,,,,,,Monitron,Amazon,x,,,,,,,,,No SDK support -mq,mq,mq,mq,,mq,,,MQ,MQ,,,2,,aws_mq_,,mq_,MQ,Amazon,,,,,,,mq,ListBrokers,, -mturk,mturk,mturk,mturk,,mturk,,,MTurk,MTurk,,1,,,aws_mturk_,,mturk_,MTurk (Mechanical Turk),Amazon,,x,,,,,MTurk,,, -mwaa,mwaa,mwaa,mwaa,,mwaa,,,MWAA,MWAA,,,2,,aws_mwaa_,,mwaa_,MWAA (Managed Workflows for Apache Airflow),Amazon,,,,,,,MWAA,ListEnvironments,, -neptune,neptune,neptune,neptune,,neptune,,,Neptune,Neptune,,1,,,aws_neptune_,,neptune_,Neptune,Amazon,,,,,,,Neptune,DescribeDBClusters,, -neptune-graph,neptunegraph,,neptunegraph,,neptunegraph,,,NeptuneGraph,,,,2,,aws_neptunegraph_,,neptunegraph_,Neptune Analytics,Amazon,,,,,,,Neptune Graph,ListGraphs,, -network-firewall,networkfirewall,networkfirewall,networkfirewall,,networkfirewall,,,NetworkFirewall,NetworkFirewall,,1,,,aws_networkfirewall_,,networkfirewall_,Network Firewall,AWS,,,,,,,Network Firewall,ListFirewalls,, -networkmanager,networkmanager,networkmanager,networkmanager,,networkmanager,,,NetworkManager,NetworkManager,,1,,,aws_networkmanager_,,networkmanager_,Network Manager,AWS,,,,,,,NetworkManager,ListCoreNetworks,, -,,,,,,,,,,,,,,,,,NICE DCV,,x,,,,,,,,,No SDK support -nimble,nimble,nimblestudio,nimble,,nimble,,nimblestudio,Nimble,NimbleStudio,,1,,,aws_nimble_,,nimble_,Nimble Studio,Amazon,,x,,,,,nimble,,, -oam,oam,oam,oam,,oam,,cloudwatchobservabilityaccessmanager,ObservabilityAccessManager,OAM,,,2,,aws_oam_,,oam_,CloudWatch Observability Access Manager,Amazon,,,,,,,OAM,ListLinks,, -opensearch,opensearch,opensearchservice,opensearch,,opensearch,,opensearchservice,OpenSearch,OpenSearchService,,1,,,aws_opensearch_,,opensearch_,OpenSearch,Amazon,,,,,,,OpenSearch,ListDomainNames,, -opensearchserverless,opensearchserverless,opensearchserverless,opensearchserverless,,opensearchserverless,,,OpenSearchServerless,OpenSearchServerless,,,2,,aws_opensearchserverless_,,opensearchserverless_,OpenSearch Serverless,Amazon,,,,,,,OpenSearchServerless,ListCollections,, -osis,osis,osis,osis,,osis,,opensearchingestion,OpenSearchIngestion,OSIS,,,2,,aws_osis_,,osis_,OpenSearch Ingestion,Amazon,,,,,,,OSIS,ListPipelines,, -opsworks,opsworks,opsworks,opsworks,,opsworks,,,OpsWorks,OpsWorks,,1,,,aws_opsworks_,,opsworks_,OpsWorks,AWS,,,,,,,OpsWorks,DescribeApps,, -opsworks-cm,opsworkscm,opsworkscm,opsworkscm,,opsworkscm,,,OpsWorksCM,OpsWorksCM,,1,,,aws_opsworkscm_,,opsworkscm_,OpsWorks CM,AWS,,x,,,,,OpsWorksCM,,, -organizations,organizations,organizations,organizations,,organizations,,,Organizations,Organizations,x,,2,,aws_organizations_,,organizations_,Organizations,AWS,,,,,,,Organizations,ListAccounts,, -outposts,outposts,outposts,outposts,,outposts,,,Outposts,Outposts,,1,,,aws_outposts_,,outposts_,Outposts,AWS,,,,,,,Outposts,ListSites,, -,,,,,ec2outposts,ec2,,EC2Outposts,,,,,aws_ec2_(coip_pool|local_gateway),aws_ec2outposts_,outposts_,ec2_coip_pool;ec2_local_gateway,Outposts (EC2),AWS,x,,,x,,,,,,Part of EC2 -panorama,panorama,panorama,panorama,,panorama,,,Panorama,Panorama,,1,,,aws_panorama_,,panorama_,Panorama,AWS,,x,,,,,Panorama,,, -,,,,,,,,,,,,,,,,,ParallelCluster,AWS,x,,,,,,,,,No SDK support -payment-cryptography,paymentcryptography,paymentcryptography,paymentcryptography,,paymentcryptography,,,PaymentCryptography,PaymentCryptography,,,2,,aws_paymentcryptography_,,paymentcryptography_,Payment Cryptography Control Plane,AWS,,,,,,,PaymentCryptography,ListKeys,, -pca-connector-ad,pcaconnectorad,pcaconnectorad,pcaconnectorad,,pcaconnectorad,,,PCAConnectorAD,PcaConnectorAd,,,2,,aws_pcaconnectorad_,,pcaconnectorad_,Private CA Connector for Active Directory,AWS,,,,,,,Pca Connector Ad,ListConnectors,, -personalize,personalize,personalize,personalize,,personalize,,,Personalize,Personalize,,1,,,aws_personalize_,,personalize_,Personalize,Amazon,,x,,,,,Personalize,,, -personalize-events,personalizeevents,personalizeevents,personalizeevents,,personalizeevents,,,PersonalizeEvents,PersonalizeEvents,,1,,,aws_personalizeevents_,,personalizeevents_,Personalize Events,Amazon,,x,,,,,Personalize Events,,, -personalize-runtime,personalizeruntime,personalizeruntime,personalizeruntime,,personalizeruntime,,,PersonalizeRuntime,PersonalizeRuntime,,1,,,aws_personalizeruntime_,,personalizeruntime_,Personalize Runtime,Amazon,,x,,,,,Personalize Runtime,,, -pinpoint,pinpoint,pinpoint,pinpoint,,pinpoint,,,Pinpoint,Pinpoint,,1,,,aws_pinpoint_,,pinpoint_,Pinpoint,Amazon,,,,,,,Pinpoint,GetApps,, -pinpoint-email,pinpointemail,pinpointemail,pinpointemail,,pinpointemail,,,PinpointEmail,PinpointEmail,,1,,,aws_pinpointemail_,,pinpointemail_,Pinpoint Email,Amazon,,x,,,,,Pinpoint Email,,, -pinpoint-sms-voice,pinpointsmsvoice,pinpointsmsvoice,pinpointsmsvoice,,pinpointsmsvoice,,,PinpointSMSVoice,PinpointSMSVoice,,1,,,aws_pinpointsmsvoice_,,pinpointsmsvoice_,Pinpoint SMS and Voice,Amazon,,x,,,,,Pinpoint SMS Voice,,, -pipes,pipes,pipes,pipes,,pipes,,,Pipes,Pipes,,,2,,aws_pipes_,,pipes_,EventBridge Pipes,Amazon,,,,,,,Pipes,ListPipes,, -polly,polly,polly,polly,,polly,,,Polly,Polly,,,2,,aws_polly_,,polly_,Polly,Amazon,,,,,,,Polly,ListLexicons,, -,,,,,,,,,,,,,,,,,Porting Assistant for .NET,,x,,,,,,,,,No SDK support -pricing,pricing,pricing,pricing,,pricing,,,Pricing,Pricing,,,2,,aws_pricing_,,pricing_,Pricing Calculator,AWS,,,,,,,Pricing,DescribeServices,, -proton,proton,proton,proton,,proton,,,Proton,Proton,,1,,,aws_proton_,,proton_,Proton,AWS,,x,,,,,Proton,,, -qbusiness,qbusiness,qbusiness,qbusiness,,qbusiness,,,QBusiness,QBusiness,,,2,,aws_qbusiness_,,qbusiness_,Amazon Q Business,Amazon,,,,,,,QBusiness,ListApplications,, -qldb,qldb,qldb,qldb,,qldb,,,QLDB,QLDB,,,2,,aws_qldb_,,qldb_,QLDB (Quantum Ledger Database),Amazon,,,,,,,QLDB,ListLedgers,, -qldb-session,qldbsession,qldbsession,qldbsession,,qldbsession,,,QLDBSession,QLDBSession,,1,,,aws_qldbsession_,,qldbsession_,QLDB Session,Amazon,,x,,,,,QLDB Session,,, -quicksight,quicksight,quicksight,quicksight,,quicksight,,,QuickSight,QuickSight,,1,,,aws_quicksight_,,quicksight_,QuickSight,Amazon,,,,,,,QuickSight,ListDashboards,"AwsAccountId: aws_sdkv1.String(""123456789012"")", -ram,ram,ram,ram,,ram,,,RAM,RAM,,,2,,aws_ram_,,ram_,RAM (Resource Access Manager),AWS,,,,,,,RAM,ListPermissions,, -rds,rds,rds,rds,,rds,,,RDS,RDS,,1,2,aws_(db_|rds_),aws_rds_,,rds_;db_,RDS (Relational Database),Amazon,,,,,,,RDS,DescribeDBInstances,, -rds-data,rdsdata,rdsdataservice,rdsdata,,rdsdata,,rdsdataservice,RDSData,RDSDataService,,1,,,aws_rdsdata_,,rdsdata_,RDS Data,Amazon,,x,,,,,RDS Data,,, -pi,pi,pi,pi,,pi,,,PI,PI,,1,,,aws_pi_,,pi_,RDS Performance Insights (PI),Amazon,,x,,,,,PI,,, -rbin,rbin,recyclebin,rbin,,rbin,,recyclebin,RBin,RecycleBin,,,2,,aws_rbin_,,rbin_,Recycle Bin (RBin),Amazon,,,,,,,rbin,ListRules,ResourceType: awstypes.ResourceTypeEc2Image, -,,,,,,,,,,,,,,,,,Red Hat OpenShift Service on AWS (ROSA),AWS,x,,,,,,,,,No SDK support -redshift,redshift,redshift,redshift,,redshift,,,Redshift,Redshift,,1,2,,aws_redshift_,,redshift_,Redshift,Amazon,,,,,,,Redshift,DescribeClusters,, -redshift-data,redshiftdata,redshiftdataapiservice,redshiftdata,,redshiftdata,,redshiftdataapiservice,RedshiftData,RedshiftDataAPIService,,,2,,aws_redshiftdata_,,redshiftdata_,Redshift Data,Amazon,,,,,,,Redshift Data,ListDatabases,"Database: aws_sdkv2.String(""test"")", -redshift-serverless,redshiftserverless,redshiftserverless,redshiftserverless,,redshiftserverless,,,RedshiftServerless,RedshiftServerless,,1,2,,aws_redshiftserverless_,,redshiftserverless_,Redshift Serverless,Amazon,,,,,,,Redshift Serverless,ListNamespaces,, -rekognition,rekognition,rekognition,rekognition,,rekognition,,,Rekognition,Rekognition,,,2,,aws_rekognition_,,rekognition_,Rekognition,Amazon,,,,,,,Rekognition,ListCollections,, -resiliencehub,resiliencehub,resiliencehub,resiliencehub,,resiliencehub,,,ResilienceHub,ResilienceHub,,1,,,aws_resiliencehub_,,resiliencehub_,Resilience Hub,AWS,,x,,,,,resiliencehub,,, -resource-explorer-2,resourceexplorer2,resourceexplorer2,resourceexplorer2,,resourceexplorer2,,,ResourceExplorer2,ResourceExplorer2,,,2,,aws_resourceexplorer2_,,resourceexplorer2_,Resource Explorer,AWS,,,,,,,Resource Explorer 2,ListIndexes,, -resource-groups,resourcegroups,resourcegroups,resourcegroups,,resourcegroups,,,ResourceGroups,ResourceGroups,,,2,,aws_resourcegroups_,,resourcegroups_,Resource Groups,AWS,,,,,,,Resource Groups,ListGroups,, -resourcegroupstaggingapi,resourcegroupstaggingapi,resourcegroupstaggingapi,resourcegroupstaggingapi,,resourcegroupstaggingapi,,resourcegroupstagging,ResourceGroupsTaggingAPI,ResourceGroupsTaggingAPI,,,2,,aws_resourcegroupstaggingapi_,,resourcegroupstaggingapi_,Resource Groups Tagging,AWS,,,,,,,Resource Groups Tagging API,GetResources,, -robomaker,robomaker,robomaker,robomaker,,robomaker,,,RoboMaker,RoboMaker,,1,,,aws_robomaker_,,robomaker_,RoboMaker,AWS,,x,,,,,RoboMaker,,, -rolesanywhere,rolesanywhere,rolesanywhere,rolesanywhere,,rolesanywhere,,,RolesAnywhere,RolesAnywhere,,,2,,aws_rolesanywhere_,,rolesanywhere_,Roles Anywhere,AWS,,,,,,,RolesAnywhere,ListProfiles,, -route53,route53,route53,route53,,route53,,,Route53,Route53,x,,2,aws_route53_(?!resolver_),aws_route53_,,route53_cidr_;route53_delegation_;route53_health_;route53_hosted_;route53_key_;route53_query_;route53_record;route53_traffic_;route53_vpc_;route53_zone,Route 53,Amazon,,,,,,,Route 53,ListHostedZones,, -route53domains,route53domains,route53domains,route53domains,,route53domains,,,Route53Domains,Route53Domains,x,,2,,aws_route53domains_,,route53domains_,Route 53 Domains,Amazon,,,,,,,Route 53 Domains,ListDomains,, -route53profiles,route53profiles,route53profiles,route53profiles,,route53profiles,,,Route53Profiles,Route53Profiles,,,2,,aws_route53profiles_,,route53profiles_,Route 53 Profiles,Amazon,,,,,,,Route 53 Profiles,ListProfiles,, -route53-recovery-cluster,route53recoverycluster,route53recoverycluster,route53recoverycluster,,route53recoverycluster,,,Route53RecoveryCluster,Route53RecoveryCluster,,1,,,aws_route53recoverycluster_,,route53recoverycluster_,Route 53 Recovery Cluster,Amazon,,x,,,,,Route53 Recovery Cluster,,, -route53-recovery-control-config,route53recoverycontrolconfig,route53recoverycontrolconfig,route53recoverycontrolconfig,,route53recoverycontrolconfig,,,Route53RecoveryControlConfig,Route53RecoveryControlConfig,x,1,,,aws_route53recoverycontrolconfig_,,route53recoverycontrolconfig_,Route 53 Recovery Control Config,Amazon,,,,,,,Route53 Recovery Control Config,ListClusters,, -route53-recovery-readiness,route53recoveryreadiness,route53recoveryreadiness,route53recoveryreadiness,,route53recoveryreadiness,,,Route53RecoveryReadiness,Route53RecoveryReadiness,x,1,,,aws_route53recoveryreadiness_,,route53recoveryreadiness_,Route 53 Recovery Readiness,Amazon,,,,,,,Route53 Recovery Readiness,ListCells,, -route53resolver,route53resolver,route53resolver,route53resolver,,route53resolver,,,Route53Resolver,Route53Resolver,,1,,aws_route53_resolver_,aws_route53resolver_,,route53_resolver_,Route 53 Resolver,Amazon,,,,,,,Route53Resolver,ListFirewallDomainLists,, -s3api,s3api,s3,s3,,s3,,s3api,S3,S3,x,,2,aws_(canonical_user_id|s3_bucket|s3_object|s3_directory_bucket),aws_s3_,,s3_bucket;s3_directory_bucket;s3_object;canonical_user_id,S3 (Simple Storage),Amazon,,,,,AWS_S3_ENDPOINT,TF_AWS_S3_ENDPOINT,S3,ListBuckets,, -s3control,s3control,s3control,s3control,,s3control,,,S3Control,S3Control,,,2,aws_(s3_account_|s3control_|s3_access_),aws_s3control_,,s3control;s3_account_;s3_access_,S3 Control,Amazon,,,,,,,S3 Control,ListJobs,, -glacier,glacier,glacier,glacier,,glacier,,,Glacier,Glacier,,,2,,aws_glacier_,,glacier_,S3 Glacier,Amazon,,,,,,,Glacier,ListVaults,, -s3outposts,s3outposts,s3outposts,s3outposts,,s3outposts,,,S3Outposts,S3Outposts,,1,,,aws_s3outposts_,,s3outposts_,S3 on Outposts,Amazon,,,,,,,S3Outposts,ListEndpoints,, -sagemaker,sagemaker,sagemaker,sagemaker,,sagemaker,,,SageMaker,SageMaker,,1,,,aws_sagemaker_,,sagemaker_,SageMaker,Amazon,,,,,,,SageMaker,ListClusters,, -sagemaker-a2i-runtime,sagemakera2iruntime,augmentedairuntime,sagemakera2iruntime,,sagemakera2iruntime,,augmentedairuntime,SageMakerA2IRuntime,AugmentedAIRuntime,,1,,,aws_sagemakera2iruntime_,,sagemakera2iruntime_,SageMaker A2I (Augmented AI),Amazon,,x,,,,,SageMaker A2I Runtime,,, -sagemaker-edge,sagemakeredge,sagemakeredgemanager,sagemakeredge,,sagemakeredge,,sagemakeredgemanager,SageMakerEdge,SagemakerEdgeManager,,1,,,aws_sagemakeredge_,,sagemakeredge_,SageMaker Edge Manager,Amazon,,x,,,,,Sagemaker Edge,,, -sagemaker-featurestore-runtime,sagemakerfeaturestoreruntime,sagemakerfeaturestoreruntime,sagemakerfeaturestoreruntime,,sagemakerfeaturestoreruntime,,,SageMakerFeatureStoreRuntime,SageMakerFeatureStoreRuntime,,1,,,aws_sagemakerfeaturestoreruntime_,,sagemakerfeaturestoreruntime_,SageMaker Feature Store Runtime,Amazon,,x,,,,,SageMaker FeatureStore Runtime,,, -sagemaker-runtime,sagemakerruntime,sagemakerruntime,sagemakerruntime,,sagemakerruntime,,,SageMakerRuntime,SageMakerRuntime,,1,,,aws_sagemakerruntime_,,sagemakerruntime_,SageMaker Runtime,Amazon,,x,,,,,SageMaker Runtime,,, -,,,,,,,,,,,,,,,,,SAM (Serverless Application Model),AWS,x,,,,,,,,,No SDK support -savingsplans,savingsplans,savingsplans,savingsplans,,savingsplans,,,SavingsPlans,SavingsPlans,,1,,,aws_savingsplans_,,savingsplans_,Savings Plans,AWS,,x,,,,,savingsplans,,, -,,,,,,,,,,,,,,,,,Schema Conversion Tool,AWS,x,,,,,,,,,No SDK support -sdb,sdb,simpledb,,simpledb,sdb,,sdb,SimpleDB,SimpleDB,,1,,aws_simpledb_,aws_sdb_,,simpledb_,SDB (SimpleDB),Amazon,,,,,,,SimpleDB,ListDomains,, -scheduler,scheduler,scheduler,scheduler,,scheduler,,,Scheduler,Scheduler,,,2,,aws_scheduler_,,scheduler_,EventBridge Scheduler,Amazon,,,,,,,Scheduler,ListSchedules,, -secretsmanager,secretsmanager,secretsmanager,secretsmanager,,secretsmanager,,,SecretsManager,SecretsManager,,,2,,aws_secretsmanager_,,secretsmanager_,Secrets Manager,AWS,,,,,,,Secrets Manager,ListSecrets,, -securityhub,securityhub,securityhub,securityhub,,securityhub,,,SecurityHub,SecurityHub,,,2,,aws_securityhub_,,securityhub_,Security Hub,AWS,,,,,,,SecurityHub,ListAutomationRules,, -securitylake,securitylake,securitylake,securitylake,,securitylake,,,SecurityLake,SecurityLake,,,2,,aws_securitylake_,,securitylake_,Security Lake,Amazon,,,,,,,SecurityLake,ListDataLakes,, -serverlessrepo,serverlessrepo,serverlessapplicationrepository,serverlessapplicationrepository,,serverlessrepo,,serverlessapprepo;serverlessapplicationrepository,ServerlessRepo,ServerlessApplicationRepository,,1,,aws_serverlessapplicationrepository_,aws_serverlessrepo_,,serverlessapplicationrepository_,Serverless Application Repository,AWS,,,,,,,ServerlessApplicationRepository,ListApplications,, -servicecatalog,servicecatalog,servicecatalog,servicecatalog,,servicecatalog,,,ServiceCatalog,ServiceCatalog,,1,,,aws_servicecatalog_,,servicecatalog_,Service Catalog,AWS,,,,,,,Service Catalog,ListPortfolios,, -servicecatalog-appregistry,servicecatalogappregistry,appregistry,servicecatalogappregistry,,servicecatalogappregistry,,appregistry,ServiceCatalogAppRegistry,AppRegistry,,,2,,aws_servicecatalogappregistry_,,servicecatalogappregistry_,Service Catalog AppRegistry,AWS,,,,,,,Service Catalog AppRegistry,ListApplications,, -service-quotas,servicequotas,servicequotas,servicequotas,,servicequotas,,,ServiceQuotas,ServiceQuotas,,,2,,aws_servicequotas_,,servicequotas_,Service Quotas,,,,,,,,Service Quotas,ListServices,, -ses,ses,ses,ses,,ses,,,SES,SES,,1,,,aws_ses_,,ses_,SES (Simple Email),Amazon,,,,,,,SES,ListIdentities,, -sesv2,sesv2,sesv2,sesv2,,sesv2,,,SESV2,SESV2,,,2,,aws_sesv2_,,sesv2_,SESv2 (Simple Email V2),Amazon,,,,,,,SESv2,ListContactLists,, -stepfunctions,stepfunctions,sfn,sfn,,sfn,,stepfunctions,SFN,SFN,,1,,,aws_sfn_,,sfn_,SFN (Step Functions),AWS,,,,,,,SFN,ListActivities,, -shield,shield,shield,shield,,shield,,,Shield,Shield,x,,2,,aws_shield_,,shield_,Shield,AWS,,,,,,,Shield,ListProtectionGroups,, -signer,signer,signer,signer,,signer,,,Signer,Signer,,,2,,aws_signer_,,signer_,Signer,AWS,,,,,,,signer,ListSigningJobs,, -sms,sms,sms,sms,,sms,,,SMS,SMS,,1,,,aws_sms_,,sms_,SMS (Server Migration),AWS,,x,,,,,SMS,,, -snow-device-management,snowdevicemanagement,snowdevicemanagement,snowdevicemanagement,,snowdevicemanagement,,,SnowDeviceManagement,SnowDeviceManagement,,1,,,aws_snowdevicemanagement_,,snowdevicemanagement_,Snow Device Management,AWS,,x,,,,,Snow Device Management,,, -snowball,snowball,snowball,snowball,,snowball,,,Snowball,Snowball,,1,,,aws_snowball_,,snowball_,Snow Family,AWS,,x,,,,,Snowball,,, -sns,sns,sns,sns,,sns,,,SNS,SNS,,,2,,aws_sns_,,sns_,SNS (Simple Notification),Amazon,,,,,,,SNS,ListSubscriptions,, -sqs,sqs,sqs,sqs,,sqs,,,SQS,SQS,,,2,,aws_sqs_,,sqs_,SQS (Simple Queue),Amazon,,,,,,,SQS,ListQueues,, -ssm,ssm,ssm,ssm,,ssm,,,SSM,SSM,,,2,,aws_ssm_,,ssm_,SSM (Systems Manager),AWS,,,,,,,SSM,ListDocuments,, -ssm-contacts,ssmcontacts,ssmcontacts,ssmcontacts,,ssmcontacts,,,SSMContacts,SSMContacts,,,2,,aws_ssmcontacts_,,ssmcontacts_,SSM Contacts,AWS,,,,,,,SSM Contacts,ListContacts,, -ssm-incidents,ssmincidents,ssmincidents,ssmincidents,,ssmincidents,,,SSMIncidents,SSMIncidents,,,2,,aws_ssmincidents_,,ssmincidents_,SSM Incident Manager Incidents,AWS,,,,,,,SSM Incidents,ListResponsePlans,, -ssm-sap,ssmsap,ssmsap,ssmsap,,ssmsap,,,SSMSAP,SsmSap,,,2,,aws_ssmsap_,,ssmsap_,Systems Manager for SAP,AWS,,,,,,,Ssm Sap,ListApplications,, -sso,sso,sso,sso,,sso,,,SSO,SSO,,,2,,aws_sso_,,sso_,SSO (Single Sign-On),AWS,,x,x,,,,SSO,ListAccounts,"AccessToken: aws_sdkv2.String(""mock-access-token"")", -sso-admin,ssoadmin,ssoadmin,ssoadmin,,ssoadmin,,,SSOAdmin,SSOAdmin,x,,2,,aws_ssoadmin_,,ssoadmin_,SSO Admin,AWS,,,,,,,SSO Admin,ListInstances,, -identitystore,identitystore,identitystore,identitystore,,identitystore,,,IdentityStore,IdentityStore,,,2,,aws_identitystore_,,identitystore_,SSO Identity Store,AWS,,,,,,,identitystore,ListUsers,"IdentityStoreId: aws_sdkv2.String(""d-1234567890"")", -sso-oidc,ssooidc,ssooidc,ssooidc,,ssooidc,,,SSOOIDC,SSOOIDC,,1,,,aws_ssooidc_,,ssooidc_,SSO OIDC,AWS,,x,,,,,SSO OIDC,,, -storagegateway,storagegateway,storagegateway,storagegateway,,storagegateway,,,StorageGateway,StorageGateway,,1,,,aws_storagegateway_,,storagegateway_,Storage Gateway,AWS,,,,,,,Storage Gateway,ListGateways,, -sts,sts,sts,sts,,sts,,,STS,STS,x,,2,aws_caller_identity,aws_sts_,,caller_identity,STS (Security Token),AWS,,,,,AWS_STS_ENDPOINT,TF_AWS_STS_ENDPOINT,STS,GetCallerIdentity,, -,,,,,,,,,,,,,,,,,Sumerian,Amazon,x,,,,,,,,,No SDK support -support,support,support,support,,support,,,Support,Support,,1,,,aws_support_,,support_,Support,AWS,,x,,,,,Support,,, -swf,swf,swf,swf,,swf,,,SWF,SWF,,,2,,aws_swf_,,swf_,SWF (Simple Workflow),Amazon,,,,,,,SWF,ListDomains,"RegistrationStatus: ""REGISTERED""", -,,,,,,,,,,,,,,,,,Tag Editor,AWS,x,,,,,,,,,Part of Resource Groups Tagging -textract,textract,textract,textract,,textract,,,Textract,Textract,,1,,,aws_textract_,,textract_,Textract,Amazon,,x,,,,,Textract,,, -timestream-influxdb,timestreaminfluxdb,timestreaminfluxdb,timestreaminfluxdb,,timestreaminfluxdb,,,TimestreamInfluxDB,TimestreamInfluxDB,,,2,,aws_timestreaminfluxdb_,,timestreaminfluxdb_,Timestream for InfluxDB,Amazon,,,,,,,Timestream InfluxDB,ListDbInstances,, -timestream-query,timestreamquery,timestreamquery,timestreamquery,,timestreamquery,,,TimestreamQuery,TimestreamQuery,,1,,,aws_timestreamquery_,,timestreamquery_,Timestream Query,Amazon,,x,,,,,Timestream Query,,, -timestream-write,timestreamwrite,timestreamwrite,timestreamwrite,,timestreamwrite,,,TimestreamWrite,TimestreamWrite,,,2,,aws_timestreamwrite_,,timestreamwrite_,Timestream Write,Amazon,,,,,,,Timestream Write,ListDatabases,, -,,,,,,,,,,,,,,,,,Tools for PowerShell,AWS,x,,,,,,,,,No SDK support -,,,,,,,,,,,,,,,,,Training and Certification,AWS,x,,,,,,,,,No SDK support -transcribe,transcribe,transcribeservice,transcribe,,transcribe,,transcribeservice,Transcribe,TranscribeService,,,2,,aws_transcribe_,,transcribe_,Transcribe,Amazon,,,,,,,Transcribe,ListLanguageModels,, -,,transcribestreamingservice,transcribestreaming,,transcribestreaming,,transcribestreamingservice,TranscribeStreaming,TranscribeStreamingService,,1,,,aws_transcribestreaming_,,transcribestreaming_,Transcribe Streaming,Amazon,,x,,,,,Transcribe Streaming,,, -transfer,transfer,transfer,transfer,,transfer,,,Transfer,Transfer,,,2,,aws_transfer_,,transfer_,Transfer Family,AWS,,,,,,,Transfer,ListConnectors,, -,,,,,transitgateway,ec2,,TransitGateway,,,,,aws_ec2_transit_gateway,aws_transitgateway_,transitgateway_,ec2_transit_gateway,Transit Gateway,AWS,x,,,x,,,,,,Part of EC2 -translate,translate,translate,translate,,translate,,,Translate,Translate,,1,,,aws_translate_,,translate_,Translate,Amazon,,x,,,,,Translate,,, -,,,,,,,,,,,,,,,,,Trusted Advisor,AWS,x,,,,,,,,,Part of Support -,,,,,verifiedaccess,ec2,,VerifiedAccess,,,,,aws_verifiedaccess,aws_verifiedaccess_,verifiedaccess_,verifiedaccess_,Verified Access,AWS,x,,,x,,,,,,Part of EC2 -,,,,,vpc,ec2,,VPC,,,,,aws_((default_)?(network_acl|route_table|security_group|subnet|vpc(?!_ipam))|ec2_(managed|network|subnet|traffic)|egress_only_internet|flow_log|internet_gateway|main_route_table_association|nat_gateway|network_interface|prefix_list|route\b),aws_vpc_,vpc_,default_network_;default_route_;default_security_;default_subnet;default_vpc;ec2_managed_;ec2_network_;ec2_subnet_;ec2_traffic_;egress_only_;flow_log;internet_gateway;main_route_;nat_;network_;prefix_list;route_;route\.;security_group;subnet;vpc_dhcp_;vpc_endpoint;vpc_ipv;vpc_network_performance;vpc_peering_;vpc_security_group_;vpc\.;vpcs\.,VPC (Virtual Private Cloud),Amazon,x,,,x,,,,,,Part of EC2 -vpc-lattice,vpclattice,vpclattice,vpclattice,,vpclattice,,,VPCLattice,VPCLattice,,,2,,aws_vpclattice_,,vpclattice_,VPC Lattice,Amazon,,,,,,,VPC Lattice,ListServices,, -,,,,,ipam,ec2,,IPAM,,,,,aws_vpc_ipam,aws_ipam_,ipam_,vpc_ipam,VPC IPAM (IP Address Manager),Amazon,x,,,x,,,,,,Part of EC2 -,,,,,vpnclient,ec2,,ClientVPN,,,,,aws_ec2_client_vpn,aws_vpnclient_,vpnclient_,ec2_client_vpn_,VPN (Client),AWS,x,,,x,,,,,,Part of EC2 -,,,,,vpnsite,ec2,,SiteVPN,,,,,aws_(customer_gateway|vpn_),aws_vpnsite_,vpnsite_,customer_gateway;vpn_,VPN (Site-to-Site),AWS,x,,,x,,,,,,Part of EC2 -wafv2,wafv2,wafv2,wafv2,,wafv2,,,WAFV2,WAFV2,,,2,,aws_wafv2_,,wafv2_,WAF,AWS,,,,,,,WAFV2,ListRuleGroups,Scope: awstypes.ScopeRegional, -waf,waf,waf,waf,,waf,,,WAF,WAF,,,2,,aws_waf_,,waf_,WAF Classic,AWS,,,,,,,WAF,ListRules,, -waf-regional,wafregional,wafregional,wafregional,,wafregional,,,WAFRegional,WAFRegional,,,2,,aws_wafregional_,,wafregional_,WAF Classic Regional,AWS,,,,,,,WAF Regional,ListRules,, -,,,,,,,,,,,,,,,,,WAM (WorkSpaces Application Manager),Amazon,x,,,,,,,,,No SDK support -,,,,,wavelength,ec2,,Wavelength,,,,,aws_ec2_carrier_gateway,aws_wavelength_,wavelength_,ec2_carrier_,Wavelength,AWS,x,,,x,,,,,,Part of EC2 -budgets,budgets,budgets,budgets,,budgets,,,Budgets,Budgets,,,2,,aws_budgets_,,budgets_,Web Services Budgets,Amazon,,,,,,,Budgets,DescribeBudgets,"AccountId: aws_sdkv2.String(""012345678901"")", -wellarchitected,wellarchitected,wellarchitected,wellarchitected,,wellarchitected,,,WellArchitected,WellArchitected,,,2,,aws_wellarchitected_,,wellarchitected_,Well-Architected Tool,AWS,,,,,,,WellArchitected,ListProfiles,, -workdocs,workdocs,workdocs,workdocs,,workdocs,,,WorkDocs,WorkDocs,,1,,,aws_workdocs_,,workdocs_,WorkDocs,Amazon,,x,,,,,WorkDocs,,, -worklink,worklink,worklink,worklink,,worklink,,,WorkLink,WorkLink,,1,,,aws_worklink_,,worklink_,WorkLink,Amazon,,,,,,,WorkLink,ListFleets,, -workmail,workmail,workmail,workmail,,workmail,,,WorkMail,WorkMail,,1,,,aws_workmail_,,workmail_,WorkMail,Amazon,,x,,,,,WorkMail,,, -workmailmessageflow,workmailmessageflow,workmailmessageflow,workmailmessageflow,,workmailmessageflow,,,WorkMailMessageFlow,WorkMailMessageFlow,,1,,,aws_workmailmessageflow_,,workmailmessageflow_,WorkMail Message Flow,Amazon,,x,,,,,WorkMailMessageFlow,,, -workspaces,workspaces,workspaces,workspaces,,workspaces,,,WorkSpaces,WorkSpaces,,,2,,aws_workspaces_,,workspaces_,WorkSpaces,Amazon,,,,,,,WorkSpaces,DescribeWorkspaces,, -workspaces-web,workspacesweb,workspacesweb,workspacesweb,,workspacesweb,,,WorkSpacesWeb,WorkSpacesWeb,,,2,,aws_workspacesweb_,,workspacesweb_,WorkSpaces Web,Amazon,,,,,,,WorkSpaces Web,ListPortals,, -xray,xray,xray,xray,,xray,,,XRay,XRay,,,2,,aws_xray_,,xray_,X-Ray,AWS,,,,,,,XRay,ListResourcePolicies,, -verifiedpermissions,verifiedpermissions,verifiedpermissions,verifiedpermissions,,verifiedpermissions,,,VerifiedPermissions,VerifiedPermissions,,,2,,aws_verifiedpermissions_,,verifiedpermissions_,Verified Permissions,Amazon,,,,,,,VerifiedPermissions,ListPolicyStores,, -codecatalyst,codecatalyst,codecatalyst,codecatalyst,,codecatalyst,,,CodeCatalyst,CodeCatalyst,,,2,,aws_codecatalyst_,,codecatalyst_,CodeCatalyst,Amazon,,,,,,,CodeCatalyst,ListAccessTokens,, -mediapackagev2,mediapackagev2,mediapackagev2,mediapackagev2,,mediapackagev2,,,MediaPackageV2,MediaPackageV2,,,2,aws_media_packagev2_,aws_mediapackagev2_,,media_packagev2_,Elemental MediaPackage Version 2,AWS,,,,,,,MediaPackageV2,ListChannelGroups,, +AWSCLIV2Command,AWSCLIV2CommandNoDashes,GoV1Package,GoV2Package,ProviderPackageActual,ProviderPackageCorrect,SplitPackageRealPackage,Aliases,ProviderNameUpper,GoV1ClientTypeName,SkipClientGenerate,ClientSDKV1,ClientSDKV2,ResourcePrefixActual,ResourcePrefixCorrect,FilePrefix,DocPrefix,HumanFriendly,Brand,Exclude,NotImplemented,EndpointOnly,AllowedSubcategory,DeprecatedEnvVar,TFAWSEnvVar,SDKID,EndpointAPICall,EndpointAPIParams,EndpointRegionOverride,Note +accessanalyzer,accessanalyzer,accessanalyzer,accessanalyzer,,accessanalyzer,,,AccessAnalyzer,AccessAnalyzer,,,2,,aws_accessanalyzer_,,accessanalyzer_,IAM Access Analyzer,AWS,,,,,,,AccessAnalyzer,ListAnalyzers,,, +account,account,account,account,,account,,,Account,Account,,,2,,aws_account_,,account_,Account Management,AWS,,,,,,,Account,ListRegions,,, +acm,acm,acm,acm,,acm,,,ACM,ACM,,,2,,aws_acm_,,acm_,ACM (Certificate Manager),AWS,,,,,,,ACM,ListCertificates,,, +acm-pca,acmpca,acmpca,acmpca,,acmpca,,,ACMPCA,ACMPCA,,,2,,aws_acmpca_,,acmpca_,ACM PCA (Certificate Manager Private Certificate Authority),AWS,,,,,,,ACM PCA,ListCertificateAuthorities,,, +alexaforbusiness,alexaforbusiness,alexaforbusiness,alexaforbusiness,,alexaforbusiness,,,AlexaForBusiness,AlexaForBusiness,,1,,,aws_alexaforbusiness_,,alexaforbusiness_,Alexa for Business,,,x,,,,,Alexa For Business,,,, +amp,amp,prometheusservice,amp,,amp,,prometheus;prometheusservice,AMP,PrometheusService,,,2,aws_prometheus_,aws_amp_,,prometheus_,AMP (Managed Prometheus),Amazon,,,,,,,amp,ListScrapers,,, +amplify,amplify,amplify,amplify,,amplify,,,Amplify,Amplify,,,2,,aws_amplify_,,amplify_,Amplify,AWS,,,,,,,Amplify,ListApps,,, +amplifybackend,amplifybackend,amplifybackend,amplifybackend,,amplifybackend,,,AmplifyBackend,AmplifyBackend,,1,,,aws_amplifybackend_,,amplifybackend_,Amplify Backend,AWS,,x,,,,,AmplifyBackend,,,, +amplifyuibuilder,amplifyuibuilder,amplifyuibuilder,amplifyuibuilder,,amplifyuibuilder,,,AmplifyUIBuilder,AmplifyUIBuilder,,1,,,aws_amplifyuibuilder_,,amplifyuibuilder_,Amplify UI Builder,AWS,,x,,,,,AmplifyUIBuilder,,,, +,,,,,,,,,,,,,,,,,Apache MXNet on AWS,AWS,x,,,,,,,,,,Documentation +apigateway,apigateway,apigateway,apigateway,,apigateway,,,APIGateway,APIGateway,x,,2,aws_api_gateway_,aws_apigateway_,,api_gateway_,API Gateway,Amazon,,,,,,,API Gateway,GetAccount,,, +apigatewaymanagementapi,apigatewaymanagementapi,apigatewaymanagementapi,apigatewaymanagementapi,,apigatewaymanagementapi,,,APIGatewayManagementAPI,ApiGatewayManagementApi,,1,,,aws_apigatewaymanagementapi_,,apigatewaymanagementapi_,API Gateway Management API,Amazon,,x,,,,,ApiGatewayManagementApi,,,, +apigatewayv2,apigatewayv2,apigatewayv2,apigatewayv2,,apigatewayv2,,,APIGatewayV2,ApiGatewayV2,,,2,,aws_apigatewayv2_,,apigatewayv2_,API Gateway V2,Amazon,,,,,,,ApiGatewayV2,GetApis,,, +appfabric,appfabric,appfabric,appfabric,,appfabric,,,AppFabric,AppFabric,,,2,,aws_appfabric_,,appfabric_,AppFabric,AWS,,,,,,,AppFabric,ListAppBundles,,, +appmesh,appmesh,appmesh,appmesh,,appmesh,,,AppMesh,AppMesh,,1,,,aws_appmesh_,,appmesh_,App Mesh,AWS,,,,,,,App Mesh,ListMeshes,,, +apprunner,apprunner,apprunner,apprunner,,apprunner,,,AppRunner,AppRunner,,,2,,aws_apprunner_,,apprunner_,App Runner,AWS,,,,,,,AppRunner,ListConnections,,, +,,,,,,,,,,,,,,,,,App2Container,AWS,x,,,,,,,,,,No SDK support +appconfig,appconfig,appconfig,appconfig,,appconfig,,,AppConfig,AppConfig,,,2,,aws_appconfig_,,appconfig_,AppConfig,AWS,,,,,,,AppConfig,ListApplications,,, +appconfigdata,appconfigdata,appconfigdata,appconfigdata,,appconfigdata,,,AppConfigData,AppConfigData,,1,,,aws_appconfigdata_,,appconfigdata_,AppConfig Data,AWS,,x,,,,,AppConfigData,,,, +appflow,appflow,appflow,appflow,,appflow,,,AppFlow,Appflow,,,2,,aws_appflow_,,appflow_,AppFlow,Amazon,,,,,,,Appflow,ListFlows,,, +appintegrations,appintegrations,appintegrationsservice,appintegrations,,appintegrations,,appintegrationsservice,AppIntegrations,AppIntegrationsService,,,2,,aws_appintegrations_,,appintegrations_,AppIntegrations,Amazon,,,,,,,AppIntegrations,ListApplications,,, +application-autoscaling,applicationautoscaling,applicationautoscaling,applicationautoscaling,appautoscaling,applicationautoscaling,,applicationautoscaling,AppAutoScaling,ApplicationAutoScaling,,,2,aws_appautoscaling_,aws_applicationautoscaling_,,appautoscaling_,Application Auto Scaling,,,,,,,,Application Auto Scaling,DescribeScalableTargets,ServiceNamespace: awstypes.ServiceNamespaceEcs,, +applicationcostprofiler,applicationcostprofiler,applicationcostprofiler,applicationcostprofiler,,applicationcostprofiler,,,ApplicationCostProfiler,ApplicationCostProfiler,,1,,,aws_applicationcostprofiler_,,applicationcostprofiler_,Application Cost Profiler,AWS,,x,,,,,ApplicationCostProfiler,,,, +discovery,discovery,applicationdiscoveryservice,applicationdiscoveryservice,,discovery,,applicationdiscovery;applicationdiscoveryservice,Discovery,ApplicationDiscoveryService,,1,,,aws_discovery_,,discovery_,Application Discovery,AWS,,x,,,,,Application Discovery Service,,,, +mgn,mgn,mgn,mgn,,mgn,,,Mgn,Mgn,,1,,,aws_mgn_,,mgn_,Application Migration (Mgn),AWS,,x,,,,,mgn,,,, +appstream,appstream,appstream,appstream,,appstream,,,AppStream,AppStream,,,2,,aws_appstream_,,appstream_,AppStream 2.0,Amazon,,,,,,,AppStream,ListAssociatedFleets,"StackName: aws_sdkv2.String(""test"")",, +appsync,appsync,appsync,appsync,,appsync,,,AppSync,AppSync,,1,,,aws_appsync_,,appsync_,AppSync,AWS,,,,,,,AppSync,ListDomainNames,,, +,,,,,,,,,,,,,,,,,Artifact,AWS,x,,,,,,,,,,No SDK support +athena,athena,athena,athena,,athena,,,Athena,Athena,,,2,,aws_athena_,,athena_,Athena,Amazon,,,,,,,Athena,ListDataCatalogs,,, +auditmanager,auditmanager,auditmanager,auditmanager,,auditmanager,,,AuditManager,AuditManager,,,2,,aws_auditmanager_,,auditmanager_,Audit Manager,AWS,,,,,,,AuditManager,GetAccountStatus,,, +autoscaling,autoscaling,autoscaling,autoscaling,,autoscaling,,,AutoScaling,AutoScaling,,,2,aws_(autoscaling_|launch_configuration),aws_autoscaling_,,autoscaling_;launch_configuration,Auto Scaling,,,,,,,,Auto Scaling,DescribeAutoScalingGroups,,, +autoscaling-plans,autoscalingplans,autoscalingplans,autoscalingplans,,autoscalingplans,,,AutoScalingPlans,AutoScalingPlans,,,2,,aws_autoscalingplans_,,autoscalingplans_,Auto Scaling Plans,,,,,,,,Auto Scaling Plans,DescribeScalingPlans,,, +,,,,,,,,,,,,,,,,,Backint Agent for SAP HANA,AWS,x,,,,,,,,,,No SDK support +backup,backup,backup,backup,,backup,,,Backup,Backup,,1,,,aws_backup_,,backup_,Backup,AWS,,,,,,,Backup,ListBackupPlans,,, +backup-gateway,backupgateway,backupgateway,backupgateway,,backupgateway,,,BackupGateway,BackupGateway,,1,,,aws_backupgateway_,,backupgateway_,Backup Gateway,AWS,,x,,,,,Backup Gateway,,,, +batch,batch,batch,batch,,batch,,,Batch,Batch,,1,2,,aws_batch_,,batch_,Batch,AWS,,,,,,,Batch,ListJobs,,, +bedrock,bedrock,bedrock,bedrock,,bedrock,,,Bedrock,Bedrock,,,2,,aws_bedrock_,,bedrock_,Amazon Bedrock,Amazon,,,,,,,Bedrock,ListFoundationModels,,, +bedrock-agent,bedrockagent,bedrockagent,bedrockagent,,bedrockagent,,,BedrockAgent,BedrockAgent,,,2,,aws_bedrockagent_,,bedrockagent_,Agents for Amazon Bedrock,Amazon,,,,,,,Bedrock Agent,ListAgents,,, +bcmdataexports,bcmdataexports,bcmdataexports,bcmdataexports,,bcmdataexports,,,BCMDataExports,BCMDataExports,,,2,,aws_bcmdataexports_,,bcmdataexports_,BCM Data Exports,Amazon,,,,,,,BCM Data Exports,ListExports,,, +billingconductor,billingconductor,billingconductor,,,billingconductor,,,BillingConductor,BillingConductor,,1,,,aws_billingconductor_,,billingconductor_,Billing Conductor,AWS,,x,,,,,billingconductor,,,, +braket,braket,braket,braket,,braket,,,Braket,Braket,,1,,,aws_braket_,,braket_,Braket,Amazon,,x,,,,,Braket,,,, +ce,ce,costexplorer,costexplorer,,ce,,costexplorer,CE,CostExplorer,,,2,,aws_ce_,,ce_,CE (Cost Explorer),AWS,,,,,,,Cost Explorer,ListCostCategoryDefinitions,,, +chatbot,chatbot,chatbot,chatbot,,chatbot,,,Chatbot,,x,,2,,aws_chatbot_,,chatbot_,Chatbot,AWS,,,,,,,Chatbot,GetAccountPreferences,,, +chime,chime,chime,chime,,chime,,,Chime,Chime,,1,,,aws_chime_,,chime_,Chime,Amazon,,,,,,,Chime,ListAccounts,,, +chime-sdk-identity,chimesdkidentity,chimesdkidentity,chimesdkidentity,,chimesdkidentity,,,ChimeSDKIdentity,ChimeSDKIdentity,,1,,,aws_chimesdkidentity_,,chimesdkidentity_,Chime SDK Identity,Amazon,,x,,,,,Chime SDK Identity,,,, +chime-sdk-mediapipelines,chimesdkmediapipelines,chimesdkmediapipelines,chimesdkmediapipelines,,chimesdkmediapipelines,,,ChimeSDKMediaPipelines,ChimeSDKMediaPipelines,,,2,,aws_chimesdkmediapipelines_,,chimesdkmediapipelines_,Chime SDK Media Pipelines,Amazon,,,,,,,Chime SDK Media Pipelines,ListMediaPipelines,,, +chime-sdk-meetings,chimesdkmeetings,chimesdkmeetings,chimesdkmeetings,,chimesdkmeetings,,,ChimeSDKMeetings,ChimeSDKMeetings,,1,,,aws_chimesdkmeetings_,,chimesdkmeetings_,Chime SDK Meetings,Amazon,,x,,,,,Chime SDK Meetings,,,, +chime-sdk-messaging,chimesdkmessaging,chimesdkmessaging,chimesdkmessaging,,chimesdkmessaging,,,ChimeSDKMessaging,ChimeSDKMessaging,,1,,,aws_chimesdkmessaging_,,chimesdkmessaging_,Chime SDK Messaging,Amazon,,x,,,,,Chime SDK Messaging,,,, +chime-sdk-voice,chimesdkvoice,chimesdkvoice,chimesdkvoice,,chimesdkvoice,,,ChimeSDKVoice,ChimeSDKVoice,,,2,,aws_chimesdkvoice_,,chimesdkvoice_,Chime SDK Voice,Amazon,,,,,,,Chime SDK Voice,ListPhoneNumbers,,, +cleanrooms,cleanrooms,cleanrooms,cleanrooms,,cleanrooms,,,CleanRooms,CleanRooms,,,2,,aws_cleanrooms_,,cleanrooms_,Clean Rooms,AWS,,,,,,,CleanRooms,ListCollaborations,,, +,,,,,,,,,,,,,,,,,CLI (Command Line Interface),AWS,x,,,,,,,,,,No SDK support +configure,configure,,,,,,,,,,,,,,,,CLI Configure options,AWS,x,,,,,,,,,,CLI only +ddb,ddb,,,,,,,,,,,,,,,,CLI High-level DynamoDB commands,AWS,x,,,,,,,,,,Part of DynamoDB +s3,s3,,,,,,,,,,,,,,,,CLI High-level S3 commands,AWS,x,,,,,,,,,,CLI only +history,history,,,,,,,,,,,,,,,,CLI History of commands,AWS,x,,,,,,,,,,CLI only +importexport,importexport,,,,,,,,,,,,,,,,CLI Import/Export,AWS,x,,,,,,,,,,CLI only +cli-dev,clidev,,,,,,,,,,,,,,,,CLI Internal commands for development,AWS,x,,,,,,,,,,CLI only +cloudcontrol,cloudcontrol,cloudcontrolapi,cloudcontrol,,cloudcontrol,,cloudcontrolapi,CloudControl,CloudControlApi,,,2,aws_cloudcontrolapi_,aws_cloudcontrol_,,cloudcontrolapi_,Cloud Control API,AWS,,,,,,,CloudControl,ListResourceRequests,,, +,,,,,,,,,,,,,,,,,Cloud Digital Interface SDK,AWS,x,,,,,,,,,,No SDK support +clouddirectory,clouddirectory,clouddirectory,clouddirectory,,clouddirectory,,,CloudDirectory,CloudDirectory,,1,,,aws_clouddirectory_,,clouddirectory_,Cloud Directory,Amazon,,x,,,,,CloudDirectory,,,, +servicediscovery,servicediscovery,servicediscovery,servicediscovery,,servicediscovery,,,ServiceDiscovery,ServiceDiscovery,,1,,aws_service_discovery_,aws_servicediscovery_,,service_discovery_,Cloud Map,AWS,,,,,,,ServiceDiscovery,ListNamespaces,,, +cloud9,cloud9,cloud9,cloud9,,cloud9,,,Cloud9,Cloud9,,,2,,aws_cloud9_,,cloud9_,Cloud9,AWS,,,,,,,Cloud9,ListEnvironments,,, +cloudformation,cloudformation,cloudformation,cloudformation,,cloudformation,,,CloudFormation,CloudFormation,x,,2,,aws_cloudformation_,,cloudformation_,CloudFormation,AWS,,,,,,,CloudFormation,ListStackInstances,"StackSetName: aws_sdkv2.String(""test"")",, +cloudfront,cloudfront,cloudfront,cloudfront,,cloudfront,,,CloudFront,CloudFront,,,2,,aws_cloudfront_,,cloudfront_,CloudFront,Amazon,,,,,,,CloudFront,ListDistributions,,, +cloudfront-keyvaluestore,cloudfrontkeyvaluestore,,cloudfrontkeyvaluestore,,cloudfrontkeyvaluestore,,,CloudFrontKeyValueStore,CloudFrontKeyValueStore,,,2,,aws_cloudfrontkeyvaluestore_,,cloudfrontkeyvaluestore_,CloudFront KeyValueStore,Amazon,,,,,,,CloudFront KeyValueStore,ListKeys,"KvsARN: aws_sdkv2.String(""arn:aws:cloudfront::111122223333:key-value-store/MaxAge"")",, +cloudhsm,cloudhsm,cloudhsm,cloudhsm,,,,,,,,,,,,,,CloudHSM,AWS,x,,,,,,,,,,Legacy +cloudhsmv2,cloudhsmv2,cloudhsmv2,cloudhsmv2,,cloudhsmv2,,cloudhsm,CloudHSMV2,CloudHSMV2,x,,2,aws_cloudhsm_v2_,aws_cloudhsmv2_,,cloudhsm,CloudHSM,AWS,,,,,,,CloudHSM V2,DescribeClusters,,, +cloudsearch,cloudsearch,cloudsearch,cloudsearch,,cloudsearch,,,CloudSearch,CloudSearch,,,2,,aws_cloudsearch_,,cloudsearch_,CloudSearch,Amazon,,,,,,,CloudSearch,ListDomainNames,,, +cloudsearchdomain,cloudsearchdomain,cloudsearchdomain,cloudsearchdomain,,cloudsearchdomain,,,CloudSearchDomain,CloudSearchDomain,,1,,,aws_cloudsearchdomain_,,cloudsearchdomain_,CloudSearch Domain,Amazon,,x,,,,,CloudSearch Domain,,,, +,,,,,,,,,,,,,,,,,CloudShell,AWS,x,,,,,,,,,,No SDK support +cloudtrail,cloudtrail,cloudtrail,cloudtrail,,cloudtrail,,,CloudTrail,CloudTrail,,,2,aws_cloudtrail,aws_cloudtrail_,,cloudtrail,CloudTrail,AWS,,,,,,,CloudTrail,ListChannels,,, +cloudwatch,cloudwatch,cloudwatch,cloudwatch,,cloudwatch,,,CloudWatch,CloudWatch,,,2,aws_cloudwatch_(?!(event_|log_|query_)),aws_cloudwatch_,,cloudwatch_dashboard;cloudwatch_metric_;cloudwatch_composite_,CloudWatch,Amazon,,,,,,,CloudWatch,ListDashboards,,, +application-insights,applicationinsights,applicationinsights,applicationinsights,,applicationinsights,,,ApplicationInsights,ApplicationInsights,,1,,,aws_applicationinsights_,,applicationinsights_,CloudWatch Application Insights,Amazon,,,,,,,Application Insights,CreateApplication,,, +evidently,evidently,cloudwatchevidently,evidently,,evidently,,cloudwatchevidently,Evidently,CloudWatchEvidently,,,2,,aws_evidently_,,evidently_,CloudWatch Evidently,Amazon,,,,,,,Evidently,ListProjects,,, +internetmonitor,internetmonitor,internetmonitor,internetmonitor,,internetmonitor,,,InternetMonitor,InternetMonitor,,,2,,aws_internetmonitor_,,internetmonitor_,CloudWatch Internet Monitor,Amazon,,,,,,,InternetMonitor,ListMonitors,,, +logs,logs,cloudwatchlogs,cloudwatchlogs,,logs,,cloudwatchlog;cloudwatchlogs,Logs,CloudWatchLogs,,,2,aws_cloudwatch_(log_|query_),aws_logs_,,cloudwatch_log_;cloudwatch_query_,CloudWatch Logs,Amazon,,,,,,,CloudWatch Logs,ListAnomalies,,, +rum,rum,cloudwatchrum,rum,,rum,,cloudwatchrum,RUM,CloudWatchRUM,,1,,,aws_rum_,,rum_,CloudWatch RUM,Amazon,,,,,,,RUM,ListAppMonitors,,, +synthetics,synthetics,synthetics,synthetics,,synthetics,,,Synthetics,Synthetics,,,2,,aws_synthetics_,,synthetics_,CloudWatch Synthetics,Amazon,,,,,,,synthetics,ListGroups,,, +codeartifact,codeartifact,codeartifact,codeartifact,,codeartifact,,,CodeArtifact,CodeArtifact,,,2,,aws_codeartifact_,,codeartifact_,CodeArtifact,AWS,,,,,,,codeartifact,ListDomains,,, +codebuild,codebuild,codebuild,codebuild,,codebuild,,,CodeBuild,CodeBuild,,,2,,aws_codebuild_,,codebuild_,CodeBuild,AWS,,,,,,,CodeBuild,ListBuildBatches,,, +codecommit,codecommit,codecommit,codecommit,,codecommit,,,CodeCommit,CodeCommit,,,2,,aws_codecommit_,,codecommit_,CodeCommit,AWS,,,,,,,CodeCommit,ListRepositories,,, +deploy,deploy,codedeploy,codedeploy,,deploy,,codedeploy,Deploy,CodeDeploy,,,2,aws_codedeploy_,aws_deploy_,,codedeploy_,CodeDeploy,AWS,,,,,,,CodeDeploy,ListApplications,,, +codeguruprofiler,codeguruprofiler,codeguruprofiler,codeguruprofiler,,codeguruprofiler,,,CodeGuruProfiler,CodeGuruProfiler,,,2,,aws_codeguruprofiler_,,codeguruprofiler_,CodeGuru Profiler,Amazon,,,,,,,CodeGuruProfiler,ListProfilingGroups,,, +codeguru-reviewer,codegurureviewer,codegurureviewer,codegurureviewer,,codegurureviewer,,,CodeGuruReviewer,CodeGuruReviewer,,,2,,aws_codegurureviewer_,,codegurureviewer_,CodeGuru Reviewer,Amazon,,,,,,,CodeGuru Reviewer,ListCodeReviews,Type: awstypes.TypePullRequest,, +codepipeline,codepipeline,codepipeline,codepipeline,,codepipeline,,,CodePipeline,CodePipeline,,,2,aws_codepipeline,aws_codepipeline_,,codepipeline,CodePipeline,AWS,,,,,,,CodePipeline,ListPipelines,,, +codestar,codestar,codestar,codestar,,codestar,,,CodeStar,CodeStar,,1,,,aws_codestar_,,codestar_,CodeStar,AWS,,x,,,,,CodeStar,,,, +codestar-connections,codestarconnections,codestarconnections,codestarconnections,,codestarconnections,,,CodeStarConnections,CodeStarConnections,,,2,,aws_codestarconnections_,,codestarconnections_,CodeStar Connections,AWS,,,,,,,CodeStar connections,ListConnections,,, +codestar-notifications,codestarnotifications,codestarnotifications,codestarnotifications,,codestarnotifications,,,CodeStarNotifications,CodeStarNotifications,,,2,,aws_codestarnotifications_,,codestarnotifications_,CodeStar Notifications,AWS,,,,,,,codestar notifications,ListTargets,,, +cognito-identity,cognitoidentity,cognitoidentity,cognitoidentity,,cognitoidentity,,,CognitoIdentity,CognitoIdentity,,,2,aws_cognito_identity_(?!provider),aws_cognitoidentity_,,cognito_identity_pool,Cognito Identity,Amazon,,,,,,,Cognito Identity,ListIdentityPools,MaxResults: aws_sdkv2.Int32(1),, +cognito-idp,cognitoidp,cognitoidentityprovider,cognitoidentityprovider,,cognitoidp,,cognitoidentityprovider,CognitoIDP,CognitoIdentityProvider,,1,,aws_cognito_(identity_provider|resource|user|risk),aws_cognitoidp_,,cognito_identity_provider;cognito_managed_user;cognito_resource_;cognito_user;cognito_risk,Cognito IDP (Identity Provider),Amazon,,,,,,,Cognito Identity Provider,ListUserPools,,, +cognito-sync,cognitosync,cognitosync,cognitosync,,cognitosync,,,CognitoSync,CognitoSync,,1,,,aws_cognitosync_,,cognitosync_,Cognito Sync,Amazon,,x,,,,,Cognito Sync,,,, +comprehend,comprehend,comprehend,comprehend,,comprehend,,,Comprehend,Comprehend,,,2,,aws_comprehend_,,comprehend_,Comprehend,Amazon,,,,,,,Comprehend,ListDocumentClassifiers,,, +comprehendmedical,comprehendmedical,comprehendmedical,comprehendmedical,,comprehendmedical,,,ComprehendMedical,ComprehendMedical,,1,,,aws_comprehendmedical_,,comprehendmedical_,Comprehend Medical,Amazon,,x,,,,,ComprehendMedical,,,, +compute-optimizer,computeoptimizer,computeoptimizer,computeoptimizer,,computeoptimizer,,,ComputeOptimizer,ComputeOptimizer,,,2,,aws_computeoptimizer_,,computeoptimizer_,Compute Optimizer,AWS,,,,,,,Compute Optimizer,GetEnrollmentStatus,,, +configservice,configservice,configservice,configservice,,configservice,,config,ConfigService,ConfigService,,,2,aws_config_,aws_configservice_,,config_,Config,AWS,,,,,,,Config Service,ListStoredQueries,,, +connect,connect,connect,connect,,connect,,,Connect,Connect,,1,,,aws_connect_,,connect_,Connect,Amazon,,,,,,,Connect,ListInstances,,, +connectcases,connectcases,connectcases,connectcases,,connectcases,,,ConnectCases,ConnectCases,,,2,,aws_connectcases_,,connectcases_,Connect Cases,Amazon,,,,,,,ConnectCases,ListDomains,,, +connect-contact-lens,connectcontactlens,connectcontactlens,connectcontactlens,,connectcontactlens,,,ConnectContactLens,ConnectContactLens,,1,,,aws_connectcontactlens_,,connectcontactlens_,Connect Contact Lens,Amazon,,x,,,,,Connect Contact Lens,,,, +customer-profiles,customerprofiles,customerprofiles,customerprofiles,,customerprofiles,,,CustomerProfiles,CustomerProfiles,,,2,,aws_customerprofiles_,,customerprofiles_,Connect Customer Profiles,Amazon,,,,,,,Customer Profiles,ListDomains,,, +connectparticipant,connectparticipant,connectparticipant,connectparticipant,,connectparticipant,,,ConnectParticipant,ConnectParticipant,,1,,,aws_connectparticipant_,,connectparticipant_,Connect Participant,Amazon,,x,,,,,ConnectParticipant,,,, +voice-id,voiceid,voiceid,voiceid,,voiceid,,,VoiceID,VoiceID,,1,,,aws_voiceid_,,voiceid_,Connect Voice ID,Amazon,,x,,,,,Voice ID,,,, +wisdom,wisdom,connectwisdomservice,wisdom,,wisdom,,connectwisdomservice,Wisdom,ConnectWisdomService,,1,,,aws_wisdom_,,wisdom_,Connect Wisdom,Amazon,,x,,,,,Wisdom,,,, +,,,,,,,,,,,,,,,,,Console Mobile Application,AWS,x,,,,,,,,,,No SDK support +controltower,controltower,controltower,controltower,,controltower,,,ControlTower,ControlTower,,,2,,aws_controltower_,,controltower_,Control Tower,AWS,,,,,,,ControlTower,ListLandingZones,,, +cost-optimization-hub,costoptimizationhub,costoptimizationhub,costoptimizationhub,,costoptimizationhub,,,CostOptimizationHub,CostOptimizationHub,x,,2,,aws_costoptimizationhub_,,costoptimizationhub_,Cost Optimization Hub,AWS,,,,,,,Cost Optimization Hub,GetPreferences,,, +cur,cur,costandusagereportservice,costandusagereportservice,,cur,,costandusagereportservice,CUR,CostandUsageReportService,x,,2,,aws_cur_,,cur_,Cost and Usage Report,AWS,,,,,,,Cost and Usage Report Service,DescribeReportDefinitions,,, +,,,,,,,,,,,,,,,,,Crypto Tools,AWS,x,,,,,,,,,,No SDK support +,,,,,,,,,,,,,,,,,Cryptographic Services Overview,AWS,x,,,,,,,,,,No SDK support +dataexchange,dataexchange,dataexchange,dataexchange,,dataexchange,,,DataExchange,DataExchange,,1,,,aws_dataexchange_,,dataexchange_,Data Exchange,AWS,,,,,,,DataExchange,ListDataSets,,, +datapipeline,datapipeline,datapipeline,datapipeline,,datapipeline,,,DataPipeline,DataPipeline,,1,,,aws_datapipeline_,,datapipeline_,Data Pipeline,AWS,,,,,,,Data Pipeline,ListPipelines,,, +datasync,datasync,datasync,datasync,,datasync,,,DataSync,DataSync,,,2,,aws_datasync_,,datasync_,DataSync,AWS,,,,,,,DataSync,ListAgents,,, +datazone,datazone,datazone,datazone,,datazone,,,DataZone,DataZone,,,2,,aws_datazone_,,datazone_,DataZone,Amazon,,,,,,,DataZone,ListDomains,,, +,,,,,,,,,,,,,,,,,Deep Learning AMIs,AWS,x,,,,,,,,,,No SDK support +,,,,,,,,,,,,,,,,,Deep Learning Containers,AWS,x,,,,,,,,,,No SDK support +,,,,,,,,,,,,,,,,,DeepComposer,AWS,x,,,,,,,,,,No SDK support +,,,,,,,,,,,,,,,,,DeepLens,AWS,x,,,,,,,,,,No SDK support +,,,,,,,,,,,,,,,,,DeepRacer,AWS,x,,,,,,,,,,No SDK support +detective,detective,detective,detective,,detective,,,Detective,Detective,,1,,,aws_detective_,,detective_,Detective,Amazon,,,,,,,Detective,ListGraphs,,, +devicefarm,devicefarm,devicefarm,devicefarm,,devicefarm,,,DeviceFarm,DeviceFarm,,,2,,aws_devicefarm_,,devicefarm_,Device Farm,AWS,,,,,,,Device Farm,ListDeviceInstances,,, +devops-guru,devopsguru,devopsguru,devopsguru,,devopsguru,,,DevOpsGuru,DevOpsGuru,,,2,,aws_devopsguru_,,devopsguru_,DevOps Guru,Amazon,,,,,,,DevOps Guru,DescribeAccountHealth,,, +directconnect,directconnect,directconnect,directconnect,,directconnect,,,DirectConnect,DirectConnect,,1,,aws_dx_,aws_directconnect_,,dx_,Direct Connect,AWS,,,,,,,Direct Connect,DescribeConnections,,, +dlm,dlm,dlm,dlm,,dlm,,,DLM,DLM,,,2,,aws_dlm_,,dlm_,DLM (Data Lifecycle Manager),Amazon,,,,,,,DLM,GetLifecyclePolicies,,, +dms,dms,databasemigrationservice,databasemigrationservice,,dms,,databasemigration;databasemigrationservice,DMS,DatabaseMigrationService,,1,,,aws_dms_,,dms_,DMS (Database Migration),AWS,,,,,,,Database Migration Service,DescribeCertificates,,, +docdb,docdb,docdb,docdb,,docdb,,,DocDB,DocDB,,1,,,aws_docdb_,,docdb_,DocumentDB,Amazon,,,,,,,DocDB,DescribeDBClusters,,, +docdb-elastic,docdbelastic,docdbelastic,docdbelastic,,docdbelastic,,,DocDBElastic,DocDBElastic,,,2,,aws_docdbelastic_,,docdbelastic_,DocumentDB Elastic,Amazon,,,,,,,DocDB Elastic,ListClusters,,, +drs,drs,drs,drs,,drs,,,DRS,Drs,,,2,,aws_drs_,,drs_,DRS (Elastic Disaster Recovery),AWS,,,,,,,DRS,DescribeJobs,,, +ds,ds,directoryservice,directoryservice,,ds,,directoryservice,DS,DirectoryService,,1,2,aws_directory_service_,aws_ds_,,directory_service_,Directory Service,AWS,,,,,,,Directory Service,DescribeDirectories,,, +dynamodb,dynamodb,dynamodb,dynamodb,,dynamodb,,,DynamoDB,DynamoDB,x,,2,,aws_dynamodb_,,dynamodb_,DynamoDB,Amazon,,,,,AWS_DYNAMODB_ENDPOINT,TF_AWS_DYNAMODB_ENDPOINT,DynamoDB,ListTables,,, +dax,dax,dax,dax,,dax,,,DAX,DAX,,,2,,aws_dax_,,dax_,DynamoDB Accelerator (DAX),Amazon,,,,,,,DAX,DescribeClusters,,, +dynamodbstreams,dynamodbstreams,dynamodbstreams,dynamodbstreams,,dynamodbstreams,,,DynamoDBStreams,DynamoDBStreams,,1,,,aws_dynamodbstreams_,,dynamodbstreams_,DynamoDB Streams,Amazon,,x,,,,,DynamoDB Streams,,,, +,,,,,ec2ebs,ec2,,EC2EBS,,,,,aws_(ebs_|volume_attach|snapshot_create),aws_ec2ebs_,ebs_,ebs_;volume_attachment;snapshot_,EBS (EC2),Amazon,x,,,x,,,,,,,Part of EC2 +ebs,ebs,ebs,ebs,,ebs,,,EBS,EBS,,1,,,aws_ebs_,,changewhenimplemented,EBS (Elastic Block Store),Amazon,,x,,,,,EBS,,,, +ec2,ec2,ec2,ec2,,ec2,ec2,,EC2,EC2,x,1,2,aws_(ami|availability_zone|ec2_(availability|capacity|fleet|host|instance|public_ipv4_pool|serial|spot|tag)|eip|instance|key_pair|launch_template|placement_group|spot),aws_ec2_,ec2_,ami;availability_zone;ec2_availability_;ec2_capacity_;ec2_fleet;ec2_host;ec2_image_;ec2_instance_;ec2_public_ipv4_pool;ec2_serial_;ec2_spot_;ec2_tag;eip;instance;key_pair;launch_template;placement_group;spot_,EC2 (Elastic Compute Cloud),Amazon,,,,,,,EC2,DescribeVpcs,,, +imagebuilder,imagebuilder,imagebuilder,imagebuilder,,imagebuilder,,,ImageBuilder,Imagebuilder,,1,,,aws_imagebuilder_,,imagebuilder_,EC2 Image Builder,Amazon,,,,,,,imagebuilder,ListImages,,, +ec2-instance-connect,ec2instanceconnect,ec2instanceconnect,ec2instanceconnect,,ec2instanceconnect,,,EC2InstanceConnect,EC2InstanceConnect,,1,,,aws_ec2instanceconnect_,,ec2instanceconnect_,EC2 Instance Connect,AWS,,x,,,,,EC2 Instance Connect,,,, +ecr,ecr,ecr,ecr,,ecr,,,ECR,ECR,,,2,,aws_ecr_,,ecr_,ECR (Elastic Container Registry),Amazon,,,,,,,ECR,DescribeRepositories,,, +ecr-public,ecrpublic,ecrpublic,ecrpublic,,ecrpublic,,,ECRPublic,ECRPublic,,,2,,aws_ecrpublic_,,ecrpublic_,ECR Public,Amazon,,,,,,,ECR PUBLIC,DescribeRepositories,,, +ecs,ecs,ecs,ecs,,ecs,,,ECS,ECS,,1,2,,aws_ecs_,,ecs_,ECS (Elastic Container),Amazon,,,,,,,ECS,ListClusters,,, +efs,efs,efs,efs,,efs,,,EFS,EFS,,1,,,aws_efs_,,efs_,EFS (Elastic File System),Amazon,,,,,,,EFS,DescribeFileSystems,,, +eks,eks,eks,eks,,eks,,,EKS,EKS,,,2,,aws_eks_,,eks_,EKS (Elastic Kubernetes),Amazon,,,,,,,EKS,ListClusters,,, +elasticbeanstalk,elasticbeanstalk,elasticbeanstalk,elasticbeanstalk,,elasticbeanstalk,,beanstalk,ElasticBeanstalk,ElasticBeanstalk,,,2,aws_elastic_beanstalk_,aws_elasticbeanstalk_,,elastic_beanstalk_,Elastic Beanstalk,AWS,,,,,,,Elastic Beanstalk,ListAvailableSolutionStacks,,, +elastic-inference,elasticinference,elasticinference,elasticinference,,elasticinference,,,ElasticInference,ElasticInference,,1,,,aws_elasticinference_,,elasticinference_,Elastic Inference,Amazon,,x,,,,,Elastic Inference,,,, +elastictranscoder,elastictranscoder,elastictranscoder,elastictranscoder,,elastictranscoder,,,ElasticTranscoder,ElasticTranscoder,,1,,,aws_elastictranscoder_,,elastictranscoder_,Elastic Transcoder,Amazon,,,,,,,Elastic Transcoder,ListPipelines,,, +elasticache,elasticache,elasticache,elasticache,,elasticache,,,ElastiCache,ElastiCache,,1,2,,aws_elasticache_,,elasticache_,ElastiCache,Amazon,,,,,,,ElastiCache,DescribeCacheClusters,,, +es,es,elasticsearchservice,elasticsearchservice,elasticsearch,es,,es;elasticsearchservice,Elasticsearch,ElasticsearchService,,1,,aws_elasticsearch_,aws_es_,,elasticsearch_,Elasticsearch,Amazon,,,,,,,Elasticsearch Service,ListDomainNames,,, +elbv2,elbv2,elbv2,elasticloadbalancingv2,,elbv2,,elasticloadbalancingv2,ELBV2,ELBV2,,1,2,aws_a?lb(\b|_listener|_target_group|s|_trust_store),aws_elbv2_,,lbs?\.;lb_listener;lb_target_group;lb_hosted;lb_trust_store,ELB (Elastic Load Balancing),,,,,,,,Elastic Load Balancing v2,DescribeLoadBalancers,,, +elb,elb,elb,elasticloadbalancing,,elb,,elasticloadbalancing,ELB,ELB,,1,,aws_(app_cookie_stickiness_policy|elb|lb_cookie_stickiness_policy|lb_ssl_negotiation_policy|load_balancer_|proxy_protocol_policy),aws_elb_,,app_cookie_stickiness_policy;elb;lb_cookie_stickiness_policy;lb_ssl_negotiation_policy;load_balancer;proxy_protocol_policy,ELB Classic,,,,,,,,Elastic Load Balancing,DescribeLoadBalancers,,, +mediaconnect,mediaconnect,mediaconnect,mediaconnect,,mediaconnect,,,MediaConnect,MediaConnect,,,2,,aws_mediaconnect_,,mediaconnect_,Elemental MediaConnect,AWS,,,,,,,MediaConnect,ListBridges,,, +mediaconvert,mediaconvert,mediaconvert,mediaconvert,,mediaconvert,,,MediaConvert,MediaConvert,,,2,aws_media_convert_,aws_mediaconvert_,,media_convert_,Elemental MediaConvert,AWS,,,,,,,MediaConvert,ListJobs,,, +medialive,medialive,medialive,medialive,,medialive,,,MediaLive,MediaLive,,,2,,aws_medialive_,,medialive_,Elemental MediaLive,AWS,,,,,,,MediaLive,ListOfferings,,, +mediapackage,mediapackage,mediapackage,mediapackage,,mediapackage,,,MediaPackage,MediaPackage,,,2,aws_media_package_,aws_mediapackage_,,media_package_,Elemental MediaPackage,AWS,,,,,,,MediaPackage,ListChannels,,, +mediapackage-vod,mediapackagevod,mediapackagevod,mediapackagevod,,mediapackagevod,,,MediaPackageVOD,MediaPackageVod,,1,,,aws_mediapackagevod_,,mediapackagevod_,Elemental MediaPackage VOD,AWS,,x,,,,,MediaPackage Vod,,,, +mediastore,mediastore,mediastore,mediastore,,mediastore,,,MediaStore,MediaStore,,,2,aws_media_store_,aws_mediastore_,,media_store_,Elemental MediaStore,AWS,,,,,,,MediaStore,ListContainers,,, +mediastore-data,mediastoredata,mediastoredata,mediastoredata,,mediastoredata,,,MediaStoreData,MediaStoreData,,1,,,aws_mediastoredata_,,mediastoredata_,Elemental MediaStore Data,AWS,,x,,,,,MediaStore Data,,,, +mediatailor,mediatailor,mediatailor,mediatailor,,mediatailor,,,MediaTailor,MediaTailor,,1,,,aws_mediatailor_,,media_tailor_,Elemental MediaTailor,AWS,,x,,,,,MediaTailor,,,, +,,,,,,,,,,,,,,,,,Elemental On-Premises,AWS,x,,,,,,,,,,No SDK support +emr,emr,emr,emr,,emr,,,EMR,EMR,,1,2,,aws_emr_,,emr_,EMR,Amazon,,,,,,,EMR,ListClusters,,, +emr-containers,emrcontainers,emrcontainers,emrcontainers,,emrcontainers,,,EMRContainers,EMRContainers,,1,,,aws_emrcontainers_,,emrcontainers_,EMR Containers,Amazon,,,,,,,EMR containers,ListVirtualClusters,,, +emr-serverless,emrserverless,emrserverless,emrserverless,,emrserverless,,,EMRServerless,EMRServerless,,,2,,aws_emrserverless_,,emrserverless_,EMR Serverless,Amazon,,,,,,,EMR Serverless,ListApplications,,, +,,,,,,,,,,,,,,,,,End-of-Support Migration Program (EMP) for Windows Server,AWS,x,,,,,,,,,,No SDK support +events,events,eventbridge,eventbridge,,events,,eventbridge;cloudwatchevents,Events,EventBridge,,,2,aws_cloudwatch_event_,aws_events_,,cloudwatch_event_,EventBridge,Amazon,,,,,,,EventBridge,ListEventBuses,,, +schemas,schemas,schemas,schemas,,schemas,,,Schemas,Schemas,,1,,,aws_schemas_,,schemas_,EventBridge Schemas,Amazon,,,,,,,schemas,ListRegistries,,, +fis,fis,fis,fis,,fis,,,FIS,FIS,,,2,,aws_fis_,,fis_,FIS (Fault Injection Simulator),AWS,,,,,,,fis,ListExperiments,,, +finspace,finspace,finspace,finspace,,finspace,,,FinSpace,Finspace,,,2,,aws_finspace_,,finspace_,FinSpace,Amazon,,,,,,,finspace,ListEnvironments,,, +finspace-data,finspacedata,finspacedata,finspacedata,,finspacedata,,,FinSpaceData,FinSpaceData,,1,,,aws_finspacedata_,,finspacedata_,FinSpace Data,Amazon,,x,,,,,finspace data,,,, +fms,fms,fms,fms,,fms,,,FMS,FMS,x,,2,,aws_fms_,,fms_,FMS (Firewall Manager),AWS,,,,,,,FMS,ListAppsLists,MaxResults: aws_sdkv2.Int32(1),, +forecast,forecast,forecastservice,forecast,,forecast,,forecastservice,Forecast,ForecastService,,1,,,aws_forecast_,,forecast_,Forecast,Amazon,,x,,,,,forecast,,,, +forecastquery,forecastquery,forecastqueryservice,forecastquery,,forecastquery,,forecastqueryservice,ForecastQuery,ForecastQueryService,,1,,,aws_forecastquery_,,forecastquery_,Forecast Query,Amazon,,x,,,,,forecastquery,,,, +frauddetector,frauddetector,frauddetector,frauddetector,,frauddetector,,,FraudDetector,FraudDetector,,1,,,aws_frauddetector_,,frauddetector_,Fraud Detector,Amazon,,x,,,,,FraudDetector,,,, +,,,,,,,,,,,,,,,,,FreeRTOS,,x,,,,,,,,,,No SDK support +fsx,fsx,fsx,fsx,,fsx,,,FSx,FSx,,1,,,aws_fsx_,,fsx_,FSx,Amazon,,,,,,,FSx,DescribeFileSystems,,, +gamelift,gamelift,gamelift,gamelift,,gamelift,,,GameLift,GameLift,,1,,,aws_gamelift_,,gamelift_,GameLift,Amazon,,,,,,,GameLift,ListGameServerGroups,,, +globalaccelerator,globalaccelerator,globalaccelerator,globalaccelerator,,globalaccelerator,,,GlobalAccelerator,GlobalAccelerator,x,,2,,aws_globalaccelerator_,,globalaccelerator_,Global Accelerator,AWS,,,,,,,Global Accelerator,ListAccelerators,,, +glue,glue,glue,glue,,glue,,,Glue,Glue,,1,,,aws_glue_,,glue_,Glue,AWS,,,,,,,Glue,ListRegistries,,, +databrew,databrew,gluedatabrew,databrew,,databrew,,gluedatabrew,DataBrew,GlueDataBrew,,1,,,aws_databrew_,,databrew_,Glue DataBrew,AWS,,x,,,,,DataBrew,,,, +groundstation,groundstation,groundstation,groundstation,,groundstation,,,GroundStation,GroundStation,,,2,,aws_groundstation_,,groundstation_,Ground Station,AWS,,,,,,,GroundStation,ListConfigs,,, +guardduty,guardduty,guardduty,guardduty,,guardduty,,,GuardDuty,GuardDuty,,1,,,aws_guardduty_,,guardduty_,GuardDuty,Amazon,,,,,,,GuardDuty,ListDetectors,,, +health,health,health,health,,health,,,Health,Health,,1,,,aws_health_,,health_,Health,AWS,,x,,,,,Health,,,, +healthlake,healthlake,healthlake,healthlake,,healthlake,,,HealthLake,HealthLake,,,2,,aws_healthlake_,,healthlake_,HealthLake,Amazon,,,,,,,HealthLake,ListFHIRDatastores,,, +honeycode,honeycode,honeycode,honeycode,,honeycode,,,Honeycode,Honeycode,,1,,,aws_honeycode_,,honeycode_,Honeycode,Amazon,,x,,,,,Honeycode,,,, +iam,iam,iam,iam,,iam,,,IAM,IAM,,,2,,aws_iam_,,iam_,IAM (Identity & Access Management),AWS,,,,,AWS_IAM_ENDPOINT,TF_AWS_IAM_ENDPOINT,IAM,ListRoles,,, +inspector,inspector,inspector,inspector,,inspector,,,Inspector,Inspector,,1,,,aws_inspector_,,inspector_,Inspector Classic,Amazon,,,,,,,Inspector,ListRulesPackages,,, +inspector2,inspector2,inspector2,inspector2,,inspector2,,inspectorv2,Inspector2,Inspector2,,,2,,aws_inspector2_,,inspector2_,Inspector,Amazon,,,,,,,Inspector2,ListAccountPermissions,,, +iot1click-devices,iot1clickdevices,iot1clickdevicesservice,iot1clickdevicesservice,,iot1clickdevices,,iot1clickdevicesservice,IoT1ClickDevices,IoT1ClickDevicesService,,1,,,aws_iot1clickdevices_,,iot1clickdevices_,IoT 1-Click Devices,AWS,,x,,,,,IoT 1Click Devices Service,,,, +iot1click-projects,iot1clickprojects,iot1clickprojects,iot1clickprojects,,iot1clickprojects,,,IoT1ClickProjects,IoT1ClickProjects,,1,,,aws_iot1clickprojects_,,iot1clickprojects_,IoT 1-Click Projects,AWS,,x,,,,,IoT 1Click Projects,,,, +iotanalytics,iotanalytics,iotanalytics,iotanalytics,,iotanalytics,,,IoTAnalytics,IoTAnalytics,,1,,,aws_iotanalytics_,,iotanalytics_,IoT Analytics,AWS,,,,,,,IoTAnalytics,ListChannels,,, +iot,iot,iot,iot,,iot,,,IoT,IoT,,1,,,aws_iot_,,iot_,IoT Core,AWS,,,,,,,IoT,DescribeDefaultAuthorizer,,, +iot-data,iotdata,iotdataplane,iotdataplane,,iotdata,,iotdataplane,IoTData,IoTDataPlane,,1,,,aws_iotdata_,,iotdata_,IoT Data Plane,AWS,,x,,,,,IoT Data Plane,,,, +,,,,,,,,,,,,,,,,,IoT Device Defender,AWS,x,,,,,,,,,,Part of IoT +iotdeviceadvisor,iotdeviceadvisor,iotdeviceadvisor,iotdeviceadvisor,,iotdeviceadvisor,,,IoTDeviceAdvisor,IoTDeviceAdvisor,,1,,,aws_iotdeviceadvisor_,,iotdeviceadvisor_,IoT Device Management,AWS,,x,,,,,IotDeviceAdvisor,,,, +iotevents,iotevents,iotevents,iotevents,,iotevents,,,IoTEvents,IoTEvents,,1,,,aws_iotevents_,,iotevents_,IoT Events,AWS,,,,,,,IoT Events,ListAlarmModels,,, +iotevents-data,ioteventsdata,ioteventsdata,ioteventsdata,,ioteventsdata,,,IoTEventsData,IoTEventsData,,1,,,aws_ioteventsdata_,,ioteventsdata_,IoT Events Data,AWS,,x,,,,,IoT Events Data,,,, +,,,,,,,,,,,,,,,,,IoT ExpressLink,AWS,x,,,,,,,,,,No SDK support +iotfleethub,iotfleethub,iotfleethub,iotfleethub,,iotfleethub,,,IoTFleetHub,IoTFleetHub,,1,,,aws_iotfleethub_,,iotfleethub_,IoT Fleet Hub,AWS,,x,,,,,IoTFleetHub,,,, +,,,,,,,,,,,,,,,,,IoT FleetWise,AWS,x,,,,,,IoTFleetWise,,,,No SDK support +greengrass,greengrass,greengrass,greengrass,,greengrass,,,Greengrass,Greengrass,,1,,,aws_greengrass_,,greengrass_,IoT Greengrass,AWS,,,,,,,Greengrass,ListGroups,,, +greengrassv2,greengrassv2,greengrassv2,greengrassv2,,greengrassv2,,,GreengrassV2,GreengrassV2,,1,,,aws_greengrassv2_,,greengrassv2_,IoT Greengrass V2,AWS,,x,,,,,GreengrassV2,,,, +iot-jobs-data,iotjobsdata,iotjobsdataplane,iotjobsdataplane,,iotjobsdata,,iotjobsdataplane,IoTJobsData,IoTJobsDataPlane,,1,,,aws_iotjobsdata_,,iotjobsdata_,IoT Jobs Data Plane,AWS,,x,,,,,IoT Jobs Data Plane,,,, +,,,,,,,,,,,,,,,,,IoT RoboRunner,AWS,x,,,,,,,,,,No SDK support +iotsecuretunneling,iotsecuretunneling,iotsecuretunneling,iotsecuretunneling,,iotsecuretunneling,,,IoTSecureTunneling,IoTSecureTunneling,,1,,,aws_iotsecuretunneling_,,iotsecuretunneling_,IoT Secure Tunneling,AWS,,x,,,,,IoTSecureTunneling,,,, +iotsitewise,iotsitewise,iotsitewise,iotsitewise,,iotsitewise,,,IoTSiteWise,IoTSiteWise,,1,,,aws_iotsitewise_,,iotsitewise_,IoT SiteWise,AWS,,x,,,,,IoTSiteWise,,,, +iotthingsgraph,iotthingsgraph,iotthingsgraph,iotthingsgraph,,iotthingsgraph,,,IoTThingsGraph,IoTThingsGraph,,1,,,aws_iotthingsgraph_,,iotthingsgraph_,IoT Things Graph,AWS,,x,,,,,IoTThingsGraph,,,, +iottwinmaker,iottwinmaker,iottwinmaker,iottwinmaker,,iottwinmaker,,,IoTTwinMaker,IoTTwinMaker,,1,,,aws_iottwinmaker_,,iottwinmaker_,IoT TwinMaker,AWS,,x,,,,,IoTTwinMaker,,,, +iotwireless,iotwireless,iotwireless,iotwireless,,iotwireless,,,IoTWireless,IoTWireless,,1,,,aws_iotwireless_,,iotwireless_,IoT Wireless,AWS,,x,,,,,IoT Wireless,,,, +,,,,,,,,,,,,,,,,,IQ,AWS,x,,,,,,,,,,No SDK support +ivs,ivs,ivs,ivs,,ivs,,,IVS,IVS,,1,,,aws_ivs_,,ivs_,IVS (Interactive Video),Amazon,,,,,,,ivs,ListChannels,,, +ivschat,ivschat,ivschat,ivschat,,ivschat,,,IVSChat,Ivschat,,,2,,aws_ivschat_,,ivschat_,IVS (Interactive Video) Chat,Amazon,,,,,,,ivschat,ListRooms,,, +kendra,kendra,kendra,kendra,,kendra,,,Kendra,Kendra,,,2,,aws_kendra_,,kendra_,Kendra,Amazon,,,,,,,kendra,ListIndices,,, +keyspaces,keyspaces,keyspaces,keyspaces,,keyspaces,,,Keyspaces,Keyspaces,,,2,,aws_keyspaces_,,keyspaces_,Keyspaces (for Apache Cassandra),Amazon,,,,,,,Keyspaces,ListKeyspaces,,, +kinesis,kinesis,kinesis,kinesis,,kinesis,,,Kinesis,Kinesis,x,,2,aws_kinesis_stream,aws_kinesis_,,kinesis_stream;kinesis_resource_policy,Kinesis,Amazon,,,,,,,Kinesis,ListStreams,,, +kinesisanalytics,kinesisanalytics,kinesisanalytics,kinesisanalytics,,kinesisanalytics,,,KinesisAnalytics,KinesisAnalytics,,1,,aws_kinesis_analytics_,aws_kinesisanalytics_,,kinesis_analytics_,Kinesis Analytics,Amazon,,,,,,,Kinesis Analytics,ListApplications,,, +kinesisanalyticsv2,kinesisanalyticsv2,kinesisanalyticsv2,kinesisanalyticsv2,,kinesisanalyticsv2,,,KinesisAnalyticsV2,KinesisAnalyticsV2,,1,,,aws_kinesisanalyticsv2_,,kinesisanalyticsv2_,Kinesis Analytics V2,Amazon,,,,,,,Kinesis Analytics V2,ListApplications,,, +firehose,firehose,firehose,firehose,,firehose,,,Firehose,Firehose,,,2,aws_kinesis_firehose_,aws_firehose_,,kinesis_firehose_,Kinesis Firehose,Amazon,,,,,,,Firehose,ListDeliveryStreams,,, +kinesisvideo,kinesisvideo,kinesisvideo,kinesisvideo,,kinesisvideo,,,KinesisVideo,KinesisVideo,,1,,,aws_kinesisvideo_,,kinesis_video_,Kinesis Video,Amazon,,,,,,,Kinesis Video,ListStreams,,, +kinesis-video-archived-media,kinesisvideoarchivedmedia,kinesisvideoarchivedmedia,kinesisvideoarchivedmedia,,kinesisvideoarchivedmedia,,,KinesisVideoArchivedMedia,KinesisVideoArchivedMedia,,1,,,aws_kinesisvideoarchivedmedia_,,kinesisvideoarchivedmedia_,Kinesis Video Archived Media,Amazon,,x,,,,,Kinesis Video Archived Media,,,, +kinesis-video-media,kinesisvideomedia,kinesisvideomedia,kinesisvideomedia,,kinesisvideomedia,,,KinesisVideoMedia,KinesisVideoMedia,,1,,,aws_kinesisvideomedia_,,kinesisvideomedia_,Kinesis Video Media,Amazon,,x,,,,,Kinesis Video Media,,,, +kinesis-video-signaling,kinesisvideosignaling,kinesisvideosignalingchannels,kinesisvideosignaling,,kinesisvideosignaling,,kinesisvideosignalingchannels,KinesisVideoSignaling,KinesisVideoSignalingChannels,,1,,,aws_kinesisvideosignaling_,,kinesisvideosignaling_,Kinesis Video Signaling,Amazon,,x,,,,,Kinesis Video Signaling,,,, +kms,kms,kms,kms,,kms,,,KMS,KMS,,,2,,aws_kms_,,kms_,KMS (Key Management),AWS,,,,,,,KMS,ListKeys,,, +lakeformation,lakeformation,lakeformation,lakeformation,,lakeformation,,,LakeFormation,LakeFormation,,,2,,aws_lakeformation_,,lakeformation_,Lake Formation,AWS,,,,,,,LakeFormation,ListResources,,, +lambda,lambda,lambda,lambda,,lambda,,,Lambda,Lambda,,,2,,aws_lambda_,,lambda_,Lambda,AWS,,,,,,,Lambda,ListFunctions,,, +launch-wizard,launchwizard,launchwizard,launchwizard,,launchwizard,,,LaunchWizard,LaunchWizard,,,2,,aws_launchwizard_,,launchwizard_,Launch Wizard,AWS,,,,,,,Launch Wizard,ListWorkloads,,, +lex-models,lexmodels,lexmodelbuildingservice,lexmodelbuildingservice,,lexmodels,,lexmodelbuilding;lexmodelbuildingservice;lex,LexModels,LexModelBuildingService,,1,,aws_lex_,aws_lexmodels_,,lex_,Lex Model Building,Amazon,,,,,,,Lex Model Building Service,GetBots,,, +lexv2-models,lexv2models,lexmodelsv2,lexmodelsv2,,lexv2models,,lexmodelsv2,LexV2Models,LexModelsV2,,,2,,aws_lexv2models_,,lexv2models_,Lex V2 Models,Amazon,,,,,,,Lex Models V2,ListBots,,, +lex-runtime,lexruntime,lexruntimeservice,lexruntimeservice,,lexruntime,,lexruntimeservice,LexRuntime,LexRuntimeService,,1,,,aws_lexruntime_,,lexruntime_,Lex Runtime,Amazon,,x,,,,,Lex Runtime Service,,,, +lexv2-runtime,lexv2runtime,lexruntimev2,lexruntimev2,,lexruntimev2,,lexv2runtime,LexRuntimeV2,LexRuntimeV2,,1,,,aws_lexruntimev2_,,lexruntimev2_,Lex Runtime V2,Amazon,,x,,,,,Lex Runtime V2,,,, +license-manager,licensemanager,licensemanager,licensemanager,,licensemanager,,,LicenseManager,LicenseManager,,1,,,aws_licensemanager_,,licensemanager_,License Manager,AWS,,,,,,,License Manager,ListLicenseConfigurations,,, +lightsail,lightsail,lightsail,lightsail,,lightsail,,,Lightsail,Lightsail,x,,2,,aws_lightsail_,,lightsail_,Lightsail,Amazon,,,,,,,Lightsail,GetInstances,,, +location,location,locationservice,location,,location,,locationservice,Location,LocationService,,1,,,aws_location_,,location_,Location,Amazon,,,,,,,Location,ListGeofenceCollections,,, +lookoutequipment,lookoutequipment,lookoutequipment,lookoutequipment,,lookoutequipment,,,LookoutEquipment,LookoutEquipment,,1,,,aws_lookoutequipment_,,lookoutequipment_,Lookout for Equipment,Amazon,,x,,,,,LookoutEquipment,,,, +lookoutmetrics,lookoutmetrics,lookoutmetrics,lookoutmetrics,,lookoutmetrics,,,LookoutMetrics,LookoutMetrics,,,2,,aws_lookoutmetrics_,,lookoutmetrics_,Lookout for Metrics,Amazon,,,,,,,LookoutMetrics,ListMetricSets,,, +lookoutvision,lookoutvision,lookoutforvision,lookoutvision,,lookoutvision,,lookoutforvision,LookoutVision,LookoutForVision,,1,,,aws_lookoutvision_,,lookoutvision_,Lookout for Vision,Amazon,,x,,,,,LookoutVision,,,, +,,,,,,,,,,,,,,,,,Lumberyard,Amazon,x,,,,,,,,,,No SDK support +machinelearning,machinelearning,machinelearning,machinelearning,,machinelearning,,,MachineLearning,MachineLearning,,1,,,aws_machinelearning_,,machinelearning_,Machine Learning,Amazon,,x,,,,,Machine Learning,,,, +macie2,macie2,macie2,macie2,,macie2,,,Macie2,Macie2,,1,,,aws_macie2_,,macie2_,Macie,Amazon,,,,,,,Macie2,ListFindings,,, +macie,macie,macie,macie,,macie,,,Macie,Macie,,1,,,aws_macie_,,macie_,Macie Classic,Amazon,,x,,,,,Macie,,,, +m2,m2,m2,m2,,m2,,,M2,M2,,,2,,aws_m2_,,m2_,Mainframe Modernization,AWS,,,,,,,m2,ListApplications,,, +managedblockchain,managedblockchain,managedblockchain,managedblockchain,,managedblockchain,,,ManagedBlockchain,ManagedBlockchain,,1,,,aws_managedblockchain_,,managedblockchain_,Managed Blockchain,Amazon,,x,,,,,ManagedBlockchain,,,, +grafana,grafana,managedgrafana,grafana,,grafana,,managedgrafana;amg,Grafana,ManagedGrafana,,1,,,aws_grafana_,,grafana_,Managed Grafana,Amazon,,,,,,,grafana,ListWorkspaces,,, +kafka,kafka,kafka,kafka,,kafka,,msk,Kafka,Kafka,x,,2,aws_msk_,aws_kafka_,,msk_,Managed Streaming for Kafka,Amazon,,,,,,,Kafka,ListClusters,,, +kafkaconnect,kafkaconnect,kafkaconnect,kafkaconnect,,kafkaconnect,,,KafkaConnect,KafkaConnect,,1,,aws_mskconnect_,aws_kafkaconnect_,,mskconnect_,Managed Streaming for Kafka Connect,Amazon,,,,,,,KafkaConnect,ListConnectors,,, +,,,,,,,,,,,,,,,,,Management Console,AWS,x,,,,,,,,,,No SDK support +marketplace-catalog,marketplacecatalog,marketplacecatalog,marketplacecatalog,,marketplacecatalog,,,MarketplaceCatalog,MarketplaceCatalog,,1,,,aws_marketplacecatalog_,,marketplace_catalog_,Marketplace Catalog,AWS,,x,,,,,Marketplace Catalog,,,, +marketplacecommerceanalytics,marketplacecommerceanalytics,marketplacecommerceanalytics,marketplacecommerceanalytics,,marketplacecommerceanalytics,,,MarketplaceCommerceAnalytics,MarketplaceCommerceAnalytics,,1,,,aws_marketplacecommerceanalytics_,,marketplacecommerceanalytics_,Marketplace Commerce Analytics,AWS,,x,,,,,Marketplace Commerce Analytics,,,, +marketplace-entitlement,marketplaceentitlement,marketplaceentitlementservice,marketplaceentitlementservice,,marketplaceentitlement,,marketplaceentitlementservice,MarketplaceEntitlement,MarketplaceEntitlementService,,1,,,aws_marketplaceentitlement_,,marketplaceentitlement_,Marketplace Entitlement,AWS,,x,,,,,Marketplace Entitlement Service,,,, +meteringmarketplace,meteringmarketplace,marketplacemetering,marketplacemetering,,marketplacemetering,,meteringmarketplace,MarketplaceMetering,MarketplaceMetering,,1,,,aws_marketplacemetering_,,marketplacemetering_,Marketplace Metering,AWS,,x,,,,,Marketplace Metering,,,, +memorydb,memorydb,memorydb,memorydb,,memorydb,,,MemoryDB,MemoryDB,,1,,,aws_memorydb_,,memorydb_,MemoryDB for Redis,Amazon,,,,,,,MemoryDB,DescribeClusters,,, +,,,,,meta,,,Meta,,,,,aws_(arn|billing_service_account|default_tags|ip_ranges|partition|regions?|service)$,aws_meta_,,arn;ip_ranges;billing_service_account;default_tags;partition;region;service\.,Meta Data Sources,,x,,,x,,,,,,,Not an AWS service (metadata) +mgh,mgh,migrationhub,migrationhub,,mgh,,migrationhub,MgH,MigrationHub,,1,,,aws_mgh_,,mgh_,MgH (Migration Hub),AWS,,x,,,,,Migration Hub,,,, +,,,,,,,,,,,,,,,,,Microservice Extractor for .NET,AWS,x,,,,,,,,,,No SDK support +migrationhub-config,migrationhubconfig,migrationhubconfig,migrationhubconfig,,migrationhubconfig,,,MigrationHubConfig,MigrationHubConfig,,1,,,aws_migrationhubconfig_,,migrationhubconfig_,Migration Hub Config,AWS,,x,,,,,MigrationHub Config,,,, +migration-hub-refactor-spaces,migrationhubrefactorspaces,migrationhubrefactorspaces,migrationhubrefactorspaces,,migrationhubrefactorspaces,,,MigrationHubRefactorSpaces,MigrationHubRefactorSpaces,,1,,,aws_migrationhubrefactorspaces_,,migrationhubrefactorspaces_,Migration Hub Refactor Spaces,AWS,,x,,,,,Migration Hub Refactor Spaces,,,, +migrationhubstrategy,migrationhubstrategy,migrationhubstrategyrecommendations,migrationhubstrategy,,migrationhubstrategy,,migrationhubstrategyrecommendations,MigrationHubStrategy,MigrationHubStrategyRecommendations,,1,,,aws_migrationhubstrategy_,,migrationhubstrategy_,Migration Hub Strategy,AWS,,x,,,,,MigrationHubStrategy,,,, +mobile,mobile,mobile,mobile,,mobile,,,Mobile,Mobile,,1,,,aws_mobile_,,mobile_,Mobile,AWS,,x,,,,,Mobile,,,, +,,mobileanalytics,,,,,,MobileAnalytics,MobileAnalytics,,,,,,,,Mobile Analytics,AWS,x,,,,,,,,,,Only in Go SDK v1 +,,,,,,,,,,,,,,,,,Mobile SDK for Unity,AWS,x,,,,,,,,,,No SDK support +,,,,,,,,,,,,,,,,,Mobile SDK for Xamarin,AWS,x,,,,,,,,,,No SDK support +,,,,,,,,,,,,,,,,,Monitron,Amazon,x,,,,,,,,,,No SDK support +mq,mq,mq,mq,,mq,,,MQ,MQ,,,2,,aws_mq_,,mq_,MQ,Amazon,,,,,,,mq,ListBrokers,,, +mturk,mturk,mturk,mturk,,mturk,,,MTurk,MTurk,,1,,,aws_mturk_,,mturk_,MTurk (Mechanical Turk),Amazon,,x,,,,,MTurk,,,, +mwaa,mwaa,mwaa,mwaa,,mwaa,,,MWAA,MWAA,,,2,,aws_mwaa_,,mwaa_,MWAA (Managed Workflows for Apache Airflow),Amazon,,,,,,,MWAA,ListEnvironments,,, +neptune,neptune,neptune,neptune,,neptune,,,Neptune,Neptune,,1,,,aws_neptune_,,neptune_,Neptune,Amazon,,,,,,,Neptune,DescribeDBClusters,,, +neptune-graph,neptunegraph,,neptunegraph,,neptunegraph,,,NeptuneGraph,,,,2,,aws_neptunegraph_,,neptunegraph_,Neptune Analytics,Amazon,,,,,,,Neptune Graph,ListGraphs,,, +network-firewall,networkfirewall,networkfirewall,networkfirewall,,networkfirewall,,,NetworkFirewall,NetworkFirewall,,1,,,aws_networkfirewall_,,networkfirewall_,Network Firewall,AWS,,,,,,,Network Firewall,ListFirewalls,,, +networkmanager,networkmanager,networkmanager,networkmanager,,networkmanager,,,NetworkManager,NetworkManager,,1,,,aws_networkmanager_,,networkmanager_,Network Manager,AWS,,,,,,,NetworkManager,ListCoreNetworks,,, +,,,,,,,,,,,,,,,,,NICE DCV,,x,,,,,,,,,,No SDK support +nimble,nimble,nimblestudio,nimble,,nimble,,nimblestudio,Nimble,NimbleStudio,,1,,,aws_nimble_,,nimble_,Nimble Studio,Amazon,,x,,,,,nimble,,,, +oam,oam,oam,oam,,oam,,cloudwatchobservabilityaccessmanager,ObservabilityAccessManager,OAM,,,2,,aws_oam_,,oam_,CloudWatch Observability Access Manager,Amazon,,,,,,,OAM,ListLinks,,, +opensearch,opensearch,opensearchservice,opensearch,,opensearch,,opensearchservice,OpenSearch,OpenSearchService,,1,,,aws_opensearch_,,opensearch_,OpenSearch,Amazon,,,,,,,OpenSearch,ListDomainNames,,, +opensearchserverless,opensearchserverless,opensearchserverless,opensearchserverless,,opensearchserverless,,,OpenSearchServerless,OpenSearchServerless,,,2,,aws_opensearchserverless_,,opensearchserverless_,OpenSearch Serverless,Amazon,,,,,,,OpenSearchServerless,ListCollections,,, +osis,osis,osis,osis,,osis,,opensearchingestion,OpenSearchIngestion,OSIS,,,2,,aws_osis_,,osis_,OpenSearch Ingestion,Amazon,,,,,,,OSIS,ListPipelines,,, +opsworks,opsworks,opsworks,opsworks,,opsworks,,,OpsWorks,OpsWorks,,1,,,aws_opsworks_,,opsworks_,OpsWorks,AWS,,,,,,,OpsWorks,DescribeApps,,, +opsworks-cm,opsworkscm,opsworkscm,opsworkscm,,opsworkscm,,,OpsWorksCM,OpsWorksCM,,1,,,aws_opsworkscm_,,opsworkscm_,OpsWorks CM,AWS,,x,,,,,OpsWorksCM,,,, +organizations,organizations,organizations,organizations,,organizations,,,Organizations,Organizations,x,,2,,aws_organizations_,,organizations_,Organizations,AWS,,,,,,,Organizations,ListAccounts,,, +outposts,outposts,outposts,outposts,,outposts,,,Outposts,Outposts,,1,,,aws_outposts_,,outposts_,Outposts,AWS,,,,,,,Outposts,ListSites,,, +,,,,,ec2outposts,ec2,,EC2Outposts,,,,,aws_ec2_(coip_pool|local_gateway),aws_ec2outposts_,outposts_,ec2_coip_pool;ec2_local_gateway,Outposts (EC2),AWS,x,,,x,,,,,,,Part of EC2 +panorama,panorama,panorama,panorama,,panorama,,,Panorama,Panorama,,1,,,aws_panorama_,,panorama_,Panorama,AWS,,x,,,,,Panorama,,,, +,,,,,,,,,,,,,,,,,ParallelCluster,AWS,x,,,,,,,,,,No SDK support +payment-cryptography,paymentcryptography,paymentcryptography,paymentcryptography,,paymentcryptography,,,PaymentCryptography,PaymentCryptography,,,2,,aws_paymentcryptography_,,paymentcryptography_,Payment Cryptography Control Plane,AWS,,,,,,,PaymentCryptography,ListKeys,,, +pca-connector-ad,pcaconnectorad,pcaconnectorad,pcaconnectorad,,pcaconnectorad,,,PCAConnectorAD,PcaConnectorAd,,,2,,aws_pcaconnectorad_,,pcaconnectorad_,Private CA Connector for Active Directory,AWS,,,,,,,Pca Connector Ad,ListConnectors,,, +personalize,personalize,personalize,personalize,,personalize,,,Personalize,Personalize,,1,,,aws_personalize_,,personalize_,Personalize,Amazon,,x,,,,,Personalize,,,, +personalize-events,personalizeevents,personalizeevents,personalizeevents,,personalizeevents,,,PersonalizeEvents,PersonalizeEvents,,1,,,aws_personalizeevents_,,personalizeevents_,Personalize Events,Amazon,,x,,,,,Personalize Events,,,, +personalize-runtime,personalizeruntime,personalizeruntime,personalizeruntime,,personalizeruntime,,,PersonalizeRuntime,PersonalizeRuntime,,1,,,aws_personalizeruntime_,,personalizeruntime_,Personalize Runtime,Amazon,,x,,,,,Personalize Runtime,,,, +pinpoint,pinpoint,pinpoint,pinpoint,,pinpoint,,,Pinpoint,Pinpoint,,1,,,aws_pinpoint_,,pinpoint_,Pinpoint,Amazon,,,,,,,Pinpoint,GetApps,,, +pinpoint-email,pinpointemail,pinpointemail,pinpointemail,,pinpointemail,,,PinpointEmail,PinpointEmail,,1,,,aws_pinpointemail_,,pinpointemail_,Pinpoint Email,Amazon,,x,,,,,Pinpoint Email,,,, +pinpoint-sms-voice,pinpointsmsvoice,pinpointsmsvoice,pinpointsmsvoice,,pinpointsmsvoice,,,PinpointSMSVoice,PinpointSMSVoice,,1,,,aws_pinpointsmsvoice_,,pinpointsmsvoice_,Pinpoint SMS and Voice,Amazon,,x,,,,,Pinpoint SMS Voice,,,, +pipes,pipes,pipes,pipes,,pipes,,,Pipes,Pipes,,,2,,aws_pipes_,,pipes_,EventBridge Pipes,Amazon,,,,,,,Pipes,ListPipes,,, +polly,polly,polly,polly,,polly,,,Polly,Polly,,,2,,aws_polly_,,polly_,Polly,Amazon,,,,,,,Polly,ListLexicons,,, +,,,,,,,,,,,,,,,,,Porting Assistant for .NET,,x,,,,,,,,,,No SDK support +pricing,pricing,pricing,pricing,,pricing,,,Pricing,Pricing,,,2,,aws_pricing_,,pricing_,Pricing Calculator,AWS,,,,,,,Pricing,DescribeServices,,, +proton,proton,proton,proton,,proton,,,Proton,Proton,,1,,,aws_proton_,,proton_,Proton,AWS,,x,,,,,Proton,,,, +qbusiness,qbusiness,qbusiness,qbusiness,,qbusiness,,,QBusiness,QBusiness,,,2,,aws_qbusiness_,,qbusiness_,Amazon Q Business,Amazon,,,,,,,QBusiness,ListApplications,,, +qldb,qldb,qldb,qldb,,qldb,,,QLDB,QLDB,,,2,,aws_qldb_,,qldb_,QLDB (Quantum Ledger Database),Amazon,,,,,,,QLDB,ListLedgers,,, +qldb-session,qldbsession,qldbsession,qldbsession,,qldbsession,,,QLDBSession,QLDBSession,,1,,,aws_qldbsession_,,qldbsession_,QLDB Session,Amazon,,x,,,,,QLDB Session,,,, +quicksight,quicksight,quicksight,quicksight,,quicksight,,,QuickSight,QuickSight,,1,,,aws_quicksight_,,quicksight_,QuickSight,Amazon,,,,,,,QuickSight,ListDashboards,"AwsAccountId: aws_sdkv1.String(""123456789012"")",, +ram,ram,ram,ram,,ram,,,RAM,RAM,,,2,,aws_ram_,,ram_,RAM (Resource Access Manager),AWS,,,,,,,RAM,ListPermissions,,, +rds,rds,rds,rds,,rds,,,RDS,RDS,,1,2,aws_(db_|rds_),aws_rds_,,rds_;db_,RDS (Relational Database),Amazon,,,,,,,RDS,DescribeDBInstances,,, +rds-data,rdsdata,rdsdataservice,rdsdata,,rdsdata,,rdsdataservice,RDSData,RDSDataService,,1,,,aws_rdsdata_,,rdsdata_,RDS Data,Amazon,,x,,,,,RDS Data,,,, +pi,pi,pi,pi,,pi,,,PI,PI,,1,,,aws_pi_,,pi_,RDS Performance Insights (PI),Amazon,,x,,,,,PI,,,, +rbin,rbin,recyclebin,rbin,,rbin,,recyclebin,RBin,RecycleBin,,,2,,aws_rbin_,,rbin_,Recycle Bin (RBin),Amazon,,,,,,,rbin,ListRules,ResourceType: awstypes.ResourceTypeEc2Image,, +,,,,,,,,,,,,,,,,,Red Hat OpenShift Service on AWS (ROSA),AWS,x,,,,,,,,,,No SDK support +redshift,redshift,redshift,redshift,,redshift,,,Redshift,Redshift,,1,2,,aws_redshift_,,redshift_,Redshift,Amazon,,,,,,,Redshift,DescribeClusters,,, +redshift-data,redshiftdata,redshiftdataapiservice,redshiftdata,,redshiftdata,,redshiftdataapiservice,RedshiftData,RedshiftDataAPIService,,,2,,aws_redshiftdata_,,redshiftdata_,Redshift Data,Amazon,,,,,,,Redshift Data,ListDatabases,"Database: aws_sdkv2.String(""test"")",, +redshift-serverless,redshiftserverless,redshiftserverless,redshiftserverless,,redshiftserverless,,,RedshiftServerless,RedshiftServerless,,1,2,,aws_redshiftserverless_,,redshiftserverless_,Redshift Serverless,Amazon,,,,,,,Redshift Serverless,ListNamespaces,,, +rekognition,rekognition,rekognition,rekognition,,rekognition,,,Rekognition,Rekognition,,,2,,aws_rekognition_,,rekognition_,Rekognition,Amazon,,,,,,,Rekognition,ListCollections,,, +resiliencehub,resiliencehub,resiliencehub,resiliencehub,,resiliencehub,,,ResilienceHub,ResilienceHub,,1,,,aws_resiliencehub_,,resiliencehub_,Resilience Hub,AWS,,x,,,,,resiliencehub,,,, +resource-explorer-2,resourceexplorer2,resourceexplorer2,resourceexplorer2,,resourceexplorer2,,,ResourceExplorer2,ResourceExplorer2,,,2,,aws_resourceexplorer2_,,resourceexplorer2_,Resource Explorer,AWS,,,,,,,Resource Explorer 2,ListIndexes,,, +resource-groups,resourcegroups,resourcegroups,resourcegroups,,resourcegroups,,,ResourceGroups,ResourceGroups,,,2,,aws_resourcegroups_,,resourcegroups_,Resource Groups,AWS,,,,,,,Resource Groups,ListGroups,,, +resourcegroupstaggingapi,resourcegroupstaggingapi,resourcegroupstaggingapi,resourcegroupstaggingapi,,resourcegroupstaggingapi,,resourcegroupstagging,ResourceGroupsTaggingAPI,ResourceGroupsTaggingAPI,,,2,,aws_resourcegroupstaggingapi_,,resourcegroupstaggingapi_,Resource Groups Tagging,AWS,,,,,,,Resource Groups Tagging API,GetResources,,, +robomaker,robomaker,robomaker,robomaker,,robomaker,,,RoboMaker,RoboMaker,,1,,,aws_robomaker_,,robomaker_,RoboMaker,AWS,,x,,,,,RoboMaker,,,, +rolesanywhere,rolesanywhere,rolesanywhere,rolesanywhere,,rolesanywhere,,,RolesAnywhere,RolesAnywhere,,,2,,aws_rolesanywhere_,,rolesanywhere_,Roles Anywhere,AWS,,,,,,,RolesAnywhere,ListProfiles,,, +route53,route53,route53,route53,,route53,,,Route53,Route53,x,,2,aws_route53_(?!resolver_),aws_route53_,,route53_cidr_;route53_delegation_;route53_health_;route53_hosted_;route53_key_;route53_query_;route53_record;route53_traffic_;route53_vpc_;route53_zone,Route 53,Amazon,,,,,,,Route 53,ListHostedZones,,, +route53domains,route53domains,route53domains,route53domains,,route53domains,,,Route53Domains,Route53Domains,x,,2,,aws_route53domains_,,route53domains_,Route 53 Domains,Amazon,,,,,,,Route 53 Domains,ListDomains,,, +route53profiles,route53profiles,route53profiles,route53profiles,,route53profiles,,,Route53Profiles,Route53Profiles,,,2,,aws_route53profiles_,,route53profiles_,Route 53 Profiles,Amazon,,,,,,,Route 53 Profiles,ListProfiles,,, +route53-recovery-cluster,route53recoverycluster,route53recoverycluster,route53recoverycluster,,route53recoverycluster,,,Route53RecoveryCluster,Route53RecoveryCluster,,1,,,aws_route53recoverycluster_,,route53recoverycluster_,Route 53 Recovery Cluster,Amazon,,x,,,,,Route53 Recovery Cluster,,,, +route53-recovery-control-config,route53recoverycontrolconfig,route53recoverycontrolconfig,route53recoverycontrolconfig,,route53recoverycontrolconfig,,,Route53RecoveryControlConfig,Route53RecoveryControlConfig,x,1,,,aws_route53recoverycontrolconfig_,,route53recoverycontrolconfig_,Route 53 Recovery Control Config,Amazon,,,,,,,Route53 Recovery Control Config,ListClusters,,, +route53-recovery-readiness,route53recoveryreadiness,route53recoveryreadiness,route53recoveryreadiness,,route53recoveryreadiness,,,Route53RecoveryReadiness,Route53RecoveryReadiness,x,1,,,aws_route53recoveryreadiness_,,route53recoveryreadiness_,Route 53 Recovery Readiness,Amazon,,,,,,,Route53 Recovery Readiness,ListCells,,, +route53resolver,route53resolver,route53resolver,route53resolver,,route53resolver,,,Route53Resolver,Route53Resolver,,1,,aws_route53_resolver_,aws_route53resolver_,,route53_resolver_,Route 53 Resolver,Amazon,,,,,,,Route53Resolver,ListFirewallDomainLists,,, +s3api,s3api,s3,s3,,s3,,s3api,S3,S3,x,,2,aws_(canonical_user_id|s3_bucket|s3_object|s3_directory_bucket),aws_s3_,,s3_bucket;s3_directory_bucket;s3_object;canonical_user_id,S3 (Simple Storage),Amazon,,,,,AWS_S3_ENDPOINT,TF_AWS_S3_ENDPOINT,S3,ListBuckets,,, +s3control,s3control,s3control,s3control,,s3control,,,S3Control,S3Control,,,2,aws_(s3_account_|s3control_|s3_access_),aws_s3control_,,s3control;s3_account_;s3_access_,S3 Control,Amazon,,,,,,,S3 Control,ListJobs,,, +glacier,glacier,glacier,glacier,,glacier,,,Glacier,Glacier,,,2,,aws_glacier_,,glacier_,S3 Glacier,Amazon,,,,,,,Glacier,ListVaults,,, +s3outposts,s3outposts,s3outposts,s3outposts,,s3outposts,,,S3Outposts,S3Outposts,,1,,,aws_s3outposts_,,s3outposts_,S3 on Outposts,Amazon,,,,,,,S3Outposts,ListEndpoints,,, +sagemaker,sagemaker,sagemaker,sagemaker,,sagemaker,,,SageMaker,SageMaker,,1,,,aws_sagemaker_,,sagemaker_,SageMaker,Amazon,,,,,,,SageMaker,ListClusters,,, +sagemaker-a2i-runtime,sagemakera2iruntime,augmentedairuntime,sagemakera2iruntime,,sagemakera2iruntime,,augmentedairuntime,SageMakerA2IRuntime,AugmentedAIRuntime,,1,,,aws_sagemakera2iruntime_,,sagemakera2iruntime_,SageMaker A2I (Augmented AI),Amazon,,x,,,,,SageMaker A2I Runtime,,,, +sagemaker-edge,sagemakeredge,sagemakeredgemanager,sagemakeredge,,sagemakeredge,,sagemakeredgemanager,SageMakerEdge,SagemakerEdgeManager,,1,,,aws_sagemakeredge_,,sagemakeredge_,SageMaker Edge Manager,Amazon,,x,,,,,Sagemaker Edge,,,, +sagemaker-featurestore-runtime,sagemakerfeaturestoreruntime,sagemakerfeaturestoreruntime,sagemakerfeaturestoreruntime,,sagemakerfeaturestoreruntime,,,SageMakerFeatureStoreRuntime,SageMakerFeatureStoreRuntime,,1,,,aws_sagemakerfeaturestoreruntime_,,sagemakerfeaturestoreruntime_,SageMaker Feature Store Runtime,Amazon,,x,,,,,SageMaker FeatureStore Runtime,,,, +sagemaker-runtime,sagemakerruntime,sagemakerruntime,sagemakerruntime,,sagemakerruntime,,,SageMakerRuntime,SageMakerRuntime,,1,,,aws_sagemakerruntime_,,sagemakerruntime_,SageMaker Runtime,Amazon,,x,,,,,SageMaker Runtime,,,, +,,,,,,,,,,,,,,,,,SAM (Serverless Application Model),AWS,x,,,,,,,,,,No SDK support +savingsplans,savingsplans,savingsplans,savingsplans,,savingsplans,,,SavingsPlans,SavingsPlans,,1,,,aws_savingsplans_,,savingsplans_,Savings Plans,AWS,,x,,,,,savingsplans,,,, +,,,,,,,,,,,,,,,,,Schema Conversion Tool,AWS,x,,,,,,,,,,No SDK support +sdb,sdb,simpledb,,simpledb,sdb,,sdb,SimpleDB,SimpleDB,,1,,aws_simpledb_,aws_sdb_,,simpledb_,SDB (SimpleDB),Amazon,,,,,,,SimpleDB,ListDomains,,, +scheduler,scheduler,scheduler,scheduler,,scheduler,,,Scheduler,Scheduler,,,2,,aws_scheduler_,,scheduler_,EventBridge Scheduler,Amazon,,,,,,,Scheduler,ListSchedules,,, +secretsmanager,secretsmanager,secretsmanager,secretsmanager,,secretsmanager,,,SecretsManager,SecretsManager,,,2,,aws_secretsmanager_,,secretsmanager_,Secrets Manager,AWS,,,,,,,Secrets Manager,ListSecrets,,, +securityhub,securityhub,securityhub,securityhub,,securityhub,,,SecurityHub,SecurityHub,,,2,,aws_securityhub_,,securityhub_,Security Hub,AWS,,,,,,,SecurityHub,ListAutomationRules,,, +securitylake,securitylake,securitylake,securitylake,,securitylake,,,SecurityLake,SecurityLake,,,2,,aws_securitylake_,,securitylake_,Security Lake,Amazon,,,,,,,SecurityLake,ListDataLakes,,, +serverlessrepo,serverlessrepo,serverlessapplicationrepository,serverlessapplicationrepository,,serverlessrepo,,serverlessapprepo;serverlessapplicationrepository,ServerlessRepo,ServerlessApplicationRepository,,1,,aws_serverlessapplicationrepository_,aws_serverlessrepo_,,serverlessapplicationrepository_,Serverless Application Repository,AWS,,,,,,,ServerlessApplicationRepository,ListApplications,,, +servicecatalog,servicecatalog,servicecatalog,servicecatalog,,servicecatalog,,,ServiceCatalog,ServiceCatalog,,1,,,aws_servicecatalog_,,servicecatalog_,Service Catalog,AWS,,,,,,,Service Catalog,ListPortfolios,,, +servicecatalog-appregistry,servicecatalogappregistry,appregistry,servicecatalogappregistry,,servicecatalogappregistry,,appregistry,ServiceCatalogAppRegistry,AppRegistry,,,2,,aws_servicecatalogappregistry_,,servicecatalogappregistry_,Service Catalog AppRegistry,AWS,,,,,,,Service Catalog AppRegistry,ListApplications,,, +service-quotas,servicequotas,servicequotas,servicequotas,,servicequotas,,,ServiceQuotas,ServiceQuotas,,,2,,aws_servicequotas_,,servicequotas_,Service Quotas,,,,,,,,Service Quotas,ListServices,,, +ses,ses,ses,ses,,ses,,,SES,SES,,1,,,aws_ses_,,ses_,SES (Simple Email),Amazon,,,,,,,SES,ListIdentities,,, +sesv2,sesv2,sesv2,sesv2,,sesv2,,,SESV2,SESV2,,,2,,aws_sesv2_,,sesv2_,SESv2 (Simple Email V2),Amazon,,,,,,,SESv2,ListContactLists,,, +stepfunctions,stepfunctions,sfn,sfn,,sfn,,stepfunctions,SFN,SFN,,1,,,aws_sfn_,,sfn_,SFN (Step Functions),AWS,,,,,,,SFN,ListActivities,,, +shield,shield,shield,shield,,shield,,,Shield,Shield,x,,2,,aws_shield_,,shield_,Shield,AWS,,,,,,,Shield,ListProtectionGroups,,, +signer,signer,signer,signer,,signer,,,Signer,Signer,,,2,,aws_signer_,,signer_,Signer,AWS,,,,,,,signer,ListSigningJobs,,, +sms,sms,sms,sms,,sms,,,SMS,SMS,,1,,,aws_sms_,,sms_,SMS (Server Migration),AWS,,x,,,,,SMS,,,, +snow-device-management,snowdevicemanagement,snowdevicemanagement,snowdevicemanagement,,snowdevicemanagement,,,SnowDeviceManagement,SnowDeviceManagement,,1,,,aws_snowdevicemanagement_,,snowdevicemanagement_,Snow Device Management,AWS,,x,,,,,Snow Device Management,,,, +snowball,snowball,snowball,snowball,,snowball,,,Snowball,Snowball,,1,,,aws_snowball_,,snowball_,Snow Family,AWS,,x,,,,,Snowball,,,, +sns,sns,sns,sns,,sns,,,SNS,SNS,,,2,,aws_sns_,,sns_,SNS (Simple Notification),Amazon,,,,,,,SNS,ListSubscriptions,,, +sqs,sqs,sqs,sqs,,sqs,,,SQS,SQS,,,2,,aws_sqs_,,sqs_,SQS (Simple Queue),Amazon,,,,,,,SQS,ListQueues,,, +ssm,ssm,ssm,ssm,,ssm,,,SSM,SSM,,,2,,aws_ssm_,,ssm_,SSM (Systems Manager),AWS,,,,,,,SSM,ListDocuments,,, +ssm-contacts,ssmcontacts,ssmcontacts,ssmcontacts,,ssmcontacts,,,SSMContacts,SSMContacts,,,2,,aws_ssmcontacts_,,ssmcontacts_,SSM Contacts,AWS,,,,,,,SSM Contacts,ListContacts,,, +ssm-incidents,ssmincidents,ssmincidents,ssmincidents,,ssmincidents,,,SSMIncidents,SSMIncidents,,,2,,aws_ssmincidents_,,ssmincidents_,SSM Incident Manager Incidents,AWS,,,,,,,SSM Incidents,ListResponsePlans,,, +ssm-sap,ssmsap,ssmsap,ssmsap,,ssmsap,,,SSMSAP,SsmSap,,,2,,aws_ssmsap_,,ssmsap_,Systems Manager for SAP,AWS,,,,,,,Ssm Sap,ListApplications,,, +sso,sso,sso,sso,,sso,,,SSO,SSO,,,2,,aws_sso_,,sso_,SSO (Single Sign-On),AWS,,x,x,,,,SSO,ListAccounts,"AccessToken: aws_sdkv2.String(""mock-access-token"")",, +sso-admin,ssoadmin,ssoadmin,ssoadmin,,ssoadmin,,,SSOAdmin,SSOAdmin,x,,2,,aws_ssoadmin_,,ssoadmin_,SSO Admin,AWS,,,,,,,SSO Admin,ListInstances,,, +identitystore,identitystore,identitystore,identitystore,,identitystore,,,IdentityStore,IdentityStore,,,2,,aws_identitystore_,,identitystore_,SSO Identity Store,AWS,,,,,,,identitystore,ListUsers,"IdentityStoreId: aws_sdkv2.String(""d-1234567890"")",, +sso-oidc,ssooidc,ssooidc,ssooidc,,ssooidc,,,SSOOIDC,SSOOIDC,,1,,,aws_ssooidc_,,ssooidc_,SSO OIDC,AWS,,x,,,,,SSO OIDC,,,, +storagegateway,storagegateway,storagegateway,storagegateway,,storagegateway,,,StorageGateway,StorageGateway,,1,,,aws_storagegateway_,,storagegateway_,Storage Gateway,AWS,,,,,,,Storage Gateway,ListGateways,,, +sts,sts,sts,sts,,sts,,,STS,STS,x,,2,aws_caller_identity,aws_sts_,,caller_identity,STS (Security Token),AWS,,,,,AWS_STS_ENDPOINT,TF_AWS_STS_ENDPOINT,STS,GetCallerIdentity,,, +,,,,,,,,,,,,,,,,,Sumerian,Amazon,x,,,,,,,,,,No SDK support +support,support,support,support,,support,,,Support,Support,,1,,,aws_support_,,support_,Support,AWS,,x,,,,,Support,,,, +swf,swf,swf,swf,,swf,,,SWF,SWF,,,2,,aws_swf_,,swf_,SWF (Simple Workflow),Amazon,,,,,,,SWF,ListDomains,"RegistrationStatus: ""REGISTERED""",, +,,,,,,,,,,,,,,,,,Tag Editor,AWS,x,,,,,,,,,,Part of Resource Groups Tagging +textract,textract,textract,textract,,textract,,,Textract,Textract,,1,,,aws_textract_,,textract_,Textract,Amazon,,x,,,,,Textract,,,, +timestream-influxdb,timestreaminfluxdb,timestreaminfluxdb,timestreaminfluxdb,,timestreaminfluxdb,,,TimestreamInfluxDB,TimestreamInfluxDB,,,2,,aws_timestreaminfluxdb_,,timestreaminfluxdb_,Timestream for InfluxDB,Amazon,,,,,,,Timestream InfluxDB,ListDbInstances,,, +timestream-query,timestreamquery,timestreamquery,timestreamquery,,timestreamquery,,,TimestreamQuery,TimestreamQuery,,1,,,aws_timestreamquery_,,timestreamquery_,Timestream Query,Amazon,,x,,,,,Timestream Query,,,, +timestream-write,timestreamwrite,timestreamwrite,timestreamwrite,,timestreamwrite,,,TimestreamWrite,TimestreamWrite,,,2,,aws_timestreamwrite_,,timestreamwrite_,Timestream Write,Amazon,,,,,,,Timestream Write,ListDatabases,,, +,,,,,,,,,,,,,,,,,Tools for PowerShell,AWS,x,,,,,,,,,,No SDK support +,,,,,,,,,,,,,,,,,Training and Certification,AWS,x,,,,,,,,,,No SDK support +transcribe,transcribe,transcribeservice,transcribe,,transcribe,,transcribeservice,Transcribe,TranscribeService,,,2,,aws_transcribe_,,transcribe_,Transcribe,Amazon,,,,,,,Transcribe,ListLanguageModels,,, +,,transcribestreamingservice,transcribestreaming,,transcribestreaming,,transcribestreamingservice,TranscribeStreaming,TranscribeStreamingService,,1,,,aws_transcribestreaming_,,transcribestreaming_,Transcribe Streaming,Amazon,,x,,,,,Transcribe Streaming,,,, +transfer,transfer,transfer,transfer,,transfer,,,Transfer,Transfer,,,2,,aws_transfer_,,transfer_,Transfer Family,AWS,,,,,,,Transfer,ListConnectors,,, +,,,,,transitgateway,ec2,,TransitGateway,,,,,aws_ec2_transit_gateway,aws_transitgateway_,transitgateway_,ec2_transit_gateway,Transit Gateway,AWS,x,,,x,,,,,,,Part of EC2 +translate,translate,translate,translate,,translate,,,Translate,Translate,,1,,,aws_translate_,,translate_,Translate,Amazon,,x,,,,,Translate,,,, +,,,,,,,,,,,,,,,,,Trusted Advisor,AWS,x,,,,,,,,,,Part of Support +,,,,,verifiedaccess,ec2,,VerifiedAccess,,,,,aws_verifiedaccess,aws_verifiedaccess_,verifiedaccess_,verifiedaccess_,Verified Access,AWS,x,,,x,,,,,,,Part of EC2 +,,,,,vpc,ec2,,VPC,,,,,aws_((default_)?(network_acl|route_table|security_group|subnet|vpc(?!_ipam))|ec2_(managed|network|subnet|traffic)|egress_only_internet|flow_log|internet_gateway|main_route_table_association|nat_gateway|network_interface|prefix_list|route\b),aws_vpc_,vpc_,default_network_;default_route_;default_security_;default_subnet;default_vpc;ec2_managed_;ec2_network_;ec2_subnet_;ec2_traffic_;egress_only_;flow_log;internet_gateway;main_route_;nat_;network_;prefix_list;route_;route\.;security_group;subnet;vpc_dhcp_;vpc_endpoint;vpc_ipv;vpc_network_performance;vpc_peering_;vpc_security_group_;vpc\.;vpcs\.,VPC (Virtual Private Cloud),Amazon,x,,,x,,,,,,,Part of EC2 +vpc-lattice,vpclattice,vpclattice,vpclattice,,vpclattice,,,VPCLattice,VPCLattice,,,2,,aws_vpclattice_,,vpclattice_,VPC Lattice,Amazon,,,,,,,VPC Lattice,ListServices,,, +,,,,,ipam,ec2,,IPAM,,,,,aws_vpc_ipam,aws_ipam_,ipam_,vpc_ipam,VPC IPAM (IP Address Manager),Amazon,x,,,x,,,,,,,Part of EC2 +,,,,,vpnclient,ec2,,ClientVPN,,,,,aws_ec2_client_vpn,aws_vpnclient_,vpnclient_,ec2_client_vpn_,VPN (Client),AWS,x,,,x,,,,,,,Part of EC2 +,,,,,vpnsite,ec2,,SiteVPN,,,,,aws_(customer_gateway|vpn_),aws_vpnsite_,vpnsite_,customer_gateway;vpn_,VPN (Site-to-Site),AWS,x,,,x,,,,,,,Part of EC2 +wafv2,wafv2,wafv2,wafv2,,wafv2,,,WAFV2,WAFV2,,,2,,aws_wafv2_,,wafv2_,WAF,AWS,,,,,,,WAFV2,ListRuleGroups,Scope: awstypes.ScopeRegional,, +waf,waf,waf,waf,,waf,,,WAF,WAF,,,2,,aws_waf_,,waf_,WAF Classic,AWS,,,,,,,WAF,ListRules,,, +waf-regional,wafregional,wafregional,wafregional,,wafregional,,,WAFRegional,WAFRegional,,,2,,aws_wafregional_,,wafregional_,WAF Classic Regional,AWS,,,,,,,WAF Regional,ListRules,,, +,,,,,,,,,,,,,,,,,WAM (WorkSpaces Application Manager),Amazon,x,,,,,,,,,,No SDK support +,,,,,wavelength,ec2,,Wavelength,,,,,aws_ec2_carrier_gateway,aws_wavelength_,wavelength_,ec2_carrier_,Wavelength,AWS,x,,,x,,,,,,,Part of EC2 +budgets,budgets,budgets,budgets,,budgets,,,Budgets,Budgets,,,2,,aws_budgets_,,budgets_,Web Services Budgets,Amazon,,,,,,,Budgets,DescribeBudgets,"AccountId: aws_sdkv2.String(""012345678901"")",, +wellarchitected,wellarchitected,wellarchitected,wellarchitected,,wellarchitected,,,WellArchitected,WellArchitected,,,2,,aws_wellarchitected_,,wellarchitected_,Well-Architected Tool,AWS,,,,,,,WellArchitected,ListProfiles,,, +workdocs,workdocs,workdocs,workdocs,,workdocs,,,WorkDocs,WorkDocs,,1,,,aws_workdocs_,,workdocs_,WorkDocs,Amazon,,x,,,,,WorkDocs,,,, +worklink,worklink,worklink,worklink,,worklink,,,WorkLink,WorkLink,,1,,,aws_worklink_,,worklink_,WorkLink,Amazon,,,,,,,WorkLink,ListFleets,,, +workmail,workmail,workmail,workmail,,workmail,,,WorkMail,WorkMail,,1,,,aws_workmail_,,workmail_,WorkMail,Amazon,,x,,,,,WorkMail,,,, +workmailmessageflow,workmailmessageflow,workmailmessageflow,workmailmessageflow,,workmailmessageflow,,,WorkMailMessageFlow,WorkMailMessageFlow,,1,,,aws_workmailmessageflow_,,workmailmessageflow_,WorkMail Message Flow,Amazon,,x,,,,,WorkMailMessageFlow,,,, +workspaces,workspaces,workspaces,workspaces,,workspaces,,,WorkSpaces,WorkSpaces,,,2,,aws_workspaces_,,workspaces_,WorkSpaces,Amazon,,,,,,,WorkSpaces,DescribeWorkspaces,,, +workspaces-web,workspacesweb,workspacesweb,workspacesweb,,workspacesweb,,,WorkSpacesWeb,WorkSpacesWeb,,,2,,aws_workspacesweb_,,workspacesweb_,WorkSpaces Web,Amazon,,,,,,,WorkSpaces Web,ListPortals,,, +xray,xray,xray,xray,,xray,,,XRay,XRay,,,2,,aws_xray_,,xray_,X-Ray,AWS,,,,,,,XRay,ListResourcePolicies,,, +verifiedpermissions,verifiedpermissions,verifiedpermissions,verifiedpermissions,,verifiedpermissions,,,VerifiedPermissions,VerifiedPermissions,,,2,,aws_verifiedpermissions_,,verifiedpermissions_,Verified Permissions,Amazon,,,,,,,VerifiedPermissions,ListPolicyStores,,, +codecatalyst,codecatalyst,codecatalyst,codecatalyst,,codecatalyst,,,CodeCatalyst,CodeCatalyst,,,2,,aws_codecatalyst_,,codecatalyst_,CodeCatalyst,Amazon,,,,,,,CodeCatalyst,ListAccessTokens,,, +mediapackagev2,mediapackagev2,mediapackagev2,mediapackagev2,,mediapackagev2,,,MediaPackageV2,MediaPackageV2,,,2,aws_media_packagev2_,aws_mediapackagev2_,,media_packagev2_,Elemental MediaPackage Version 2,AWS,,,,,,,MediaPackageV2,ListChannelGroups,,, diff --git a/names/data/read.go b/names/data/read.go index cd7051bf25c..854e7c0d685 100644 --- a/names/data/read.go +++ b/names/data/read.go @@ -171,6 +171,10 @@ func (sr ServiceRecord) EndpointAPIParams() string { return sr[colEndpointAPIParams] } +func (sr ServiceRecord) colEndpointOverrideRegion() string { + return sr[colEndpointOverrideRegion] +} + func (sr ServiceRecord) Note() string { return sr[colNote] } @@ -231,5 +235,6 @@ const ( colSDKID // Service SDK ID from AWS SDK for Go v2 colEndpointAPICall // API call to use for endpoint tests colEndpointAPIParams // Any needed parameters for endpoint tests + colEndpointOverrideRegion colNote ) From 3eecc2ce4c2983c16e99e2321a43e1412de31c4b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 4 Jun 2024 15:38:10 -0700 Subject: [PATCH 03/15] Adds region override for `route53` --- names/data/names_data.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/names/data/names_data.csv b/names/data/names_data.csv index 51b2e09c189..f8e8b284af6 100644 --- a/names/data/names_data.csv +++ b/names/data/names_data.csv @@ -309,7 +309,7 @@ resource-groups,resourcegroups,resourcegroups,resourcegroups,,resourcegroups,,,R resourcegroupstaggingapi,resourcegroupstaggingapi,resourcegroupstaggingapi,resourcegroupstaggingapi,,resourcegroupstaggingapi,,resourcegroupstagging,ResourceGroupsTaggingAPI,ResourceGroupsTaggingAPI,,,2,,aws_resourcegroupstaggingapi_,,resourcegroupstaggingapi_,Resource Groups Tagging,AWS,,,,,,,Resource Groups Tagging API,GetResources,,, robomaker,robomaker,robomaker,robomaker,,robomaker,,,RoboMaker,RoboMaker,,1,,,aws_robomaker_,,robomaker_,RoboMaker,AWS,,x,,,,,RoboMaker,,,, rolesanywhere,rolesanywhere,rolesanywhere,rolesanywhere,,rolesanywhere,,,RolesAnywhere,RolesAnywhere,,,2,,aws_rolesanywhere_,,rolesanywhere_,Roles Anywhere,AWS,,,,,,,RolesAnywhere,ListProfiles,,, -route53,route53,route53,route53,,route53,,,Route53,Route53,x,,2,aws_route53_(?!resolver_),aws_route53_,,route53_cidr_;route53_delegation_;route53_health_;route53_hosted_;route53_key_;route53_query_;route53_record;route53_traffic_;route53_vpc_;route53_zone,Route 53,Amazon,,,,,,,Route 53,ListHostedZones,,, +route53,route53,route53,route53,,route53,,,Route53,Route53,x,,2,aws_route53_(?!resolver_),aws_route53_,,route53_cidr_;route53_delegation_;route53_health_;route53_hosted_;route53_key_;route53_query_;route53_record;route53_traffic_;route53_vpc_;route53_zone,Route 53,Amazon,,,,,,,Route 53,ListHostedZones,,us-east-1, route53domains,route53domains,route53domains,route53domains,,route53domains,,,Route53Domains,Route53Domains,x,,2,,aws_route53domains_,,route53domains_,Route 53 Domains,Amazon,,,,,,,Route 53 Domains,ListDomains,,, route53profiles,route53profiles,route53profiles,route53profiles,,route53profiles,,,Route53Profiles,Route53Profiles,,,2,,aws_route53profiles_,,route53profiles_,Route 53 Profiles,Amazon,,,,,,,Route 53 Profiles,ListProfiles,,, route53-recovery-cluster,route53recoverycluster,route53recoverycluster,route53recoverycluster,,route53recoverycluster,,,Route53RecoveryCluster,Route53RecoveryCluster,,1,,,aws_route53recoverycluster_,,route53recoverycluster_,Route 53 Recovery Cluster,Amazon,,x,,,,,Route53 Recovery Cluster,,,, From c2c85a67c9d5a09b1b850f93bdcb723203b88fb3 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 09:17:04 -0700 Subject: [PATCH 04/15] Adds check for API call region to generated endpoint tests --- .../generate/serviceendpointtests/file.gtpl | 78 +++++++++++---- .../generate/serviceendpointtests/main.go | 14 ++- .../service_endpoints_gen_test.go | 56 +++++++++-- .../account/service_endpoints_gen_test.go | 56 +++++++++-- .../service/acm/service_endpoints_gen_test.go | 56 +++++++++-- .../acmpca/service_endpoints_gen_test.go | 56 +++++++++-- .../service/amp/service_endpoints_gen_test.go | 58 +++++++++-- .../amplify/service_endpoints_gen_test.go | 56 +++++++++-- .../apigateway/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 57 +++++++++-- .../appconfig/service_endpoints_gen_test.go | 56 +++++++++-- .../appfabric/service_endpoints_gen_test.go | 56 +++++++++-- .../appflow/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 57 +++++++++-- .../service_endpoints_gen_test.go | 96 +++++------------- .../appmesh/service_endpoints_gen_test.go | 96 +++++------------- .../apprunner/service_endpoints_gen_test.go | 56 +++++++++-- .../appstream/service_endpoints_gen_test.go | 56 +++++++++-- .../appsync/service_endpoints_gen_test.go | 96 +++++------------- .../athena/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../autoscaling/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../backup/service_endpoints_gen_test.go | 96 +++++------------- .../batch/service_endpoints_gen_test.go | 67 ++++++++++--- .../service_endpoints_gen_test.go | 56 +++++++++-- .../bedrock/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../budgets/service_endpoints_gen_test.go | 56 +++++++++-- .../service/ce/service_endpoints_gen_test.go | 57 +++++++++-- .../chatbot/service_endpoints_gen_test.go | 56 +++++++++-- .../chime/service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../cleanrooms/service_endpoints_gen_test.go | 56 +++++++++-- .../cloud9/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 57 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../cloudfront/service_endpoints_gen_test.go | 56 +++++++++-- .../cloudhsmv2/service_endpoints_gen_test.go | 57 +++++++++-- .../cloudsearch/service_endpoints_gen_test.go | 56 +++++++++-- .../cloudtrail/service_endpoints_gen_test.go | 56 +++++++++-- .../cloudwatch/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../codebuild/service_endpoints_gen_test.go | 56 +++++++++-- .../codecommit/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../cognitoidp/service_endpoints_gen_test.go | 97 +++++------------- .../comprehend/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 57 +++++++++-- .../connect/service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 58 +++++++++-- .../service/cur/service_endpoints_gen_test.go | 59 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 96 +++++------------- .../datasync/service_endpoints_gen_test.go | 56 +++++++++-- .../datazone/service_endpoints_gen_test.go | 56 +++++++++-- .../service/dax/service_endpoints_gen_test.go | 56 +++++++++-- .../deploy/service_endpoints_gen_test.go | 57 +++++++++-- .../detective/service_endpoints_gen_test.go | 96 +++++------------- .../devicefarm/service_endpoints_gen_test.go | 56 +++++++++-- .../devopsguru/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 96 +++++------------- .../service/dlm/service_endpoints_gen_test.go | 56 +++++++++-- .../service/dms/service_endpoints_gen_test.go | 98 +++++------------- .../docdb/service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service/drs/service_endpoints_gen_test.go | 56 +++++++++-- .../service/ds/service_endpoints_gen_test.go | 68 ++++++++++--- .../dynamodb/service_endpoints_gen_test.go | 58 +++++++++-- .../service/ec2/service_endpoints_gen_test.go | 67 ++++++++++--- .../service/ecr/service_endpoints_gen_test.go | 56 +++++++++-- .../ecrpublic/service_endpoints_gen_test.go | 56 +++++++++-- .../service/ecs/service_endpoints_gen_test.go | 67 ++++++++++--- .../service/efs/service_endpoints_gen_test.go | 96 +++++------------- .../service/eks/service_endpoints_gen_test.go | 56 +++++++++-- .../elasticache/service_endpoints_gen_test.go | 67 ++++++++++--- .../service_endpoints_gen_test.go | 57 +++++++++-- .../service_endpoints_gen_test.go | 98 +++++------------- .../service_endpoints_gen_test.go | 96 +++++------------- .../service/elb/service_endpoints_gen_test.go | 97 +++++------------- .../elbv2/service_endpoints_gen_test.go | 68 ++++++++++--- .../service/emr/service_endpoints_gen_test.go | 67 ++++++++++--- .../service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../events/service_endpoints_gen_test.go | 58 +++++++++-- .../evidently/service_endpoints_gen_test.go | 57 +++++++++-- .../finspace/service_endpoints_gen_test.go | 56 +++++++++-- .../firehose/service_endpoints_gen_test.go | 56 +++++++++-- .../service/fis/service_endpoints_gen_test.go | 56 +++++++++-- .../service/fms/service_endpoints_gen_test.go | 56 +++++++++-- .../service/fsx/service_endpoints_gen_test.go | 96 +++++------------- .../gamelift/service_endpoints_gen_test.go | 96 +++++------------- .../glacier/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../glue/service_endpoints_gen_test.go | 96 +++++------------- .../grafana/service_endpoints_gen_test.go | 98 +++++------------- .../greengrass/service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../guardduty/service_endpoints_gen_test.go | 96 +++++------------- .../healthlake/service_endpoints_gen_test.go | 56 +++++++++-- .../service/iam/service_endpoints_gen_test.go | 58 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 96 +++++------------- .../inspector/service_endpoints_gen_test.go | 96 +++++------------- .../inspector2/service_endpoints_gen_test.go | 57 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service/iot/service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 96 +++++------------- .../iotevents/service_endpoints_gen_test.go | 96 +++++------------- .../service/ivs/service_endpoints_gen_test.go | 96 +++++------------- .../ivschat/service_endpoints_gen_test.go | 56 +++++++++-- .../kafka/service_endpoints_gen_test.go | 57 +++++++++-- .../service_endpoints_gen_test.go | 96 +++++------------- .../kendra/service_endpoints_gen_test.go | 56 +++++++++-- .../keyspaces/service_endpoints_gen_test.go | 56 +++++++++-- .../kinesis/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 96 +++++------------- .../service/kms/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../lambda/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../lexmodels/service_endpoints_gen_test.go | 99 +++++-------------- .../lexv2models/service_endpoints_gen_test.go | 57 +++++++++-- .../service_endpoints_gen_test.go | 96 +++++------------- .../lightsail/service_endpoints_gen_test.go | 56 +++++++++-- .../location/service_endpoints_gen_test.go | 97 +++++------------- .../logs/service_endpoints_gen_test.go | 58 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service/m2/service_endpoints_gen_test.go | 56 +++++++++-- .../macie2/service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../medialive/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../mediastore/service_endpoints_gen_test.go | 56 +++++++++-- .../memorydb/service_endpoints_gen_test.go | 96 +++++------------- .../service/mq/service_endpoints_gen_test.go | 56 +++++++++-- .../neptune/service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 96 +++++------------- .../service/oam/service_endpoints_gen_test.go | 57 +++++++++-- .../opensearch/service_endpoints_gen_test.go | 97 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../opsworks/service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../osis/service_endpoints_gen_test.go | 57 +++++++++-- .../outposts/service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../pinpoint/service_endpoints_gen_test.go | 96 +++++------------- .../pipes/service_endpoints_gen_test.go | 56 +++++++++-- .../polly/service_endpoints_gen_test.go | 56 +++++++++-- .../pricing/service_endpoints_gen_test.go | 56 +++++++++-- .../qbusiness/service_endpoints_gen_test.go | 56 +++++++++-- .../qldb/service_endpoints_gen_test.go | 56 +++++++++-- .../quicksight/service_endpoints_gen_test.go | 95 +++++------------- .../service/ram/service_endpoints_gen_test.go | 56 +++++++++-- .../rbin/service_endpoints_gen_test.go | 57 +++++++++-- .../service/rds/service_endpoints_gen_test.go | 67 ++++++++++--- .../redshift/service_endpoints_gen_test.go | 67 ++++++++++--- .../service_endpoints_gen_test.go | 57 +++++++++-- .../service_endpoints_gen_test.go | 67 ++++++++++--- .../rekognition/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 57 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../route53/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 58 +++++++++-- .../service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 96 +++++------------- .../service/rum/service_endpoints_gen_test.go | 97 +++++------------- .../service/s3/service_endpoints_gen_test.go | 59 +++++++++-- .../s3outposts/service_endpoints_gen_test.go | 96 +++++------------- .../sagemaker/service_endpoints_gen_test.go | 96 +++++------------- .../scheduler/service_endpoints_gen_test.go | 56 +++++++++-- .../schemas/service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../securityhub/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 98 +++++------------- .../service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 57 +++++++++-- .../service_endpoints_gen_test.go | 96 +++++------------- .../service_endpoints_gen_test.go | 56 +++++++++-- .../service/ses/service_endpoints_gen_test.go | 96 +++++------------- .../sesv2/service_endpoints_gen_test.go | 56 +++++++++-- .../service/sfn/service_endpoints_gen_test.go | 97 +++++------------- .../shield/service_endpoints_gen_test.go | 56 +++++++++-- .../signer/service_endpoints_gen_test.go | 56 +++++++++-- .../simpledb/service_endpoints_gen_test.go | 97 +++++------------- .../service/sns/service_endpoints_gen_test.go | 56 +++++++++-- .../service/sqs/service_endpoints_gen_test.go | 56 +++++++++-- .../service/ssm/service_endpoints_gen_test.go | 56 +++++++++-- .../ssmcontacts/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../ssmsap/service_endpoints_gen_test.go | 56 +++++++++-- .../service/sso/service_endpoints_gen_test.go | 56 +++++++++-- .../ssoadmin/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 96 +++++------------- .../service/sts/service_endpoints_gen_test.go | 58 +++++++++-- .../service/swf/service_endpoints_gen_test.go | 56 +++++++++-- .../synthetics/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../transcribe/service_endpoints_gen_test.go | 57 +++++++++-- .../transfer/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../vpclattice/service_endpoints_gen_test.go | 56 +++++++++-- .../service/waf/service_endpoints_gen_test.go | 56 +++++++++-- .../wafregional/service_endpoints_gen_test.go | 56 +++++++++-- .../wafv2/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../worklink/service_endpoints_gen_test.go | 96 +++++------------- .../workspaces/service_endpoints_gen_test.go | 56 +++++++++-- .../service_endpoints_gen_test.go | 56 +++++++++-- .../xray/service_endpoints_gen_test.go | 56 +++++++++-- names/data/read.go | 2 +- 231 files changed, 9485 insertions(+), 6027 deletions(-) diff --git a/internal/generate/serviceendpointtests/file.gtpl b/internal/generate/serviceendpointtests/file.gtpl index 6833595bd91..86b69d09145 100644 --- a/internal/generate/serviceendpointtests/file.gtpl +++ b/internal/generate/serviceendpointtests/file.gtpl @@ -6,6 +6,7 @@ import ( "context" {{- if ne .GoV2Package "" }} "errors" + "reflect" {{- end }} "fmt" "maps" @@ -14,14 +15,11 @@ import ( {{- end }} "os" "path/filepath" - "reflect" "strings" "testing" {{ if ne .GoV1Package "" }} - {{ if .ImportAWS_V1 }} aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - {{ end -}} {{ if eq .GoV2Package "" }}"github.com/aws/aws-sdk-go/aws/endpoints"{{ end }} {{ .GoV1Package }}_sdkv1 "github.com/aws/aws-sdk-go/service/{{ .GoV1Package }}" {{- end }} @@ -30,13 +28,14 @@ import ( {{- end -}} {{- if ne .GoV2Package "" }} aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" {{ .GoV2Package }}_sdkv2 "github.com/aws/aws-sdk-go-v2/service/{{ .GoV2Package }}" {{- if .ImportAwsTypes }} awstypes "github.com/aws/aws-sdk-go-v2/service/{{ .GoV2Package }}/types" {{- end }} - {{- end }} "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + {{- end }} "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" {{- if gt (len .Aliases) 0 }} @@ -70,11 +69,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -577,19 +582,20 @@ func defaultFIPSEndpoint(region string) string { } {{ if ne .GoV2Package "" }} -func callService{{ if ne .GoV1Package "" }}V2{{ end }}(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService{{ if ne .GoV1Package "" }}V2{{ end }}(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.{{ .ProviderNameUpper }}Client(ctx) + var result apiCallParams + _, err := client.{{ .APICall }}(ctx, &{{ .GoV2Package }}_sdkv2.{{ .APICall }}Input{ {{ if ne .APICallParams "" }}{{ .APICallParams }},{{ end }} }, func(opts *{{ .GoV2Package }}_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -600,12 +606,12 @@ func callService{{ if ne .GoV1Package "" }}V2{{ end }}(ctx context.Context, t *t t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } {{ end }} {{ if ne .GoV1Package "" }} -func callService{{ if ne .GoV2Package "" }}V1{{ end }}(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService{{ if ne .GoV2Package "" }}V1{{ end }}(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.{{ .ProviderNameUpper }}Conn(ctx) @@ -619,9 +625,10 @@ func callService{{ if ne .GoV2Package "" }}V1{{ end }}(ctx context.Context, t *t req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } {{ end }} @@ -699,6 +706,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, } } @@ -711,13 +719,17 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, } } +{{ $region := .Region }} +{{ if .OverrideRegion }}{{ $region = .OverrideRegion }}{{ end }} {{ range $i, $alias := .Aliases }} func expectAliasName{{ $i }}ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName{{ $i }}ConfigEndpoint, + region: "{{ $region }}", } } {{ end }} @@ -725,12 +737,14 @@ func expectAliasName{{ $i }}ConfigEndpoint() caseExpectations { func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, } } @@ -741,6 +755,7 @@ func expectTfAwsEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(tfAwsEnvVar, awsEnvVar), }, + region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, } } {{ end }} @@ -752,6 +767,7 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(deprecatedEnvVar, awsEnvVar), }, + region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, } } {{ end }} @@ -759,12 +775,14 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, } } @@ -828,13 +846,18 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) + + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } +{{ if ne .GoV2Package "" }} func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { return func(stack *middleware.Stack) error { return stack.Finalize.Add( @@ -865,6 +888,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { @@ -897,6 +940,7 @@ func fullValueTypeName(v reflect.Value) string { requestType := v.Type() return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } +{{ end }} func generateSharedConfigFile(config configFile) string { var buf strings.Builder diff --git a/internal/generate/serviceendpointtests/main.go b/internal/generate/serviceendpointtests/main.go index a7b9f7e9204..ecd05ad05be 100644 --- a/internal/generate/serviceendpointtests/main.go +++ b/internal/generate/serviceendpointtests/main.go @@ -66,13 +66,11 @@ func main() { DeprecatedEnvVar: l.DeprecatedEnvVar(), TFAWSEnvVar: l.TFAWSEnvVar(), Aliases: l.Aliases(), + OverrideRegion: l.EndpointOverrideRegion(), } if l.ClientSDKV1() { td.GoV1Package = l.GoV1Package() - if strings.Contains(td.APICallParams, "aws_sdkv1") { - td.ImportAWS_V1 = true - } switch packageName { case "imagebuilder", "globalaccelerator", @@ -93,10 +91,10 @@ func main() { } } - switch packageName { - case "costoptimizationhub", "cur", "route53domains": - td.Region = "us-east-1" - } + // switch packageName { + // case "costoptimizationhub", "cur", "route53domains": + // td.Region = "us-east-1" + // } if td.APICall == "" { g.Fatalf("error generating service endpoint tests: package %q missing APICall", packageName) @@ -129,8 +127,8 @@ type TemplateData struct { V1NameResolverNeedsUnknownService bool V1AlternateInputPackage string Aliases []string - ImportAWS_V1 bool ImportAwsTypes bool + OverrideRegion string } //go:embed file.gtpl diff --git a/internal/service/accessanalyzer/service_endpoints_gen_test.go b/internal/service/accessanalyzer/service_endpoints_gen_test.go index 206d57b1cf0..8c8ec59494e 100644 --- a/internal/service/accessanalyzer/service_endpoints_gen_test.go +++ b/internal/service/accessanalyzer/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" accessanalyzer_sdkv2 "github.com/aws/aws-sdk-go-v2/service/accessanalyzer" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AccessAnalyzerClient(ctx) + var result apiCallParams + _, err := client.ListAnalyzers(ctx, &accessanalyzer_sdkv2.ListAnalyzersInput{}, func(opts *accessanalyzer_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/account/service_endpoints_gen_test.go b/internal/service/account/service_endpoints_gen_test.go index b062c01e715..4b58dc9af87 100644 --- a/internal/service/account/service_endpoints_gen_test.go +++ b/internal/service/account/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" account_sdkv2 "github.com/aws/aws-sdk-go-v2/service/account" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AccountClient(ctx) + var result apiCallParams + _, err := client.ListRegions(ctx, &account_sdkv2.ListRegionsInput{}, func(opts *account_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/acm/service_endpoints_gen_test.go b/internal/service/acm/service_endpoints_gen_test.go index 83860179664..3300b5e1f96 100644 --- a/internal/service/acm/service_endpoints_gen_test.go +++ b/internal/service/acm/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" acm_sdkv2 "github.com/aws/aws-sdk-go-v2/service/acm" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ACMClient(ctx) + var result apiCallParams + _, err := client.ListCertificates(ctx, &acm_sdkv2.ListCertificatesInput{}, func(opts *acm_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/acmpca/service_endpoints_gen_test.go b/internal/service/acmpca/service_endpoints_gen_test.go index 929c5560f0d..1508661beb4 100644 --- a/internal/service/acmpca/service_endpoints_gen_test.go +++ b/internal/service/acmpca/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" acmpca_sdkv2 "github.com/aws/aws-sdk-go-v2/service/acmpca" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ACMPCAClient(ctx) + var result apiCallParams + _, err := client.ListCertificateAuthorities(ctx, &acmpca_sdkv2.ListCertificateAuthoritiesInput{}, func(opts *acmpca_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/amp/service_endpoints_gen_test.go b/internal/service/amp/service_endpoints_gen_test.go index ea16b351b9d..01247411638 100644 --- a/internal/service/amp/service_endpoints_gen_test.go +++ b/internal/service/amp/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" amp_sdkv2 "github.com/aws/aws-sdk-go-v2/service/amp" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -377,17 +384,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AMPClient(ctx) + var result apiCallParams + _, err := client.ListScrapers(ctx, &_sdkv2.ListScrapersInput{}, func(opts *amp_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -398,7 +406,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -468,6 +476,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -480,42 +489,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -579,10 +595,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -616,6 +636,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/amplify/service_endpoints_gen_test.go b/internal/service/amplify/service_endpoints_gen_test.go index bddac409584..c6bf2586810 100644 --- a/internal/service/amplify/service_endpoints_gen_test.go +++ b/internal/service/amplify/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" amplify_sdkv2 "github.com/aws/aws-sdk-go-v2/service/amplify" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AmplifyClient(ctx) + var result apiCallParams + _, err := client.ListApps(ctx, &lify_sdkv2.ListAppsInput{}, func(opts *amplify_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/apigateway/service_endpoints_gen_test.go b/internal/service/apigateway/service_endpoints_gen_test.go index 30d2fa3653f..70bb3bd9795 100644 --- a/internal/service/apigateway/service_endpoints_gen_test.go +++ b/internal/service/apigateway/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" apigateway_sdkv2 "github.com/aws/aws-sdk-go-v2/service/apigateway" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.APIGatewayClient(ctx) + var result apiCallParams + _, err := client.GetAccount(ctx, &apigateway_sdkv2.GetAccountInput{}, func(opts *apigateway_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/apigatewayv2/service_endpoints_gen_test.go b/internal/service/apigatewayv2/service_endpoints_gen_test.go index 37ae7f2e7d1..38572114848 100644 --- a/internal/service/apigatewayv2/service_endpoints_gen_test.go +++ b/internal/service/apigatewayv2/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" apigatewayv2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/apigatewayv2" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.APIGatewayV2Client(ctx) + var result apiCallParams + _, err := client.GetApis(ctx, &apigatewayv2_sdkv2.GetApisInput{}, func(opts *apigatewayv2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/appautoscaling/service_endpoints_gen_test.go b/internal/service/appautoscaling/service_endpoints_gen_test.go index bc8db926c28..a4542247ebe 100644 --- a/internal/service/appautoscaling/service_endpoints_gen_test.go +++ b/internal/service/appautoscaling/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" applicationautoscaling_sdkv2 "github.com/aws/aws-sdk-go-v2/service/applicationautoscaling" awstypes "github.com/aws/aws-sdk-go-v2/service/applicationautoscaling/types" "github.com/aws/smithy-go/middleware" @@ -49,11 +50,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -319,19 +326,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AppAutoScalingClient(ctx) + var result apiCallParams + _, err := client.DescribeScalableTargets(ctx, &applicationautoscaling_sdkv2.DescribeScalableTargetsInput{ ServiceNamespace: awstypes.ServiceNamespaceEcs, }, func(opts *applicationautoscaling_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -342,7 +350,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -401,6 +409,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -413,36 +422,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -506,10 +521,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -543,6 +562,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/appconfig/service_endpoints_gen_test.go b/internal/service/appconfig/service_endpoints_gen_test.go index 0b592f09b14..9706e603a14 100644 --- a/internal/service/appconfig/service_endpoints_gen_test.go +++ b/internal/service/appconfig/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" appconfig_sdkv2 "github.com/aws/aws-sdk-go-v2/service/appconfig" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AppConfigClient(ctx) + var result apiCallParams + _, err := client.ListApplications(ctx, &appconfig_sdkv2.ListApplicationsInput{}, func(opts *appconfig_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/appfabric/service_endpoints_gen_test.go b/internal/service/appfabric/service_endpoints_gen_test.go index 3763c90e1a4..7c5a57b9719 100644 --- a/internal/service/appfabric/service_endpoints_gen_test.go +++ b/internal/service/appfabric/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" appfabric_sdkv2 "github.com/aws/aws-sdk-go-v2/service/appfabric" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AppFabricClient(ctx) + var result apiCallParams + _, err := client.ListAppBundles(ctx, &appfabric_sdkv2.ListAppBundlesInput{}, func(opts *appfabric_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/appflow/service_endpoints_gen_test.go b/internal/service/appflow/service_endpoints_gen_test.go index deca16754f4..d20ba352b9a 100644 --- a/internal/service/appflow/service_endpoints_gen_test.go +++ b/internal/service/appflow/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" appflow_sdkv2 "github.com/aws/aws-sdk-go-v2/service/appflow" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AppFlowClient(ctx) + var result apiCallParams + _, err := client.ListFlows(ctx, &appflow_sdkv2.ListFlowsInput{}, func(opts *appflow_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/appintegrations/service_endpoints_gen_test.go b/internal/service/appintegrations/service_endpoints_gen_test.go index 03816d5552e..785cd68b300 100644 --- a/internal/service/appintegrations/service_endpoints_gen_test.go +++ b/internal/service/appintegrations/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" appintegrations_sdkv2 "github.com/aws/aws-sdk-go-v2/service/appintegrations" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AppIntegrationsClient(ctx) + var result apiCallParams + _, err := client.ListApplications(ctx, &appintegrations_sdkv2.ListApplicationsInput{}, func(opts *appintegrations_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/applicationinsights/service_endpoints_gen_test.go b/internal/service/applicationinsights/service_endpoints_gen_test.go index f4bfe68850a..6c228f1aec6 100644 --- a/internal/service/applicationinsights/service_endpoints_gen_test.go +++ b/internal/service/applicationinsights/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" applicationinsights_sdkv1 "github.com/aws/aws-sdk-go/service/applicationinsights" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ApplicationInsightsConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/appmesh/service_endpoints_gen_test.go b/internal/service/appmesh/service_endpoints_gen_test.go index 08cca442193..078bf7ffdfa 100644 --- a/internal/service/appmesh/service_endpoints_gen_test.go +++ b/internal/service/appmesh/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" appmesh_sdkv1 "github.com/aws/aws-sdk-go/service/appmesh" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.AppMeshConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/apprunner/service_endpoints_gen_test.go b/internal/service/apprunner/service_endpoints_gen_test.go index 167c254c6c0..e79c046d92e 100644 --- a/internal/service/apprunner/service_endpoints_gen_test.go +++ b/internal/service/apprunner/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" apprunner_sdkv2 "github.com/aws/aws-sdk-go-v2/service/apprunner" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AppRunnerClient(ctx) + var result apiCallParams + _, err := client.ListConnections(ctx, &apprunner_sdkv2.ListConnectionsInput{}, func(opts *apprunner_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/appstream/service_endpoints_gen_test.go b/internal/service/appstream/service_endpoints_gen_test.go index 50279107418..4e2a9ee571b 100644 --- a/internal/service/appstream/service_endpoints_gen_test.go +++ b/internal/service/appstream/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" appstream_sdkv2 "github.com/aws/aws-sdk-go-v2/service/appstream" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,19 +271,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AppStreamClient(ctx) + var result apiCallParams + _, err := client.ListAssociatedFleets(ctx, &appstream_sdkv2.ListAssociatedFleetsInput{ StackName: aws_sdkv2.String("test"), }, func(opts *appstream_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -287,7 +295,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -327,6 +335,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -339,30 +348,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -426,10 +440,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -463,6 +481,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/appsync/service_endpoints_gen_test.go b/internal/service/appsync/service_endpoints_gen_test.go index d510dc4dcbf..1bd556b0708 100644 --- a/internal/service/appsync/service_endpoints_gen_test.go +++ b/internal/service/appsync/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" appsync_sdkv1 "github.com/aws/aws-sdk-go/service/appsync" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.AppSyncConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/athena/service_endpoints_gen_test.go b/internal/service/athena/service_endpoints_gen_test.go index 8db431bc341..ddbf0f4da18 100644 --- a/internal/service/athena/service_endpoints_gen_test.go +++ b/internal/service/athena/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" athena_sdkv2 "github.com/aws/aws-sdk-go-v2/service/athena" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AthenaClient(ctx) + var result apiCallParams + _, err := client.ListDataCatalogs(ctx, &athena_sdkv2.ListDataCatalogsInput{}, func(opts *athena_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/auditmanager/service_endpoints_gen_test.go b/internal/service/auditmanager/service_endpoints_gen_test.go index 71e62ff4913..1ceaf5875d9 100644 --- a/internal/service/auditmanager/service_endpoints_gen_test.go +++ b/internal/service/auditmanager/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" auditmanager_sdkv2 "github.com/aws/aws-sdk-go-v2/service/auditmanager" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AuditManagerClient(ctx) + var result apiCallParams + _, err := client.GetAccountStatus(ctx, &auditmanager_sdkv2.GetAccountStatusInput{}, func(opts *auditmanager_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/autoscaling/service_endpoints_gen_test.go b/internal/service/autoscaling/service_endpoints_gen_test.go index 1240912b94c..631a08cfd15 100644 --- a/internal/service/autoscaling/service_endpoints_gen_test.go +++ b/internal/service/autoscaling/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" autoscaling_sdkv2 "github.com/aws/aws-sdk-go-v2/service/autoscaling" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AutoScalingClient(ctx) + var result apiCallParams + _, err := client.DescribeAutoScalingGroups(ctx, &autoscaling_sdkv2.DescribeAutoScalingGroupsInput{}, func(opts *autoscaling_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/autoscalingplans/service_endpoints_gen_test.go b/internal/service/autoscalingplans/service_endpoints_gen_test.go index 058e76eec49..c03a6ecba7b 100644 --- a/internal/service/autoscalingplans/service_endpoints_gen_test.go +++ b/internal/service/autoscalingplans/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" autoscalingplans_sdkv2 "github.com/aws/aws-sdk-go-v2/service/autoscalingplans" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.AutoScalingPlansClient(ctx) + var result apiCallParams + _, err := client.DescribeScalingPlans(ctx, &autoscalingplans_sdkv2.DescribeScalingPlansInput{}, func(opts *autoscalingplans_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/backup/service_endpoints_gen_test.go b/internal/service/backup/service_endpoints_gen_test.go index 81cddcfec48..974182b7a5a 100644 --- a/internal/service/backup/service_endpoints_gen_test.go +++ b/internal/service/backup/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" backup_sdkv1 "github.com/aws/aws-sdk-go/service/backup" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.BackupConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/batch/service_endpoints_gen_test.go b/internal/service/batch/service_endpoints_gen_test.go index d32001afb2b..8f1c622d84c 100644 --- a/internal/service/batch/service_endpoints_gen_test.go +++ b/internal/service/batch/service_endpoints_gen_test.go @@ -13,7 +13,10 @@ import ( "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" batch_sdkv2 "github.com/aws/aws-sdk-go-v2/service/batch" batch_sdkv1 "github.com/aws/aws-sdk-go/service/batch" "github.com/aws/smithy-go/middleware" @@ -48,11 +51,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -277,17 +286,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.BatchClient(ctx) + var result apiCallParams + _, err := client.ListJobs(ctx, &batch_sdkv2.ListJobsInput{}, func(opts *batch_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -298,10 +308,10 @@ func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) str t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } -func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.BatchConn(ctx) @@ -310,9 +320,10 @@ func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) str req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -352,6 +363,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -364,30 +376,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -451,10 +468,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -488,6 +509,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/bcmdataexports/service_endpoints_gen_test.go b/internal/service/bcmdataexports/service_endpoints_gen_test.go index a8e2834ad93..82830d3586e 100644 --- a/internal/service/bcmdataexports/service_endpoints_gen_test.go +++ b/internal/service/bcmdataexports/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" bcmdataexports_sdkv2 "github.com/aws/aws-sdk-go-v2/service/bcmdataexports" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.BCMDataExportsClient(ctx) + var result apiCallParams + _, err := client.ListExports(ctx, &bcmdataexports_sdkv2.ListExportsInput{}, func(opts *bcmdataexports_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/bedrock/service_endpoints_gen_test.go b/internal/service/bedrock/service_endpoints_gen_test.go index 1e4f802ec39..1f0eef21aec 100644 --- a/internal/service/bedrock/service_endpoints_gen_test.go +++ b/internal/service/bedrock/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" bedrock_sdkv2 "github.com/aws/aws-sdk-go-v2/service/bedrock" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.BedrockClient(ctx) + var result apiCallParams + _, err := client.ListFoundationModels(ctx, &bedrock_sdkv2.ListFoundationModelsInput{}, func(opts *bedrock_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/bedrockagent/service_endpoints_gen_test.go b/internal/service/bedrockagent/service_endpoints_gen_test.go index e166bb6a7b3..2f9fd0c7818 100644 --- a/internal/service/bedrockagent/service_endpoints_gen_test.go +++ b/internal/service/bedrockagent/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" bedrockagent_sdkv2 "github.com/aws/aws-sdk-go-v2/service/bedrockagent" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.BedrockAgentClient(ctx) + var result apiCallParams + _, err := client.ListAgents(ctx, &bedrockagent_sdkv2.ListAgentsInput{}, func(opts *bedrockagent_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/budgets/service_endpoints_gen_test.go b/internal/service/budgets/service_endpoints_gen_test.go index d8eb77b0eb9..f4c59600b30 100644 --- a/internal/service/budgets/service_endpoints_gen_test.go +++ b/internal/service/budgets/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" budgets_sdkv2 "github.com/aws/aws-sdk-go-v2/service/budgets" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,19 +271,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.BudgetsClient(ctx) + var result apiCallParams + _, err := client.DescribeBudgets(ctx, &budgets_sdkv2.DescribeBudgetsInput{ AccountId: aws_sdkv2.String("012345678901"), }, func(opts *budgets_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -287,7 +295,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -327,6 +335,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -339,30 +348,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -426,10 +440,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -463,6 +481,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ce/service_endpoints_gen_test.go b/internal/service/ce/service_endpoints_gen_test.go index e8b0bbf2bc1..7b6a828e079 100644 --- a/internal/service/ce/service_endpoints_gen_test.go +++ b/internal/service/ce/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" costexplorer_sdkv2 "github.com/aws/aws-sdk-go-v2/service/costexplorer" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CEClient(ctx) + var result apiCallParams + _, err := client.ListCostCategoryDefinitions(ctx, &costexplorer_sdkv2.ListCostCategoryDefinitionsInput{}, func(opts *costexplorer_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/chatbot/service_endpoints_gen_test.go b/internal/service/chatbot/service_endpoints_gen_test.go index 99b12b0fd2b..2b040cd1b01 100644 --- a/internal/service/chatbot/service_endpoints_gen_test.go +++ b/internal/service/chatbot/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" chatbot_sdkv2 "github.com/aws/aws-sdk-go-v2/service/chatbot" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ChatbotClient(ctx) + var result apiCallParams + _, err := client.GetAccountPreferences(ctx, &chatbot_sdkv2.GetAccountPreferencesInput{}, func(opts *chatbot_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/chime/service_endpoints_gen_test.go b/internal/service/chime/service_endpoints_gen_test.go index 93c205bb9b7..5270248fee4 100644 --- a/internal/service/chime/service_endpoints_gen_test.go +++ b/internal/service/chime/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" chime_sdkv1 "github.com/aws/aws-sdk-go/service/chime" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ChimeConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go index 44fab956f3c..0e5fde79ac2 100644 --- a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go +++ b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" chimesdkmediapipelines_sdkv2 "github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ChimeSDKMediaPipelinesClient(ctx) + var result apiCallParams + _, err := client.ListMediaPipelines(ctx, &chimesdkmediapipelines_sdkv2.ListMediaPipelinesInput{}, func(opts *chimesdkmediapipelines_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/chimesdkvoice/service_endpoints_gen_test.go b/internal/service/chimesdkvoice/service_endpoints_gen_test.go index e93eca88405..f4a8c9ea85e 100644 --- a/internal/service/chimesdkvoice/service_endpoints_gen_test.go +++ b/internal/service/chimesdkvoice/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" chimesdkvoice_sdkv2 "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ChimeSDKVoiceClient(ctx) + var result apiCallParams + _, err := client.ListPhoneNumbers(ctx, &chimesdkvoice_sdkv2.ListPhoneNumbersInput{}, func(opts *chimesdkvoice_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cleanrooms/service_endpoints_gen_test.go b/internal/service/cleanrooms/service_endpoints_gen_test.go index 44f38fb2443..e46e28e1de1 100644 --- a/internal/service/cleanrooms/service_endpoints_gen_test.go +++ b/internal/service/cleanrooms/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cleanrooms_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cleanrooms" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CleanRoomsClient(ctx) + var result apiCallParams + _, err := client.ListCollaborations(ctx, &cleanrooms_sdkv2.ListCollaborationsInput{}, func(opts *cleanrooms_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cloud9/service_endpoints_gen_test.go b/internal/service/cloud9/service_endpoints_gen_test.go index 2c572b5b66b..61eafc8591e 100644 --- a/internal/service/cloud9/service_endpoints_gen_test.go +++ b/internal/service/cloud9/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cloud9_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cloud9" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.Cloud9Client(ctx) + var result apiCallParams + _, err := client.ListEnvironments(ctx, &cloud9_sdkv2.ListEnvironmentsInput{}, func(opts *cloud9_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cloudcontrol/service_endpoints_gen_test.go b/internal/service/cloudcontrol/service_endpoints_gen_test.go index e22ef78e971..55342dbfa6a 100644 --- a/internal/service/cloudcontrol/service_endpoints_gen_test.go +++ b/internal/service/cloudcontrol/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cloudcontrol_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cloudcontrol" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CloudControlClient(ctx) + var result apiCallParams + _, err := client.ListResourceRequests(ctx, &cloudcontrol_sdkv2.ListResourceRequestsInput{}, func(opts *cloudcontrol_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cloudformation/service_endpoints_gen_test.go b/internal/service/cloudformation/service_endpoints_gen_test.go index d6f6c827435..3ff29ed9a61 100644 --- a/internal/service/cloudformation/service_endpoints_gen_test.go +++ b/internal/service/cloudformation/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cloudformation_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cloudformation" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,19 +271,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CloudFormationClient(ctx) + var result apiCallParams + _, err := client.ListStackInstances(ctx, &cloudformation_sdkv2.ListStackInstancesInput{ StackSetName: aws_sdkv2.String("test"), }, func(opts *cloudformation_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -287,7 +295,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -327,6 +335,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -339,30 +348,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -426,10 +440,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -463,6 +481,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cloudfront/service_endpoints_gen_test.go b/internal/service/cloudfront/service_endpoints_gen_test.go index c5cbcf0a356..666d510ca53 100644 --- a/internal/service/cloudfront/service_endpoints_gen_test.go +++ b/internal/service/cloudfront/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cloudfront_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cloudfront" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CloudFrontClient(ctx) + var result apiCallParams + _, err := client.ListDistributions(ctx, &cloudfront_sdkv2.ListDistributionsInput{}, func(opts *cloudfront_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cloudhsmv2/service_endpoints_gen_test.go b/internal/service/cloudhsmv2/service_endpoints_gen_test.go index 39225c2ddc5..4e30e1aeb39 100644 --- a/internal/service/cloudhsmv2/service_endpoints_gen_test.go +++ b/internal/service/cloudhsmv2/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cloudhsmv2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cloudhsmv2" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CloudHSMV2Client(ctx) + var result apiCallParams + _, err := client.DescribeClusters(ctx, &cloudhsmv2_sdkv2.DescribeClustersInput{}, func(opts *cloudhsmv2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cloudsearch/service_endpoints_gen_test.go b/internal/service/cloudsearch/service_endpoints_gen_test.go index e68b99b7251..4d365c3fcb8 100644 --- a/internal/service/cloudsearch/service_endpoints_gen_test.go +++ b/internal/service/cloudsearch/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cloudsearch_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cloudsearch" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CloudSearchClient(ctx) + var result apiCallParams + _, err := client.ListDomainNames(ctx, &cloudsearch_sdkv2.ListDomainNamesInput{}, func(opts *cloudsearch_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cloudtrail/service_endpoints_gen_test.go b/internal/service/cloudtrail/service_endpoints_gen_test.go index 5158ba0fb5d..5ca967a3ddf 100644 --- a/internal/service/cloudtrail/service_endpoints_gen_test.go +++ b/internal/service/cloudtrail/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cloudtrail_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cloudtrail" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CloudTrailClient(ctx) + var result apiCallParams + _, err := client.ListChannels(ctx, &cloudtrail_sdkv2.ListChannelsInput{}, func(opts *cloudtrail_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cloudwatch/service_endpoints_gen_test.go b/internal/service/cloudwatch/service_endpoints_gen_test.go index 53158f37da2..7779a37138d 100644 --- a/internal/service/cloudwatch/service_endpoints_gen_test.go +++ b/internal/service/cloudwatch/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cloudwatch_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cloudwatch" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CloudWatchClient(ctx) + var result apiCallParams + _, err := client.ListDashboards(ctx, &cloudwatch_sdkv2.ListDashboardsInput{}, func(opts *cloudwatch_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/codeartifact/service_endpoints_gen_test.go b/internal/service/codeartifact/service_endpoints_gen_test.go index ceadd3fbb68..030ad35b04a 100644 --- a/internal/service/codeartifact/service_endpoints_gen_test.go +++ b/internal/service/codeartifact/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" codeartifact_sdkv2 "github.com/aws/aws-sdk-go-v2/service/codeartifact" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CodeArtifactClient(ctx) + var result apiCallParams + _, err := client.ListDomains(ctx, &codeartifact_sdkv2.ListDomainsInput{}, func(opts *codeartifact_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/codebuild/service_endpoints_gen_test.go b/internal/service/codebuild/service_endpoints_gen_test.go index 3da614caf20..1ff044a50d2 100644 --- a/internal/service/codebuild/service_endpoints_gen_test.go +++ b/internal/service/codebuild/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" codebuild_sdkv2 "github.com/aws/aws-sdk-go-v2/service/codebuild" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CodeBuildClient(ctx) + var result apiCallParams + _, err := client.ListBuildBatches(ctx, &codebuild_sdkv2.ListBuildBatchesInput{}, func(opts *codebuild_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/codecommit/service_endpoints_gen_test.go b/internal/service/codecommit/service_endpoints_gen_test.go index 037761cd544..746d773661f 100644 --- a/internal/service/codecommit/service_endpoints_gen_test.go +++ b/internal/service/codecommit/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" codecommit_sdkv2 "github.com/aws/aws-sdk-go-v2/service/codecommit" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CodeCommitClient(ctx) + var result apiCallParams + _, err := client.ListRepositories(ctx, &codecommit_sdkv2.ListRepositoriesInput{}, func(opts *codecommit_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/codeguruprofiler/service_endpoints_gen_test.go b/internal/service/codeguruprofiler/service_endpoints_gen_test.go index e4192e30128..66e1743b6a7 100644 --- a/internal/service/codeguruprofiler/service_endpoints_gen_test.go +++ b/internal/service/codeguruprofiler/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" codeguruprofiler_sdkv2 "github.com/aws/aws-sdk-go-v2/service/codeguruprofiler" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CodeGuruProfilerClient(ctx) + var result apiCallParams + _, err := client.ListProfilingGroups(ctx, &codeguruprofiler_sdkv2.ListProfilingGroupsInput{}, func(opts *codeguruprofiler_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/codegurureviewer/service_endpoints_gen_test.go b/internal/service/codegurureviewer/service_endpoints_gen_test.go index da353bc1d85..7462cac8a9b 100644 --- a/internal/service/codegurureviewer/service_endpoints_gen_test.go +++ b/internal/service/codegurureviewer/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" codegurureviewer_sdkv2 "github.com/aws/aws-sdk-go-v2/service/codegurureviewer" awstypes "github.com/aws/aws-sdk-go-v2/service/codegurureviewer/types" "github.com/aws/smithy-go/middleware" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,19 +272,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CodeGuruReviewerClient(ctx) + var result apiCallParams + _, err := client.ListCodeReviews(ctx, &codegurureviewer_sdkv2.ListCodeReviewsInput{ Type: awstypes.TypePullRequest, }, func(opts *codegurureviewer_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -288,7 +296,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -328,6 +336,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -340,30 +349,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -427,10 +441,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -464,6 +482,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/codepipeline/service_endpoints_gen_test.go b/internal/service/codepipeline/service_endpoints_gen_test.go index 4877c8ca841..931b203939b 100644 --- a/internal/service/codepipeline/service_endpoints_gen_test.go +++ b/internal/service/codepipeline/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" codepipeline_sdkv2 "github.com/aws/aws-sdk-go-v2/service/codepipeline" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CodePipelineClient(ctx) + var result apiCallParams + _, err := client.ListPipelines(ctx, &codepipeline_sdkv2.ListPipelinesInput{}, func(opts *codepipeline_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/codestarconnections/service_endpoints_gen_test.go b/internal/service/codestarconnections/service_endpoints_gen_test.go index 5402b339abb..2a502bad65a 100644 --- a/internal/service/codestarconnections/service_endpoints_gen_test.go +++ b/internal/service/codestarconnections/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" codestarconnections_sdkv2 "github.com/aws/aws-sdk-go-v2/service/codestarconnections" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CodeStarConnectionsClient(ctx) + var result apiCallParams + _, err := client.ListConnections(ctx, &codestarconnections_sdkv2.ListConnectionsInput{}, func(opts *codestarconnections_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/codestarnotifications/service_endpoints_gen_test.go b/internal/service/codestarnotifications/service_endpoints_gen_test.go index a207a8f2080..d5f24eff6ce 100644 --- a/internal/service/codestarnotifications/service_endpoints_gen_test.go +++ b/internal/service/codestarnotifications/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" codestarnotifications_sdkv2 "github.com/aws/aws-sdk-go-v2/service/codestarnotifications" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CodeStarNotificationsClient(ctx) + var result apiCallParams + _, err := client.ListTargets(ctx, &codestarnotifications_sdkv2.ListTargetsInput{}, func(opts *codestarnotifications_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cognitoidentity/service_endpoints_gen_test.go b/internal/service/cognitoidentity/service_endpoints_gen_test.go index 43e730d4e44..36916b5f4fb 100644 --- a/internal/service/cognitoidentity/service_endpoints_gen_test.go +++ b/internal/service/cognitoidentity/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cognitoidentity_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cognitoidentity" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,19 +271,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CognitoIdentityClient(ctx) + var result apiCallParams + _, err := client.ListIdentityPools(ctx, &cognitoidentity_sdkv2.ListIdentityPoolsInput{ MaxResults: aws_sdkv2.Int32(1), }, func(opts *cognitoidentity_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -287,7 +295,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -327,6 +335,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -339,30 +348,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -426,10 +440,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -463,6 +481,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cognitoidp/service_endpoints_gen_test.go b/internal/service/cognitoidp/service_endpoints_gen_test.go index b160380f503..7d05e2a1379 100644 --- a/internal/service/cognitoidp/service_endpoints_gen_test.go +++ b/internal/service/cognitoidp/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" cognitoidentityprovider_sdkv1 "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -319,7 +323,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.CognitoIDPConn(ctx) @@ -328,9 +332,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -389,6 +394,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -401,36 +407,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -494,74 +506,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/comprehend/service_endpoints_gen_test.go b/internal/service/comprehend/service_endpoints_gen_test.go index 97610240b28..74cc3e4b142 100644 --- a/internal/service/comprehend/service_endpoints_gen_test.go +++ b/internal/service/comprehend/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" comprehend_sdkv2 "github.com/aws/aws-sdk-go-v2/service/comprehend" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ComprehendClient(ctx) + var result apiCallParams + _, err := client.ListDocumentClassifiers(ctx, &comprehend_sdkv2.ListDocumentClassifiersInput{}, func(opts *comprehend_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/computeoptimizer/service_endpoints_gen_test.go b/internal/service/computeoptimizer/service_endpoints_gen_test.go index c8baaddca66..2d2dfecdde5 100644 --- a/internal/service/computeoptimizer/service_endpoints_gen_test.go +++ b/internal/service/computeoptimizer/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" computeoptimizer_sdkv2 "github.com/aws/aws-sdk-go-v2/service/computeoptimizer" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ComputeOptimizerClient(ctx) + var result apiCallParams + _, err := client.GetEnrollmentStatus(ctx, &computeoptimizer_sdkv2.GetEnrollmentStatusInput{}, func(opts *computeoptimizer_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/configservice/service_endpoints_gen_test.go b/internal/service/configservice/service_endpoints_gen_test.go index 5f6c73b7942..acbf517861c 100644 --- a/internal/service/configservice/service_endpoints_gen_test.go +++ b/internal/service/configservice/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" configservice_sdkv2 "github.com/aws/aws-sdk-go-v2/service/configservice" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ConfigServiceClient(ctx) + var result apiCallParams + _, err := client.ListStoredQueries(ctx, &configservice_sdkv2.ListStoredQueriesInput{}, func(opts *configservice_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/connect/service_endpoints_gen_test.go b/internal/service/connect/service_endpoints_gen_test.go index 435d38f428d..319dbe0b0a5 100644 --- a/internal/service/connect/service_endpoints_gen_test.go +++ b/internal/service/connect/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" connect_sdkv1 "github.com/aws/aws-sdk-go/service/connect" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ConnectConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/connectcases/service_endpoints_gen_test.go b/internal/service/connectcases/service_endpoints_gen_test.go index bebc2257dd7..20ac881de8f 100644 --- a/internal/service/connectcases/service_endpoints_gen_test.go +++ b/internal/service/connectcases/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" connectcases_sdkv2 "github.com/aws/aws-sdk-go-v2/service/connectcases" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ConnectCasesClient(ctx) + var result apiCallParams + _, err := client.ListDomains(ctx, &connectcases_sdkv2.ListDomainsInput{}, func(opts *connectcases_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/controltower/service_endpoints_gen_test.go b/internal/service/controltower/service_endpoints_gen_test.go index c8960adaa15..887db59d21b 100644 --- a/internal/service/controltower/service_endpoints_gen_test.go +++ b/internal/service/controltower/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" controltower_sdkv2 "github.com/aws/aws-sdk-go-v2/service/controltower" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ControlTowerClient(ctx) + var result apiCallParams + _, err := client.ListLandingZones(ctx, &controltower_sdkv2.ListLandingZonesInput{}, func(opts *controltower_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/costoptimizationhub/service_endpoints_gen_test.go b/internal/service/costoptimizationhub/service_endpoints_gen_test.go index 5b0d8187957..58f77598e63 100644 --- a/internal/service/costoptimizationhub/service_endpoints_gen_test.go +++ b/internal/service/costoptimizationhub/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" costoptimizationhub_sdkv2 "github.com/aws/aws-sdk-go-v2/service/costoptimizationhub" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -69,7 +76,7 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-east-1" //lintignore:AWSAT003 + const region = "us-west-2" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ "no config": { @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CostOptimizationHubClient(ctx) + var result apiCallParams + _, err := client.GetPreferences(ctx, &costoptimizationhub_sdkv2.GetPreferencesInput{}, func(opts *costoptimizationhub_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/cur/service_endpoints_gen_test.go b/internal/service/cur/service_endpoints_gen_test.go index 7462f70ddef..42794f22fb5 100644 --- a/internal/service/cur/service_endpoints_gen_test.go +++ b/internal/service/cur/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" costandusagereportservice_sdkv2 "github.com/aws/aws-sdk-go-v2/service/costandusagereportservice" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -74,7 +81,7 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-east-1" //lintignore:AWSAT003 + const region = "us-west-2" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ "no config": { @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CURClient(ctx) + var result apiCallParams + _, err := client.DescribeReportDefinitions(ctx, &costandusagereportservice_sdkv2.DescribeReportDefinitionsInput{}, func(opts *costandusagereportservice_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/customerprofiles/service_endpoints_gen_test.go b/internal/service/customerprofiles/service_endpoints_gen_test.go index c032b1ccd3a..00cf76f4fbb 100644 --- a/internal/service/customerprofiles/service_endpoints_gen_test.go +++ b/internal/service/customerprofiles/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" customerprofiles_sdkv2 "github.com/aws/aws-sdk-go-v2/service/customerprofiles" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.CustomerProfilesClient(ctx) + var result apiCallParams + _, err := client.ListDomains(ctx, &customerprofiles_sdkv2.ListDomainsInput{}, func(opts *customerprofiles_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/dataexchange/service_endpoints_gen_test.go b/internal/service/dataexchange/service_endpoints_gen_test.go index a9ec185c129..5fbf574df28 100644 --- a/internal/service/dataexchange/service_endpoints_gen_test.go +++ b/internal/service/dataexchange/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" dataexchange_sdkv1 "github.com/aws/aws-sdk-go/service/dataexchange" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.DataExchangeConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/datapipeline/service_endpoints_gen_test.go b/internal/service/datapipeline/service_endpoints_gen_test.go index 9cb54a7ba0a..99360e65610 100644 --- a/internal/service/datapipeline/service_endpoints_gen_test.go +++ b/internal/service/datapipeline/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" datapipeline_sdkv1 "github.com/aws/aws-sdk-go/service/datapipeline" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.DataPipelineConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/datasync/service_endpoints_gen_test.go b/internal/service/datasync/service_endpoints_gen_test.go index 75be485828c..5a0d1be8a69 100644 --- a/internal/service/datasync/service_endpoints_gen_test.go +++ b/internal/service/datasync/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" datasync_sdkv2 "github.com/aws/aws-sdk-go-v2/service/datasync" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DataSyncClient(ctx) + var result apiCallParams + _, err := client.ListAgents(ctx, &datasync_sdkv2.ListAgentsInput{}, func(opts *datasync_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/datazone/service_endpoints_gen_test.go b/internal/service/datazone/service_endpoints_gen_test.go index 2d40462da41..0c27fa60bfb 100644 --- a/internal/service/datazone/service_endpoints_gen_test.go +++ b/internal/service/datazone/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" datazone_sdkv2 "github.com/aws/aws-sdk-go-v2/service/datazone" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DataZoneClient(ctx) + var result apiCallParams + _, err := client.ListDomains(ctx, &datazone_sdkv2.ListDomainsInput{}, func(opts *datazone_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/dax/service_endpoints_gen_test.go b/internal/service/dax/service_endpoints_gen_test.go index cafc0a5b809..4ebf81ec360 100644 --- a/internal/service/dax/service_endpoints_gen_test.go +++ b/internal/service/dax/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" dax_sdkv2 "github.com/aws/aws-sdk-go-v2/service/dax" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DAXClient(ctx) + var result apiCallParams + _, err := client.DescribeClusters(ctx, &dax_sdkv2.DescribeClustersInput{}, func(opts *dax_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/deploy/service_endpoints_gen_test.go b/internal/service/deploy/service_endpoints_gen_test.go index 75b2c48d2c8..ffde79175a9 100644 --- a/internal/service/deploy/service_endpoints_gen_test.go +++ b/internal/service/deploy/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" codedeploy_sdkv2 "github.com/aws/aws-sdk-go-v2/service/codedeploy" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DeployClient(ctx) + var result apiCallParams + _, err := client.ListApplications(ctx, &codedeploy_sdkv2.ListApplicationsInput{}, func(opts *codedeploy_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/detective/service_endpoints_gen_test.go b/internal/service/detective/service_endpoints_gen_test.go index 9e4f6143e10..d3fab2a1970 100644 --- a/internal/service/detective/service_endpoints_gen_test.go +++ b/internal/service/detective/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" detective_sdkv1 "github.com/aws/aws-sdk-go/service/detective" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.DetectiveConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/devicefarm/service_endpoints_gen_test.go b/internal/service/devicefarm/service_endpoints_gen_test.go index 4a71d18114e..4ca9a542a21 100644 --- a/internal/service/devicefarm/service_endpoints_gen_test.go +++ b/internal/service/devicefarm/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" devicefarm_sdkv2 "github.com/aws/aws-sdk-go-v2/service/devicefarm" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DeviceFarmClient(ctx) + var result apiCallParams + _, err := client.ListDeviceInstances(ctx, &devicefarm_sdkv2.ListDeviceInstancesInput{}, func(opts *devicefarm_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/devopsguru/service_endpoints_gen_test.go b/internal/service/devopsguru/service_endpoints_gen_test.go index 4d774f9e78d..75a5386525b 100644 --- a/internal/service/devopsguru/service_endpoints_gen_test.go +++ b/internal/service/devopsguru/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" devopsguru_sdkv2 "github.com/aws/aws-sdk-go-v2/service/devopsguru" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DevOpsGuruClient(ctx) + var result apiCallParams + _, err := client.DescribeAccountHealth(ctx, &devopsguru_sdkv2.DescribeAccountHealthInput{}, func(opts *devopsguru_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/directconnect/service_endpoints_gen_test.go b/internal/service/directconnect/service_endpoints_gen_test.go index a9a4de7ef75..02d030df858 100644 --- a/internal/service/directconnect/service_endpoints_gen_test.go +++ b/internal/service/directconnect/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" directconnect_sdkv1 "github.com/aws/aws-sdk-go/service/directconnect" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.DirectConnectConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/dlm/service_endpoints_gen_test.go b/internal/service/dlm/service_endpoints_gen_test.go index c4ff7e21584..9c4a67dc1a8 100644 --- a/internal/service/dlm/service_endpoints_gen_test.go +++ b/internal/service/dlm/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" dlm_sdkv2 "github.com/aws/aws-sdk-go-v2/service/dlm" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DLMClient(ctx) + var result apiCallParams + _, err := client.GetLifecyclePolicies(ctx, &dlm_sdkv2.GetLifecyclePoliciesInput{}, func(opts *dlm_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/dms/service_endpoints_gen_test.go b/internal/service/dms/service_endpoints_gen_test.go index 066307858f1..48378eea354 100644 --- a/internal/service/dms/service_endpoints_gen_test.go +++ b/internal/service/dms/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" databasemigrationservice_sdkv1 "github.com/aws/aws-sdk-go/service/databasemigrationservice" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -378,7 +382,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.DMSConn(ctx) @@ -387,9 +391,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -459,6 +464,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -471,42 +477,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -570,74 +583,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/docdb/service_endpoints_gen_test.go b/internal/service/docdb/service_endpoints_gen_test.go index af8e1887279..fe4d13e6ce0 100644 --- a/internal/service/docdb/service_endpoints_gen_test.go +++ b/internal/service/docdb/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" docdb_sdkv1 "github.com/aws/aws-sdk-go/service/docdb" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.DocDBConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/docdbelastic/service_endpoints_gen_test.go b/internal/service/docdbelastic/service_endpoints_gen_test.go index 7462374a37b..1ba28141d85 100644 --- a/internal/service/docdbelastic/service_endpoints_gen_test.go +++ b/internal/service/docdbelastic/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" docdbelastic_sdkv2 "github.com/aws/aws-sdk-go-v2/service/docdbelastic" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DocDBElasticClient(ctx) + var result apiCallParams + _, err := client.ListClusters(ctx, &docdbelastic_sdkv2.ListClustersInput{}, func(opts *docdbelastic_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/drs/service_endpoints_gen_test.go b/internal/service/drs/service_endpoints_gen_test.go index 859e740c342..df6fb584e22 100644 --- a/internal/service/drs/service_endpoints_gen_test.go +++ b/internal/service/drs/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" drs_sdkv2 "github.com/aws/aws-sdk-go-v2/service/drs" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DRSClient(ctx) + var result apiCallParams + _, err := client.DescribeJobs(ctx, &drs_sdkv2.DescribeJobsInput{}, func(opts *drs_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ds/service_endpoints_gen_test.go b/internal/service/ds/service_endpoints_gen_test.go index 578832d30b7..415c15977ea 100644 --- a/internal/service/ds/service_endpoints_gen_test.go +++ b/internal/service/ds/service_endpoints_gen_test.go @@ -13,7 +13,10 @@ import ( "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" directoryservice_sdkv2 "github.com/aws/aws-sdk-go-v2/service/directoryservice" directoryservice_sdkv1 "github.com/aws/aws-sdk-go/service/directoryservice" "github.com/aws/smithy-go/middleware" @@ -49,11 +52,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -331,17 +340,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DSClient(ctx) + var result apiCallParams + _, err := client.DescribeDirectories(ctx, &directoryservice_sdkv2.DescribeDirectoriesInput{}, func(opts *directoryservice_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -352,10 +362,10 @@ func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) str t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } -func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.DSConn(ctx) @@ -364,9 +374,10 @@ func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) str req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -425,6 +436,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -437,36 +449,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -530,10 +548,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -567,6 +589,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/dynamodb/service_endpoints_gen_test.go b/internal/service/dynamodb/service_endpoints_gen_test.go index 3e074bab958..ccafdd4aabe 100644 --- a/internal/service/dynamodb/service_endpoints_gen_test.go +++ b/internal/service/dynamodb/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" dynamodb_sdkv2 "github.com/aws/aws-sdk-go-v2/service/dynamodb" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -374,17 +381,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.DynamoDBClient(ctx) + var result apiCallParams + _, err := client.ListTables(ctx, &dynamodb_sdkv2.ListTablesInput{}, func(opts *dynamodb_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -395,7 +403,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -443,6 +451,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -455,18 +464,21 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } @@ -476,6 +488,7 @@ func expectTfAwsEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(tfAwsEnvVar, awsEnvVar), }, + region: "us-west-2", } } @@ -485,18 +498,21 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(deprecatedEnvVar, awsEnvVar), }, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -560,10 +576,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -597,6 +617,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ec2/service_endpoints_gen_test.go b/internal/service/ec2/service_endpoints_gen_test.go index cb794cbed93..1464a94d5e9 100644 --- a/internal/service/ec2/service_endpoints_gen_test.go +++ b/internal/service/ec2/service_endpoints_gen_test.go @@ -13,7 +13,10 @@ import ( "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ec2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ec2" ec2_sdkv1 "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/smithy-go/middleware" @@ -48,11 +51,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -277,17 +286,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.EC2Client(ctx) + var result apiCallParams + _, err := client.DescribeVpcs(ctx, &ec2_sdkv2.DescribeVpcsInput{}, func(opts *ec2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -298,10 +308,10 @@ func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) str t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } -func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.EC2Conn(ctx) @@ -310,9 +320,10 @@ func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) str req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -352,6 +363,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -364,30 +376,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -451,10 +468,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -488,6 +509,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ecr/service_endpoints_gen_test.go b/internal/service/ecr/service_endpoints_gen_test.go index 903e47bcea9..eefc215a796 100644 --- a/internal/service/ecr/service_endpoints_gen_test.go +++ b/internal/service/ecr/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ecr_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ecr" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ECRClient(ctx) + var result apiCallParams + _, err := client.DescribeRepositories(ctx, &ecr_sdkv2.DescribeRepositoriesInput{}, func(opts *ecr_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ecrpublic/service_endpoints_gen_test.go b/internal/service/ecrpublic/service_endpoints_gen_test.go index c195a103f1d..ca3b6bbf884 100644 --- a/internal/service/ecrpublic/service_endpoints_gen_test.go +++ b/internal/service/ecrpublic/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ecrpublic_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ecrpublic" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ECRPublicClient(ctx) + var result apiCallParams + _, err := client.DescribeRepositories(ctx, &ecrpublic_sdkv2.DescribeRepositoriesInput{}, func(opts *ecrpublic_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ecs/service_endpoints_gen_test.go b/internal/service/ecs/service_endpoints_gen_test.go index 1ef3cc0afc2..18fc6939416 100644 --- a/internal/service/ecs/service_endpoints_gen_test.go +++ b/internal/service/ecs/service_endpoints_gen_test.go @@ -13,7 +13,10 @@ import ( "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ecs_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ecs" ecs_sdkv1 "github.com/aws/aws-sdk-go/service/ecs" "github.com/aws/smithy-go/middleware" @@ -48,11 +51,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -277,17 +286,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ECSClient(ctx) + var result apiCallParams + _, err := client.ListClusters(ctx, &ecs_sdkv2.ListClustersInput{}, func(opts *ecs_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -298,10 +308,10 @@ func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) str t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } -func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ECSConn(ctx) @@ -310,9 +320,10 @@ func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) str req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -352,6 +363,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -364,30 +376,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -451,10 +468,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -488,6 +509,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/efs/service_endpoints_gen_test.go b/internal/service/efs/service_endpoints_gen_test.go index 4b60c943834..14096e6da0d 100644 --- a/internal/service/efs/service_endpoints_gen_test.go +++ b/internal/service/efs/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" efs_sdkv1 "github.com/aws/aws-sdk-go/service/efs" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.EFSConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/eks/service_endpoints_gen_test.go b/internal/service/eks/service_endpoints_gen_test.go index efc5b71f9b1..b061fcb338a 100644 --- a/internal/service/eks/service_endpoints_gen_test.go +++ b/internal/service/eks/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" eks_sdkv2 "github.com/aws/aws-sdk-go-v2/service/eks" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.EKSClient(ctx) + var result apiCallParams + _, err := client.ListClusters(ctx, &eks_sdkv2.ListClustersInput{}, func(opts *eks_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/elasticache/service_endpoints_gen_test.go b/internal/service/elasticache/service_endpoints_gen_test.go index 5b42a73f8ed..d3d662a63a0 100644 --- a/internal/service/elasticache/service_endpoints_gen_test.go +++ b/internal/service/elasticache/service_endpoints_gen_test.go @@ -13,7 +13,10 @@ import ( "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" elasticache_sdkv2 "github.com/aws/aws-sdk-go-v2/service/elasticache" elasticache_sdkv1 "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/smithy-go/middleware" @@ -48,11 +51,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -277,17 +286,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ElastiCacheClient(ctx) + var result apiCallParams + _, err := client.DescribeCacheClusters(ctx, &elasticache_sdkv2.DescribeCacheClustersInput{}, func(opts *elasticache_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -298,10 +308,10 @@ func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) str t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } -func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ElastiCacheConn(ctx) @@ -310,9 +320,10 @@ func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) str req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -352,6 +363,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -364,30 +376,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -451,10 +468,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -488,6 +509,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go index 0197f9f082a..7f27e36d421 100644 --- a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go +++ b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" elasticbeanstalk_sdkv2 "github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ElasticBeanstalkClient(ctx) + var result apiCallParams + _, err := client.ListAvailableSolutionStacks(ctx, &elasticbeanstalk_sdkv2.ListAvailableSolutionStacksInput{}, func(opts *elasticbeanstalk_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/elasticsearch/service_endpoints_gen_test.go b/internal/service/elasticsearch/service_endpoints_gen_test.go index 28fb7a2fbfd..110c1799671 100644 --- a/internal/service/elasticsearch/service_endpoints_gen_test.go +++ b/internal/service/elasticsearch/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" elasticsearchservice_sdkv1 "github.com/aws/aws-sdk-go/service/elasticsearchservice" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -378,7 +382,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ElasticsearchConn(ctx) @@ -387,9 +391,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -459,6 +464,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -471,42 +477,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -570,74 +583,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/elastictranscoder/service_endpoints_gen_test.go b/internal/service/elastictranscoder/service_endpoints_gen_test.go index 1c88bf9759f..2dd10b4e76f 100644 --- a/internal/service/elastictranscoder/service_endpoints_gen_test.go +++ b/internal/service/elastictranscoder/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" elastictranscoder_sdkv1 "github.com/aws/aws-sdk-go/service/elastictranscoder" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ElasticTranscoderConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/elb/service_endpoints_gen_test.go b/internal/service/elb/service_endpoints_gen_test.go index cacaac268f6..8f9c884fb13 100644 --- a/internal/service/elb/service_endpoints_gen_test.go +++ b/internal/service/elb/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" elb_sdkv1 "github.com/aws/aws-sdk-go/service/elb" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -319,7 +323,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ELBConn(ctx) @@ -328,9 +332,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -389,6 +394,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -401,36 +407,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -494,74 +506,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/elbv2/service_endpoints_gen_test.go b/internal/service/elbv2/service_endpoints_gen_test.go index 2456b625fdf..2e368b6fb20 100644 --- a/internal/service/elbv2/service_endpoints_gen_test.go +++ b/internal/service/elbv2/service_endpoints_gen_test.go @@ -13,7 +13,10 @@ import ( "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" elasticloadbalancingv2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" elbv2_sdkv1 "github.com/aws/aws-sdk-go/service/elbv2" "github.com/aws/smithy-go/middleware" @@ -49,11 +52,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -331,17 +340,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ELBV2Client(ctx) + var result apiCallParams + _, err := client.DescribeLoadBalancers(ctx, &elasticloadbalancingv2_sdkv2.DescribeLoadBalancersInput{}, func(opts *elasticloadbalancingv2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -352,10 +362,10 @@ func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) str t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } -func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ELBV2Conn(ctx) @@ -364,9 +374,10 @@ func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) str req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -425,6 +436,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -437,36 +449,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -530,10 +548,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -567,6 +589,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/emr/service_endpoints_gen_test.go b/internal/service/emr/service_endpoints_gen_test.go index 53cbf618cb7..1db885ff332 100644 --- a/internal/service/emr/service_endpoints_gen_test.go +++ b/internal/service/emr/service_endpoints_gen_test.go @@ -13,7 +13,10 @@ import ( "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" emr_sdkv2 "github.com/aws/aws-sdk-go-v2/service/emr" emr_sdkv1 "github.com/aws/aws-sdk-go/service/emr" "github.com/aws/smithy-go/middleware" @@ -48,11 +51,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -277,17 +286,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.EMRClient(ctx) + var result apiCallParams + _, err := client.ListClusters(ctx, &emr_sdkv2.ListClustersInput{}, func(opts *emr_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -298,10 +308,10 @@ func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) str t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } -func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.EMRConn(ctx) @@ -310,9 +320,10 @@ func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) str req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -352,6 +363,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -364,30 +376,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -451,10 +468,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -488,6 +509,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/emrcontainers/service_endpoints_gen_test.go b/internal/service/emrcontainers/service_endpoints_gen_test.go index d832d2b6d4e..dbb71f124ce 100644 --- a/internal/service/emrcontainers/service_endpoints_gen_test.go +++ b/internal/service/emrcontainers/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" emrcontainers_sdkv1 "github.com/aws/aws-sdk-go/service/emrcontainers" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.EMRContainersConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/emrserverless/service_endpoints_gen_test.go b/internal/service/emrserverless/service_endpoints_gen_test.go index 31caed2ca4b..d97f3211586 100644 --- a/internal/service/emrserverless/service_endpoints_gen_test.go +++ b/internal/service/emrserverless/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" emrserverless_sdkv2 "github.com/aws/aws-sdk-go-v2/service/emrserverless" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.EMRServerlessClient(ctx) + var result apiCallParams + _, err := client.ListApplications(ctx, &emrserverless_sdkv2.ListApplicationsInput{}, func(opts *emrserverless_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/events/service_endpoints_gen_test.go b/internal/service/events/service_endpoints_gen_test.go index 29a794343ea..e85545ff586 100644 --- a/internal/service/events/service_endpoints_gen_test.go +++ b/internal/service/events/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" eventbridge_sdkv2 "github.com/aws/aws-sdk-go-v2/service/eventbridge" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -377,17 +384,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.EventsClient(ctx) + var result apiCallParams + _, err := client.ListEventBuses(ctx, &eventbridge_sdkv2.ListEventBusesInput{}, func(opts *eventbridge_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -398,7 +406,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -468,6 +476,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -480,42 +489,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -579,10 +595,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -616,6 +636,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/evidently/service_endpoints_gen_test.go b/internal/service/evidently/service_endpoints_gen_test.go index a6f3d9e6f5b..9bd77888a78 100644 --- a/internal/service/evidently/service_endpoints_gen_test.go +++ b/internal/service/evidently/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" evidently_sdkv2 "github.com/aws/aws-sdk-go-v2/service/evidently" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.EvidentlyClient(ctx) + var result apiCallParams + _, err := client.ListProjects(ctx, &evidently_sdkv2.ListProjectsInput{}, func(opts *evidently_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/finspace/service_endpoints_gen_test.go b/internal/service/finspace/service_endpoints_gen_test.go index 67de3d3c072..38fdd1194cd 100644 --- a/internal/service/finspace/service_endpoints_gen_test.go +++ b/internal/service/finspace/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" finspace_sdkv2 "github.com/aws/aws-sdk-go-v2/service/finspace" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.FinSpaceClient(ctx) + var result apiCallParams + _, err := client.ListEnvironments(ctx, &finspace_sdkv2.ListEnvironmentsInput{}, func(opts *finspace_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/firehose/service_endpoints_gen_test.go b/internal/service/firehose/service_endpoints_gen_test.go index 817cf6d80e8..8ab88f10ce5 100644 --- a/internal/service/firehose/service_endpoints_gen_test.go +++ b/internal/service/firehose/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" firehose_sdkv2 "github.com/aws/aws-sdk-go-v2/service/firehose" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.FirehoseClient(ctx) + var result apiCallParams + _, err := client.ListDeliveryStreams(ctx, &firehose_sdkv2.ListDeliveryStreamsInput{}, func(opts *firehose_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/fis/service_endpoints_gen_test.go b/internal/service/fis/service_endpoints_gen_test.go index bdc468fd48b..72e7cc562df 100644 --- a/internal/service/fis/service_endpoints_gen_test.go +++ b/internal/service/fis/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" fis_sdkv2 "github.com/aws/aws-sdk-go-v2/service/fis" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.FISClient(ctx) + var result apiCallParams + _, err := client.ListExperiments(ctx, &fis_sdkv2.ListExperimentsInput{}, func(opts *fis_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/fms/service_endpoints_gen_test.go b/internal/service/fms/service_endpoints_gen_test.go index 55e04d705cc..7c1a3ff2b5d 100644 --- a/internal/service/fms/service_endpoints_gen_test.go +++ b/internal/service/fms/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" fms_sdkv2 "github.com/aws/aws-sdk-go-v2/service/fms" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,19 +271,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.FMSClient(ctx) + var result apiCallParams + _, err := client.ListAppsLists(ctx, &fms_sdkv2.ListAppsListsInput{ MaxResults: aws_sdkv2.Int32(1), }, func(opts *fms_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -287,7 +295,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -327,6 +335,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -339,30 +348,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -426,10 +440,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -463,6 +481,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/fsx/service_endpoints_gen_test.go b/internal/service/fsx/service_endpoints_gen_test.go index 15b9e168d37..1f4c52b1332 100644 --- a/internal/service/fsx/service_endpoints_gen_test.go +++ b/internal/service/fsx/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" fsx_sdkv1 "github.com/aws/aws-sdk-go/service/fsx" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.FSxConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/gamelift/service_endpoints_gen_test.go b/internal/service/gamelift/service_endpoints_gen_test.go index 56ca2c728be..7ad81367297 100644 --- a/internal/service/gamelift/service_endpoints_gen_test.go +++ b/internal/service/gamelift/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" gamelift_sdkv1 "github.com/aws/aws-sdk-go/service/gamelift" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.GameLiftConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/glacier/service_endpoints_gen_test.go b/internal/service/glacier/service_endpoints_gen_test.go index 9586bef6e90..b48a5e43dc0 100644 --- a/internal/service/glacier/service_endpoints_gen_test.go +++ b/internal/service/glacier/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" glacier_sdkv2 "github.com/aws/aws-sdk-go-v2/service/glacier" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.GlacierClient(ctx) + var result apiCallParams + _, err := client.ListVaults(ctx, &glacier_sdkv2.ListVaultsInput{}, func(opts *glacier_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/globalaccelerator/service_endpoints_gen_test.go b/internal/service/globalaccelerator/service_endpoints_gen_test.go index 8ee08fdb2db..bf007c35cf2 100644 --- a/internal/service/globalaccelerator/service_endpoints_gen_test.go +++ b/internal/service/globalaccelerator/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" globalaccelerator_sdkv2 "github.com/aws/aws-sdk-go-v2/service/globalaccelerator" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.GlobalAcceleratorClient(ctx) + var result apiCallParams + _, err := client.ListAccelerators(ctx, &globalaccelerator_sdkv2.ListAcceleratorsInput{}, func(opts *globalaccelerator_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/glue/service_endpoints_gen_test.go b/internal/service/glue/service_endpoints_gen_test.go index 12931b54502..512d474e2b5 100644 --- a/internal/service/glue/service_endpoints_gen_test.go +++ b/internal/service/glue/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" glue_sdkv1 "github.com/aws/aws-sdk-go/service/glue" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.GlueConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/grafana/service_endpoints_gen_test.go b/internal/service/grafana/service_endpoints_gen_test.go index 8f8758a0b6c..d6a26260d9d 100644 --- a/internal/service/grafana/service_endpoints_gen_test.go +++ b/internal/service/grafana/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" managedgrafana_sdkv1 "github.com/aws/aws-sdk-go/service/managedgrafana" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -378,7 +382,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.GrafanaConn(ctx) @@ -387,9 +391,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -459,6 +464,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -471,42 +477,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -570,74 +583,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/greengrass/service_endpoints_gen_test.go b/internal/service/greengrass/service_endpoints_gen_test.go index 3a8842b6dca..1687151cc06 100644 --- a/internal/service/greengrass/service_endpoints_gen_test.go +++ b/internal/service/greengrass/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" greengrass_sdkv1 "github.com/aws/aws-sdk-go/service/greengrass" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.GreengrassConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/groundstation/service_endpoints_gen_test.go b/internal/service/groundstation/service_endpoints_gen_test.go index 4416bcbad8e..9af8d1f5e06 100644 --- a/internal/service/groundstation/service_endpoints_gen_test.go +++ b/internal/service/groundstation/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" groundstation_sdkv2 "github.com/aws/aws-sdk-go-v2/service/groundstation" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.GroundStationClient(ctx) + var result apiCallParams + _, err := client.ListConfigs(ctx, &groundstation_sdkv2.ListConfigsInput{}, func(opts *groundstation_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/guardduty/service_endpoints_gen_test.go b/internal/service/guardduty/service_endpoints_gen_test.go index 4eba3a9fea6..45419dcbf9f 100644 --- a/internal/service/guardduty/service_endpoints_gen_test.go +++ b/internal/service/guardduty/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" guardduty_sdkv1 "github.com/aws/aws-sdk-go/service/guardduty" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.GuardDutyConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/healthlake/service_endpoints_gen_test.go b/internal/service/healthlake/service_endpoints_gen_test.go index 5008b86dffe..527c7ce3db7 100644 --- a/internal/service/healthlake/service_endpoints_gen_test.go +++ b/internal/service/healthlake/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" healthlake_sdkv2 "github.com/aws/aws-sdk-go-v2/service/healthlake" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.HealthLakeClient(ctx) + var result apiCallParams + _, err := client.ListFHIRDatastores(ctx, &healthlake_sdkv2.ListFHIRDatastoresInput{}, func(opts *healthlake_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/iam/service_endpoints_gen_test.go b/internal/service/iam/service_endpoints_gen_test.go index 66b6bc048d0..86973dcab56 100644 --- a/internal/service/iam/service_endpoints_gen_test.go +++ b/internal/service/iam/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" iam_sdkv2 "github.com/aws/aws-sdk-go-v2/service/iam" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -374,17 +381,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.IAMClient(ctx) + var result apiCallParams + _, err := client.ListRoles(ctx, &iam_sdkv2.ListRolesInput{}, func(opts *iam_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -395,7 +403,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -443,6 +451,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -455,18 +464,21 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } @@ -476,6 +488,7 @@ func expectTfAwsEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(tfAwsEnvVar, awsEnvVar), }, + region: "us-west-2", } } @@ -485,18 +498,21 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(deprecatedEnvVar, awsEnvVar), }, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -560,10 +576,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -597,6 +617,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/identitystore/service_endpoints_gen_test.go b/internal/service/identitystore/service_endpoints_gen_test.go index 0f8baf86d64..68059c14168 100644 --- a/internal/service/identitystore/service_endpoints_gen_test.go +++ b/internal/service/identitystore/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" identitystore_sdkv2 "github.com/aws/aws-sdk-go-v2/service/identitystore" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,19 +271,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.IdentityStoreClient(ctx) + var result apiCallParams + _, err := client.ListUsers(ctx, &identitystore_sdkv2.ListUsersInput{ IdentityStoreId: aws_sdkv2.String("d-1234567890"), }, func(opts *identitystore_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -287,7 +295,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -327,6 +335,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -339,30 +348,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -426,10 +440,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -463,6 +481,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/imagebuilder/service_endpoints_gen_test.go b/internal/service/imagebuilder/service_endpoints_gen_test.go index 939f6ccc1c3..654598b7e75 100644 --- a/internal/service/imagebuilder/service_endpoints_gen_test.go +++ b/internal/service/imagebuilder/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" imagebuilder_sdkv1 "github.com/aws/aws-sdk-go/service/imagebuilder" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -268,7 +272,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ImageBuilderConn(ctx) @@ -277,9 +281,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -319,6 +324,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -331,30 +337,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -418,74 +429,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/inspector/service_endpoints_gen_test.go b/internal/service/inspector/service_endpoints_gen_test.go index e77df3cd80f..e333640cd72 100644 --- a/internal/service/inspector/service_endpoints_gen_test.go +++ b/internal/service/inspector/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" inspector_sdkv1 "github.com/aws/aws-sdk-go/service/inspector" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.InspectorConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/inspector2/service_endpoints_gen_test.go b/internal/service/inspector2/service_endpoints_gen_test.go index 8aff09c5a86..de9e1513140 100644 --- a/internal/service/inspector2/service_endpoints_gen_test.go +++ b/internal/service/inspector2/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" inspector2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/inspector2" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.Inspector2Client(ctx) + var result apiCallParams + _, err := client.ListAccountPermissions(ctx, &inspector2_sdkv2.ListAccountPermissionsInput{}, func(opts *inspector2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/internetmonitor/service_endpoints_gen_test.go b/internal/service/internetmonitor/service_endpoints_gen_test.go index 1215e95d95e..1f317645caa 100644 --- a/internal/service/internetmonitor/service_endpoints_gen_test.go +++ b/internal/service/internetmonitor/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" internetmonitor_sdkv2 "github.com/aws/aws-sdk-go-v2/service/internetmonitor" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.InternetMonitorClient(ctx) + var result apiCallParams + _, err := client.ListMonitors(ctx, &internetmonitor_sdkv2.ListMonitorsInput{}, func(opts *internetmonitor_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/iot/service_endpoints_gen_test.go b/internal/service/iot/service_endpoints_gen_test.go index 026c5f580b6..8fffbf002c2 100644 --- a/internal/service/iot/service_endpoints_gen_test.go +++ b/internal/service/iot/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" iot_sdkv1 "github.com/aws/aws-sdk-go/service/iot" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.IoTConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/iotanalytics/service_endpoints_gen_test.go b/internal/service/iotanalytics/service_endpoints_gen_test.go index 5a1ebf5bcf4..51dae5933c7 100644 --- a/internal/service/iotanalytics/service_endpoints_gen_test.go +++ b/internal/service/iotanalytics/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" iotanalytics_sdkv1 "github.com/aws/aws-sdk-go/service/iotanalytics" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.IoTAnalyticsConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/iotevents/service_endpoints_gen_test.go b/internal/service/iotevents/service_endpoints_gen_test.go index fd2da6c9871..ac8772046ee 100644 --- a/internal/service/iotevents/service_endpoints_gen_test.go +++ b/internal/service/iotevents/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" iotevents_sdkv1 "github.com/aws/aws-sdk-go/service/iotevents" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.IoTEventsConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/ivs/service_endpoints_gen_test.go b/internal/service/ivs/service_endpoints_gen_test.go index b1993fa58d0..cd57a711bcb 100644 --- a/internal/service/ivs/service_endpoints_gen_test.go +++ b/internal/service/ivs/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" ivs_sdkv1 "github.com/aws/aws-sdk-go/service/ivs" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.IVSConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/ivschat/service_endpoints_gen_test.go b/internal/service/ivschat/service_endpoints_gen_test.go index 3c545b6c488..204c0452ec9 100644 --- a/internal/service/ivschat/service_endpoints_gen_test.go +++ b/internal/service/ivschat/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ivschat_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ivschat" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.IVSChatClient(ctx) + var result apiCallParams + _, err := client.ListRooms(ctx, &ivschat_sdkv2.ListRoomsInput{}, func(opts *ivschat_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/kafka/service_endpoints_gen_test.go b/internal/service/kafka/service_endpoints_gen_test.go index 553266437e2..e87c511839d 100644 --- a/internal/service/kafka/service_endpoints_gen_test.go +++ b/internal/service/kafka/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" kafka_sdkv2 "github.com/aws/aws-sdk-go-v2/service/kafka" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.KafkaClient(ctx) + var result apiCallParams + _, err := client.ListClusters(ctx, &kafka_sdkv2.ListClustersInput{}, func(opts *kafka_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/kafkaconnect/service_endpoints_gen_test.go b/internal/service/kafkaconnect/service_endpoints_gen_test.go index 67814649ea0..0e16d745ceb 100644 --- a/internal/service/kafkaconnect/service_endpoints_gen_test.go +++ b/internal/service/kafkaconnect/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" kafkaconnect_sdkv1 "github.com/aws/aws-sdk-go/service/kafkaconnect" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.KafkaConnectConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/kendra/service_endpoints_gen_test.go b/internal/service/kendra/service_endpoints_gen_test.go index cf571cb9acf..bfb08816444 100644 --- a/internal/service/kendra/service_endpoints_gen_test.go +++ b/internal/service/kendra/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" kendra_sdkv2 "github.com/aws/aws-sdk-go-v2/service/kendra" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.KendraClient(ctx) + var result apiCallParams + _, err := client.ListIndices(ctx, &kendra_sdkv2.ListIndicesInput{}, func(opts *kendra_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/keyspaces/service_endpoints_gen_test.go b/internal/service/keyspaces/service_endpoints_gen_test.go index c22b0667aef..f12ae03c6fc 100644 --- a/internal/service/keyspaces/service_endpoints_gen_test.go +++ b/internal/service/keyspaces/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" keyspaces_sdkv2 "github.com/aws/aws-sdk-go-v2/service/keyspaces" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.KeyspacesClient(ctx) + var result apiCallParams + _, err := client.ListKeyspaces(ctx, &keyspaces_sdkv2.ListKeyspacesInput{}, func(opts *keyspaces_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/kinesis/service_endpoints_gen_test.go b/internal/service/kinesis/service_endpoints_gen_test.go index 4664e7781ec..dd3ca34006b 100644 --- a/internal/service/kinesis/service_endpoints_gen_test.go +++ b/internal/service/kinesis/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" kinesis_sdkv2 "github.com/aws/aws-sdk-go-v2/service/kinesis" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.KinesisClient(ctx) + var result apiCallParams + _, err := client.ListStreams(ctx, &kinesis_sdkv2.ListStreamsInput{}, func(opts *kinesis_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/kinesisanalytics/service_endpoints_gen_test.go b/internal/service/kinesisanalytics/service_endpoints_gen_test.go index 5b31efc1cba..edf1dc33a2a 100644 --- a/internal/service/kinesisanalytics/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalytics/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" kinesisanalytics_sdkv1 "github.com/aws/aws-sdk-go/service/kinesisanalytics" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.KinesisAnalyticsConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go index 5da7a1c31c9..387c7ccc131 100644 --- a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" kinesisanalyticsv2_sdkv1 "github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.KinesisAnalyticsV2Conn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/kinesisvideo/service_endpoints_gen_test.go b/internal/service/kinesisvideo/service_endpoints_gen_test.go index 0a6f69766f6..b19c1585009 100644 --- a/internal/service/kinesisvideo/service_endpoints_gen_test.go +++ b/internal/service/kinesisvideo/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" kinesisvideo_sdkv1 "github.com/aws/aws-sdk-go/service/kinesisvideo" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.KinesisVideoConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/kms/service_endpoints_gen_test.go b/internal/service/kms/service_endpoints_gen_test.go index f4ef3517ca1..e7efbe194b2 100644 --- a/internal/service/kms/service_endpoints_gen_test.go +++ b/internal/service/kms/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" kms_sdkv2 "github.com/aws/aws-sdk-go-v2/service/kms" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.KMSClient(ctx) + var result apiCallParams + _, err := client.ListKeys(ctx, &kms_sdkv2.ListKeysInput{}, func(opts *kms_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/lakeformation/service_endpoints_gen_test.go b/internal/service/lakeformation/service_endpoints_gen_test.go index f8ac65f8acc..e08e8d6b08a 100644 --- a/internal/service/lakeformation/service_endpoints_gen_test.go +++ b/internal/service/lakeformation/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" lakeformation_sdkv2 "github.com/aws/aws-sdk-go-v2/service/lakeformation" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.LakeFormationClient(ctx) + var result apiCallParams + _, err := client.ListResources(ctx, &lakeformation_sdkv2.ListResourcesInput{}, func(opts *lakeformation_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/lambda/service_endpoints_gen_test.go b/internal/service/lambda/service_endpoints_gen_test.go index 5fd6a63170f..4c888551ec9 100644 --- a/internal/service/lambda/service_endpoints_gen_test.go +++ b/internal/service/lambda/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" lambda_sdkv2 "github.com/aws/aws-sdk-go-v2/service/lambda" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.LambdaClient(ctx) + var result apiCallParams + _, err := client.ListFunctions(ctx, &lambda_sdkv2.ListFunctionsInput{}, func(opts *lambda_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/launchwizard/service_endpoints_gen_test.go b/internal/service/launchwizard/service_endpoints_gen_test.go index a8ec1045b1f..83da718c7de 100644 --- a/internal/service/launchwizard/service_endpoints_gen_test.go +++ b/internal/service/launchwizard/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" launchwizard_sdkv2 "github.com/aws/aws-sdk-go-v2/service/launchwizard" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.LaunchWizardClient(ctx) + var result apiCallParams + _, err := client.ListWorkloads(ctx, &launchwizard_sdkv2.ListWorkloadsInput{}, func(opts *launchwizard_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/lexmodels/service_endpoints_gen_test.go b/internal/service/lexmodels/service_endpoints_gen_test.go index d93072b8aeb..cfcf77833b9 100644 --- a/internal/service/lexmodels/service_endpoints_gen_test.go +++ b/internal/service/lexmodels/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" lexmodelbuildingservice_sdkv1 "github.com/aws/aws-sdk-go/service/lexmodelbuildingservice" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -445,7 +449,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.LexModelsConn(ctx) @@ -454,9 +458,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -537,6 +542,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -549,48 +555,56 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, + region: "us-west-2", } } func expectAliasName2ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName2ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -654,74 +668,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/lexv2models/service_endpoints_gen_test.go b/internal/service/lexv2models/service_endpoints_gen_test.go index 52339498dc1..120c98549c4 100644 --- a/internal/service/lexv2models/service_endpoints_gen_test.go +++ b/internal/service/lexv2models/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" lexmodelsv2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/lexmodelsv2" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.LexV2ModelsClient(ctx) + var result apiCallParams + _, err := client.ListBots(ctx, &lexmodelsv2_sdkv2.ListBotsInput{}, func(opts *lexmodelsv2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/licensemanager/service_endpoints_gen_test.go b/internal/service/licensemanager/service_endpoints_gen_test.go index ca8d700331b..d50c1f5af8b 100644 --- a/internal/service/licensemanager/service_endpoints_gen_test.go +++ b/internal/service/licensemanager/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" licensemanager_sdkv1 "github.com/aws/aws-sdk-go/service/licensemanager" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.LicenseManagerConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/lightsail/service_endpoints_gen_test.go b/internal/service/lightsail/service_endpoints_gen_test.go index 0f105fd6580..4caad1df614 100644 --- a/internal/service/lightsail/service_endpoints_gen_test.go +++ b/internal/service/lightsail/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" lightsail_sdkv2 "github.com/aws/aws-sdk-go-v2/service/lightsail" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.LightsailClient(ctx) + var result apiCallParams + _, err := client.GetInstances(ctx, &lightsail_sdkv2.GetInstancesInput{}, func(opts *lightsail_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/location/service_endpoints_gen_test.go b/internal/service/location/service_endpoints_gen_test.go index 8656a3db012..b610e667ac7 100644 --- a/internal/service/location/service_endpoints_gen_test.go +++ b/internal/service/location/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" locationservice_sdkv1 "github.com/aws/aws-sdk-go/service/locationservice" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -319,7 +323,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.LocationConn(ctx) @@ -328,9 +332,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -389,6 +394,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -401,36 +407,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -494,74 +506,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/logs/service_endpoints_gen_test.go b/internal/service/logs/service_endpoints_gen_test.go index f3e81e74725..1db1798af69 100644 --- a/internal/service/logs/service_endpoints_gen_test.go +++ b/internal/service/logs/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" cloudwatchlogs_sdkv2 "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -377,17 +384,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.LogsClient(ctx) + var result apiCallParams + _, err := client.ListAnomalies(ctx, &cloudwatchlogs_sdkv2.ListAnomaliesInput{}, func(opts *cloudwatchlogs_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -398,7 +406,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -468,6 +476,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -480,42 +489,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -579,10 +595,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -616,6 +636,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/lookoutmetrics/service_endpoints_gen_test.go b/internal/service/lookoutmetrics/service_endpoints_gen_test.go index ca45d86df16..d46c1f58976 100644 --- a/internal/service/lookoutmetrics/service_endpoints_gen_test.go +++ b/internal/service/lookoutmetrics/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" lookoutmetrics_sdkv2 "github.com/aws/aws-sdk-go-v2/service/lookoutmetrics" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.LookoutMetricsClient(ctx) + var result apiCallParams + _, err := client.ListMetricSets(ctx, &lookoutmetrics_sdkv2.ListMetricSetsInput{}, func(opts *lookoutmetrics_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/m2/service_endpoints_gen_test.go b/internal/service/m2/service_endpoints_gen_test.go index 4150a1f59a9..0f5426277f5 100644 --- a/internal/service/m2/service_endpoints_gen_test.go +++ b/internal/service/m2/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" m2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/m2" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.M2Client(ctx) + var result apiCallParams + _, err := client.ListApplications(ctx, &m2_sdkv2.ListApplicationsInput{}, func(opts *m2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/macie2/service_endpoints_gen_test.go b/internal/service/macie2/service_endpoints_gen_test.go index b6357de3c60..03c76cf8854 100644 --- a/internal/service/macie2/service_endpoints_gen_test.go +++ b/internal/service/macie2/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" macie2_sdkv1 "github.com/aws/aws-sdk-go/service/macie2" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.Macie2Conn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/mediaconnect/service_endpoints_gen_test.go b/internal/service/mediaconnect/service_endpoints_gen_test.go index 460d45f3a48..6cb7d55b3ea 100644 --- a/internal/service/mediaconnect/service_endpoints_gen_test.go +++ b/internal/service/mediaconnect/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" mediaconnect_sdkv2 "github.com/aws/aws-sdk-go-v2/service/mediaconnect" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.MediaConnectClient(ctx) + var result apiCallParams + _, err := client.ListBridges(ctx, &mediaconnect_sdkv2.ListBridgesInput{}, func(opts *mediaconnect_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/mediaconvert/service_endpoints_gen_test.go b/internal/service/mediaconvert/service_endpoints_gen_test.go index 629c5bbd5f1..37d50011580 100644 --- a/internal/service/mediaconvert/service_endpoints_gen_test.go +++ b/internal/service/mediaconvert/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" mediaconvert_sdkv2 "github.com/aws/aws-sdk-go-v2/service/mediaconvert" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.MediaConvertClient(ctx) + var result apiCallParams + _, err := client.ListJobs(ctx, &mediaconvert_sdkv2.ListJobsInput{}, func(opts *mediaconvert_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/medialive/service_endpoints_gen_test.go b/internal/service/medialive/service_endpoints_gen_test.go index 5ee46b171d8..880a46cd65b 100644 --- a/internal/service/medialive/service_endpoints_gen_test.go +++ b/internal/service/medialive/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" medialive_sdkv2 "github.com/aws/aws-sdk-go-v2/service/medialive" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.MediaLiveClient(ctx) + var result apiCallParams + _, err := client.ListOfferings(ctx, &medialive_sdkv2.ListOfferingsInput{}, func(opts *medialive_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/mediapackage/service_endpoints_gen_test.go b/internal/service/mediapackage/service_endpoints_gen_test.go index ad5c19ffead..d890f593180 100644 --- a/internal/service/mediapackage/service_endpoints_gen_test.go +++ b/internal/service/mediapackage/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" mediapackage_sdkv2 "github.com/aws/aws-sdk-go-v2/service/mediapackage" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.MediaPackageClient(ctx) + var result apiCallParams + _, err := client.ListChannels(ctx, &mediapackage_sdkv2.ListChannelsInput{}, func(opts *mediapackage_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/mediapackagev2/service_endpoints_gen_test.go b/internal/service/mediapackagev2/service_endpoints_gen_test.go index 1d2dc27b592..41a560fffa9 100644 --- a/internal/service/mediapackagev2/service_endpoints_gen_test.go +++ b/internal/service/mediapackagev2/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" mediapackagev2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/mediapackagev2" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.MediaPackageV2Client(ctx) + var result apiCallParams + _, err := client.ListChannelGroups(ctx, &mediapackagev2_sdkv2.ListChannelGroupsInput{}, func(opts *mediapackagev2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/mediastore/service_endpoints_gen_test.go b/internal/service/mediastore/service_endpoints_gen_test.go index 863796252ea..5c7f21a68fb 100644 --- a/internal/service/mediastore/service_endpoints_gen_test.go +++ b/internal/service/mediastore/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" mediastore_sdkv2 "github.com/aws/aws-sdk-go-v2/service/mediastore" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.MediaStoreClient(ctx) + var result apiCallParams + _, err := client.ListContainers(ctx, &mediastore_sdkv2.ListContainersInput{}, func(opts *mediastore_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/memorydb/service_endpoints_gen_test.go b/internal/service/memorydb/service_endpoints_gen_test.go index c9330b075f2..d14bd125dd5 100644 --- a/internal/service/memorydb/service_endpoints_gen_test.go +++ b/internal/service/memorydb/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" memorydb_sdkv1 "github.com/aws/aws-sdk-go/service/memorydb" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.MemoryDBConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/mq/service_endpoints_gen_test.go b/internal/service/mq/service_endpoints_gen_test.go index d50d48684c0..bb79b95542f 100644 --- a/internal/service/mq/service_endpoints_gen_test.go +++ b/internal/service/mq/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" mq_sdkv2 "github.com/aws/aws-sdk-go-v2/service/mq" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.MQClient(ctx) + var result apiCallParams + _, err := client.ListBrokers(ctx, &mq_sdkv2.ListBrokersInput{}, func(opts *mq_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/neptune/service_endpoints_gen_test.go b/internal/service/neptune/service_endpoints_gen_test.go index fd59c4a645f..797188b4c61 100644 --- a/internal/service/neptune/service_endpoints_gen_test.go +++ b/internal/service/neptune/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" neptune_sdkv1 "github.com/aws/aws-sdk-go/service/neptune" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.NeptuneConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/networkfirewall/service_endpoints_gen_test.go b/internal/service/networkfirewall/service_endpoints_gen_test.go index bf677b14d05..d38e4368f3d 100644 --- a/internal/service/networkfirewall/service_endpoints_gen_test.go +++ b/internal/service/networkfirewall/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" networkfirewall_sdkv1 "github.com/aws/aws-sdk-go/service/networkfirewall" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.NetworkFirewallConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/networkmanager/service_endpoints_gen_test.go b/internal/service/networkmanager/service_endpoints_gen_test.go index e80e8d897f8..037cec3b0e5 100644 --- a/internal/service/networkmanager/service_endpoints_gen_test.go +++ b/internal/service/networkmanager/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" networkmanager_sdkv1 "github.com/aws/aws-sdk-go/service/networkmanager" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.NetworkManagerConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/oam/service_endpoints_gen_test.go b/internal/service/oam/service_endpoints_gen_test.go index 39047eb0ad8..9c0c6725882 100644 --- a/internal/service/oam/service_endpoints_gen_test.go +++ b/internal/service/oam/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" oam_sdkv2 "github.com/aws/aws-sdk-go-v2/service/oam" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ObservabilityAccessManagerClient(ctx) + var result apiCallParams + _, err := client.ListLinks(ctx, &oam_sdkv2.ListLinksInput{}, func(opts *oam_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/opensearch/service_endpoints_gen_test.go b/internal/service/opensearch/service_endpoints_gen_test.go index 54be2ec3cba..da31730a13e 100644 --- a/internal/service/opensearch/service_endpoints_gen_test.go +++ b/internal/service/opensearch/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" opensearchservice_sdkv1 "github.com/aws/aws-sdk-go/service/opensearchservice" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -319,7 +323,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.OpenSearchConn(ctx) @@ -328,9 +332,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -389,6 +394,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -401,36 +407,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -494,74 +506,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/opensearchserverless/service_endpoints_gen_test.go b/internal/service/opensearchserverless/service_endpoints_gen_test.go index 2e3540fd880..e29a1283da2 100644 --- a/internal/service/opensearchserverless/service_endpoints_gen_test.go +++ b/internal/service/opensearchserverless/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" opensearchserverless_sdkv2 "github.com/aws/aws-sdk-go-v2/service/opensearchserverless" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.OpenSearchServerlessClient(ctx) + var result apiCallParams + _, err := client.ListCollections(ctx, &opensearchserverless_sdkv2.ListCollectionsInput{}, func(opts *opensearchserverless_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/opsworks/service_endpoints_gen_test.go b/internal/service/opsworks/service_endpoints_gen_test.go index f7aac82ed55..55bb8e08af6 100644 --- a/internal/service/opsworks/service_endpoints_gen_test.go +++ b/internal/service/opsworks/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" opsworks_sdkv1 "github.com/aws/aws-sdk-go/service/opsworks" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.OpsWorksConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/organizations/service_endpoints_gen_test.go b/internal/service/organizations/service_endpoints_gen_test.go index 3e1cfbd7bd3..369572d285c 100644 --- a/internal/service/organizations/service_endpoints_gen_test.go +++ b/internal/service/organizations/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" organizations_sdkv2 "github.com/aws/aws-sdk-go-v2/service/organizations" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.OrganizationsClient(ctx) + var result apiCallParams + _, err := client.ListAccounts(ctx, &organizations_sdkv2.ListAccountsInput{}, func(opts *organizations_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/osis/service_endpoints_gen_test.go b/internal/service/osis/service_endpoints_gen_test.go index e52e08f9be9..cadf575e39f 100644 --- a/internal/service/osis/service_endpoints_gen_test.go +++ b/internal/service/osis/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" osis_sdkv2 "github.com/aws/aws-sdk-go-v2/service/osis" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.OpenSearchIngestionClient(ctx) + var result apiCallParams + _, err := client.ListPipelines(ctx, &osis_sdkv2.ListPipelinesInput{}, func(opts *osis_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/outposts/service_endpoints_gen_test.go b/internal/service/outposts/service_endpoints_gen_test.go index fc01a2b8bb1..3cf7e0a690a 100644 --- a/internal/service/outposts/service_endpoints_gen_test.go +++ b/internal/service/outposts/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" outposts_sdkv1 "github.com/aws/aws-sdk-go/service/outposts" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.OutpostsConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/pcaconnectorad/service_endpoints_gen_test.go b/internal/service/pcaconnectorad/service_endpoints_gen_test.go index 6b73509af02..4ba71e399cd 100644 --- a/internal/service/pcaconnectorad/service_endpoints_gen_test.go +++ b/internal/service/pcaconnectorad/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" pcaconnectorad_sdkv2 "github.com/aws/aws-sdk-go-v2/service/pcaconnectorad" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.PCAConnectorADClient(ctx) + var result apiCallParams + _, err := client.ListConnectors(ctx, &pcaconnectorad_sdkv2.ListConnectorsInput{}, func(opts *pcaconnectorad_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/pinpoint/service_endpoints_gen_test.go b/internal/service/pinpoint/service_endpoints_gen_test.go index b5dd96644ec..47b6740144c 100644 --- a/internal/service/pinpoint/service_endpoints_gen_test.go +++ b/internal/service/pinpoint/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" pinpoint_sdkv1 "github.com/aws/aws-sdk-go/service/pinpoint" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.PinpointConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/pipes/service_endpoints_gen_test.go b/internal/service/pipes/service_endpoints_gen_test.go index 94202ea4ed1..d39f4d1121e 100644 --- a/internal/service/pipes/service_endpoints_gen_test.go +++ b/internal/service/pipes/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" pipes_sdkv2 "github.com/aws/aws-sdk-go-v2/service/pipes" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.PipesClient(ctx) + var result apiCallParams + _, err := client.ListPipes(ctx, &pipes_sdkv2.ListPipesInput{}, func(opts *pipes_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/polly/service_endpoints_gen_test.go b/internal/service/polly/service_endpoints_gen_test.go index bd2a512c2e8..054842576d2 100644 --- a/internal/service/polly/service_endpoints_gen_test.go +++ b/internal/service/polly/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" polly_sdkv2 "github.com/aws/aws-sdk-go-v2/service/polly" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.PollyClient(ctx) + var result apiCallParams + _, err := client.ListLexicons(ctx, &polly_sdkv2.ListLexiconsInput{}, func(opts *polly_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/pricing/service_endpoints_gen_test.go b/internal/service/pricing/service_endpoints_gen_test.go index c381bf4a380..9923cffa860 100644 --- a/internal/service/pricing/service_endpoints_gen_test.go +++ b/internal/service/pricing/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" pricing_sdkv2 "github.com/aws/aws-sdk-go-v2/service/pricing" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.PricingClient(ctx) + var result apiCallParams + _, err := client.DescribeServices(ctx, &pricing_sdkv2.DescribeServicesInput{}, func(opts *pricing_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/qbusiness/service_endpoints_gen_test.go b/internal/service/qbusiness/service_endpoints_gen_test.go index addee8f98e1..2edba1a8591 100644 --- a/internal/service/qbusiness/service_endpoints_gen_test.go +++ b/internal/service/qbusiness/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" qbusiness_sdkv2 "github.com/aws/aws-sdk-go-v2/service/qbusiness" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.QBusinessClient(ctx) + var result apiCallParams + _, err := client.ListApplications(ctx, &qbusiness_sdkv2.ListApplicationsInput{}, func(opts *qbusiness_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/qldb/service_endpoints_gen_test.go b/internal/service/qldb/service_endpoints_gen_test.go index f64fe3f3bbf..96aaa0bd9ec 100644 --- a/internal/service/qldb/service_endpoints_gen_test.go +++ b/internal/service/qldb/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" qldb_sdkv2 "github.com/aws/aws-sdk-go-v2/service/qldb" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.QLDBClient(ctx) + var result apiCallParams + _, err := client.ListLedgers(ctx, &qldb_sdkv2.ListLedgersInput{}, func(opts *qldb_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/quicksight/service_endpoints_gen_test.go b/internal/service/quicksight/service_endpoints_gen_test.go index 3792227ea15..a9d4370efc1 100644 --- a/internal/service/quicksight/service_endpoints_gen_test.go +++ b/internal/service/quicksight/service_endpoints_gen_test.go @@ -9,15 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" quicksight_sdkv1 "github.com/aws/aws-sdk-go/service/quicksight" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -48,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -266,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.QuickSightConn(ctx) @@ -277,9 +280,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -319,6 +323,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -331,30 +336,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -418,74 +428,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/ram/service_endpoints_gen_test.go b/internal/service/ram/service_endpoints_gen_test.go index b45bfce1511..17a35491251 100644 --- a/internal/service/ram/service_endpoints_gen_test.go +++ b/internal/service/ram/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ram_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ram" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.RAMClient(ctx) + var result apiCallParams + _, err := client.ListPermissions(ctx, &ram_sdkv2.ListPermissionsInput{}, func(opts *ram_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/rbin/service_endpoints_gen_test.go b/internal/service/rbin/service_endpoints_gen_test.go index 335df876261..b00adec3ba0 100644 --- a/internal/service/rbin/service_endpoints_gen_test.go +++ b/internal/service/rbin/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" rbin_sdkv2 "github.com/aws/aws-sdk-go-v2/service/rbin" awstypes "github.com/aws/aws-sdk-go-v2/service/rbin/types" "github.com/aws/smithy-go/middleware" @@ -49,11 +50,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -319,19 +326,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.RBinClient(ctx) + var result apiCallParams + _, err := client.ListRules(ctx, &rbin_sdkv2.ListRulesInput{ ResourceType: awstypes.ResourceTypeEc2Image, }, func(opts *rbin_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -342,7 +350,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -401,6 +409,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -413,36 +422,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -506,10 +521,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -543,6 +562,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/rds/service_endpoints_gen_test.go b/internal/service/rds/service_endpoints_gen_test.go index 19755f5ea79..a0064b02c24 100644 --- a/internal/service/rds/service_endpoints_gen_test.go +++ b/internal/service/rds/service_endpoints_gen_test.go @@ -13,7 +13,10 @@ import ( "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" rds_sdkv2 "github.com/aws/aws-sdk-go-v2/service/rds" rds_sdkv1 "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/smithy-go/middleware" @@ -48,11 +51,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -277,17 +286,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.RDSClient(ctx) + var result apiCallParams + _, err := client.DescribeDBInstances(ctx, &rds_sdkv2.DescribeDBInstancesInput{}, func(opts *rds_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -298,10 +308,10 @@ func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) str t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } -func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.RDSConn(ctx) @@ -310,9 +320,10 @@ func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) str req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -352,6 +363,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -364,30 +376,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -451,10 +468,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -488,6 +509,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/redshift/service_endpoints_gen_test.go b/internal/service/redshift/service_endpoints_gen_test.go index c83c214473f..f2ef409ddba 100644 --- a/internal/service/redshift/service_endpoints_gen_test.go +++ b/internal/service/redshift/service_endpoints_gen_test.go @@ -13,7 +13,10 @@ import ( "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" redshift_sdkv2 "github.com/aws/aws-sdk-go-v2/service/redshift" redshift_sdkv1 "github.com/aws/aws-sdk-go/service/redshift" "github.com/aws/smithy-go/middleware" @@ -48,11 +51,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -277,17 +286,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.RedshiftClient(ctx) + var result apiCallParams + _, err := client.DescribeClusters(ctx, &redshift_sdkv2.DescribeClustersInput{}, func(opts *redshift_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -298,10 +308,10 @@ func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) str t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } -func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.RedshiftConn(ctx) @@ -310,9 +320,10 @@ func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) str req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -352,6 +363,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -364,30 +376,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -451,10 +468,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -488,6 +509,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/redshiftdata/service_endpoints_gen_test.go b/internal/service/redshiftdata/service_endpoints_gen_test.go index 58cc555506d..30ea5948a4a 100644 --- a/internal/service/redshiftdata/service_endpoints_gen_test.go +++ b/internal/service/redshiftdata/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" redshiftdata_sdkv2 "github.com/aws/aws-sdk-go-v2/service/redshiftdata" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,19 +325,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.RedshiftDataClient(ctx) + var result apiCallParams + _, err := client.ListDatabases(ctx, &redshiftdata_sdkv2.ListDatabasesInput{ Database: aws_sdkv2.String("test"), }, func(opts *redshiftdata_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -341,7 +349,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -400,6 +408,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -412,36 +421,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -505,10 +520,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -542,6 +561,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/redshiftserverless/service_endpoints_gen_test.go b/internal/service/redshiftserverless/service_endpoints_gen_test.go index 06a97ae005a..8f3186026c8 100644 --- a/internal/service/redshiftserverless/service_endpoints_gen_test.go +++ b/internal/service/redshiftserverless/service_endpoints_gen_test.go @@ -13,7 +13,10 @@ import ( "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" + aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" redshiftserverless_sdkv2 "github.com/aws/aws-sdk-go-v2/service/redshiftserverless" redshiftserverless_sdkv1 "github.com/aws/aws-sdk-go/service/redshiftserverless" "github.com/aws/smithy-go/middleware" @@ -48,11 +51,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -277,17 +286,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.RedshiftServerlessClient(ctx) + var result apiCallParams + _, err := client.ListNamespaces(ctx, &redshiftserverless_sdkv2.ListNamespacesInput{}, func(opts *redshiftserverless_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -298,10 +308,10 @@ func callServiceV2(ctx context.Context, t *testing.T, meta *conns.AWSClient) str t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } -func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.RedshiftServerlessConn(ctx) @@ -310,9 +320,10 @@ func callServiceV1(ctx context.Context, t *testing.T, meta *conns.AWSClient) str req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -352,6 +363,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -364,30 +376,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -451,10 +468,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -488,6 +509,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/rekognition/service_endpoints_gen_test.go b/internal/service/rekognition/service_endpoints_gen_test.go index 3d9f6020bae..aad5629ef3b 100644 --- a/internal/service/rekognition/service_endpoints_gen_test.go +++ b/internal/service/rekognition/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" rekognition_sdkv2 "github.com/aws/aws-sdk-go-v2/service/rekognition" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.RekognitionClient(ctx) + var result apiCallParams + _, err := client.ListCollections(ctx, &rekognition_sdkv2.ListCollectionsInput{}, func(opts *rekognition_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/resourceexplorer2/service_endpoints_gen_test.go b/internal/service/resourceexplorer2/service_endpoints_gen_test.go index 0153f992507..4bda68a3fdb 100644 --- a/internal/service/resourceexplorer2/service_endpoints_gen_test.go +++ b/internal/service/resourceexplorer2/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" resourceexplorer2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/resourceexplorer2" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ResourceExplorer2Client(ctx) + var result apiCallParams + _, err := client.ListIndexes(ctx, &resourceexplorer2_sdkv2.ListIndexesInput{}, func(opts *resourceexplorer2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/resourcegroups/service_endpoints_gen_test.go b/internal/service/resourcegroups/service_endpoints_gen_test.go index 946d519406e..138b84814b4 100644 --- a/internal/service/resourcegroups/service_endpoints_gen_test.go +++ b/internal/service/resourcegroups/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" resourcegroups_sdkv2 "github.com/aws/aws-sdk-go-v2/service/resourcegroups" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ResourceGroupsClient(ctx) + var result apiCallParams + _, err := client.ListGroups(ctx, &resourcegroups_sdkv2.ListGroupsInput{}, func(opts *resourcegroups_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go index 5baa8e476b5..0338f657a9e 100644 --- a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go +++ b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" resourcegroupstaggingapi_sdkv2 "github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ResourceGroupsTaggingAPIClient(ctx) + var result apiCallParams + _, err := client.GetResources(ctx, &resourcegroupstaggingapi_sdkv2.GetResourcesInput{}, func(opts *resourcegroupstaggingapi_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/rolesanywhere/service_endpoints_gen_test.go b/internal/service/rolesanywhere/service_endpoints_gen_test.go index 620fe3c289f..160eb2a4dd3 100644 --- a/internal/service/rolesanywhere/service_endpoints_gen_test.go +++ b/internal/service/rolesanywhere/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" rolesanywhere_sdkv2 "github.com/aws/aws-sdk-go-v2/service/rolesanywhere" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.RolesAnywhereClient(ctx) + var result apiCallParams + _, err := client.ListProfiles(ctx, &rolesanywhere_sdkv2.ListProfilesInput{}, func(opts *rolesanywhere_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/route53/service_endpoints_gen_test.go b/internal/service/route53/service_endpoints_gen_test.go index 3c433c365c5..099b7bc7caf 100644 --- a/internal/service/route53/service_endpoints_gen_test.go +++ b/internal/service/route53/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" route53_sdkv2 "github.com/aws/aws-sdk-go-v2/service/route53" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.Route53Client(ctx) + var result apiCallParams + _, err := client.ListHostedZones(ctx, &route53_sdkv2.ListHostedZonesInput{}, func(opts *route53_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-east-1", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-east-1", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-east-1", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-east-1", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-east-1", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-east-1", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/route53domains/service_endpoints_gen_test.go b/internal/service/route53domains/service_endpoints_gen_test.go index 0898d65f904..5b24c0e3b63 100644 --- a/internal/service/route53domains/service_endpoints_gen_test.go +++ b/internal/service/route53domains/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" route53domains_sdkv2 "github.com/aws/aws-sdk-go-v2/service/route53domains" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -69,7 +76,7 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-east-1" //lintignore:AWSAT003 + const region = "us-west-2" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ "no config": { @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.Route53DomainsClient(ctx) + var result apiCallParams + _, err := client.ListDomains(ctx, &route53domains_sdkv2.ListDomainsInput{}, func(opts *route53domains_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go index 198b372f592..4553c9c8499 100644 --- a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go +++ b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" route53recoverycontrolconfig_sdkv1 "github.com/aws/aws-sdk-go/service/route53recoverycontrolconfig" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.Route53RecoveryControlConfigConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go index 36ce66bbb38..67c21e99cb6 100644 --- a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go +++ b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" route53recoveryreadiness_sdkv1 "github.com/aws/aws-sdk-go/service/route53recoveryreadiness" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -268,7 +272,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.Route53RecoveryReadinessConn(ctx) @@ -277,9 +281,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -319,6 +324,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -331,30 +337,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -418,74 +429,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/route53resolver/service_endpoints_gen_test.go b/internal/service/route53resolver/service_endpoints_gen_test.go index e41b3986915..56342008766 100644 --- a/internal/service/route53resolver/service_endpoints_gen_test.go +++ b/internal/service/route53resolver/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" route53resolver_sdkv1 "github.com/aws/aws-sdk-go/service/route53resolver" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.Route53ResolverConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/rum/service_endpoints_gen_test.go b/internal/service/rum/service_endpoints_gen_test.go index e5471157093..61947621e1e 100644 --- a/internal/service/rum/service_endpoints_gen_test.go +++ b/internal/service/rum/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" cloudwatchrum_sdkv1 "github.com/aws/aws-sdk-go/service/cloudwatchrum" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -319,7 +323,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.RUMConn(ctx) @@ -328,9 +332,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -389,6 +394,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -401,36 +407,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -494,74 +506,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/s3/service_endpoints_gen_test.go b/internal/service/s3/service_endpoints_gen_test.go index 6b7d23b64ad..7f5f2e91ce2 100644 --- a/internal/service/s3/service_endpoints_gen_test.go +++ b/internal/service/s3/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" s3_sdkv2 "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -442,17 +449,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.S3Client(ctx) + var result apiCallParams + _, err := client.ListBuckets(ctx, &s3_sdkv2.ListBucketsInput{}, func(opts *s3_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -463,7 +471,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -530,6 +538,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -542,24 +551,28 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } @@ -569,6 +582,7 @@ func expectTfAwsEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(tfAwsEnvVar, awsEnvVar), }, + region: "us-west-2", } } @@ -578,18 +592,21 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(deprecatedEnvVar, awsEnvVar), }, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -653,10 +670,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -690,6 +711,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/s3outposts/service_endpoints_gen_test.go b/internal/service/s3outposts/service_endpoints_gen_test.go index 0b591f64bb8..38898f8981a 100644 --- a/internal/service/s3outposts/service_endpoints_gen_test.go +++ b/internal/service/s3outposts/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" s3outposts_sdkv1 "github.com/aws/aws-sdk-go/service/s3outposts" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.S3OutpostsConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/sagemaker/service_endpoints_gen_test.go b/internal/service/sagemaker/service_endpoints_gen_test.go index 8b81d91d46e..c7773fc1b0b 100644 --- a/internal/service/sagemaker/service_endpoints_gen_test.go +++ b/internal/service/sagemaker/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" sagemaker_sdkv1 "github.com/aws/aws-sdk-go/service/sagemaker" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.SageMakerConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/scheduler/service_endpoints_gen_test.go b/internal/service/scheduler/service_endpoints_gen_test.go index 5c2a34fd3d1..fc64f85b76a 100644 --- a/internal/service/scheduler/service_endpoints_gen_test.go +++ b/internal/service/scheduler/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" scheduler_sdkv2 "github.com/aws/aws-sdk-go-v2/service/scheduler" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SchedulerClient(ctx) + var result apiCallParams + _, err := client.ListSchedules(ctx, &scheduler_sdkv2.ListSchedulesInput{}, func(opts *scheduler_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/schemas/service_endpoints_gen_test.go b/internal/service/schemas/service_endpoints_gen_test.go index da75b3c794d..176ba06039b 100644 --- a/internal/service/schemas/service_endpoints_gen_test.go +++ b/internal/service/schemas/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" schemas_sdkv1 "github.com/aws/aws-sdk-go/service/schemas" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.SchemasConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/secretsmanager/service_endpoints_gen_test.go b/internal/service/secretsmanager/service_endpoints_gen_test.go index 0e9080b97e8..00ea073b9cb 100644 --- a/internal/service/secretsmanager/service_endpoints_gen_test.go +++ b/internal/service/secretsmanager/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" secretsmanager_sdkv2 "github.com/aws/aws-sdk-go-v2/service/secretsmanager" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SecretsManagerClient(ctx) + var result apiCallParams + _, err := client.ListSecrets(ctx, &secretsmanager_sdkv2.ListSecretsInput{}, func(opts *secretsmanager_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/securityhub/service_endpoints_gen_test.go b/internal/service/securityhub/service_endpoints_gen_test.go index 79f61268d0e..563ad55f966 100644 --- a/internal/service/securityhub/service_endpoints_gen_test.go +++ b/internal/service/securityhub/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" securityhub_sdkv2 "github.com/aws/aws-sdk-go-v2/service/securityhub" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SecurityHubClient(ctx) + var result apiCallParams + _, err := client.ListAutomationRules(ctx, &securityhub_sdkv2.ListAutomationRulesInput{}, func(opts *securityhub_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/securitylake/service_endpoints_gen_test.go b/internal/service/securitylake/service_endpoints_gen_test.go index 030370fd99a..a7363fab1ea 100644 --- a/internal/service/securitylake/service_endpoints_gen_test.go +++ b/internal/service/securitylake/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" securitylake_sdkv2 "github.com/aws/aws-sdk-go-v2/service/securitylake" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SecurityLakeClient(ctx) + var result apiCallParams + _, err := client.ListDataLakes(ctx, &securitylake_sdkv2.ListDataLakesInput{}, func(opts *securitylake_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/serverlessrepo/service_endpoints_gen_test.go b/internal/service/serverlessrepo/service_endpoints_gen_test.go index 4e20a85d997..ba8602adba2 100644 --- a/internal/service/serverlessrepo/service_endpoints_gen_test.go +++ b/internal/service/serverlessrepo/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" serverlessapplicationrepository_sdkv1 "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -378,7 +382,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ServerlessRepoConn(ctx) @@ -387,9 +391,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -459,6 +464,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -471,42 +477,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -570,74 +583,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/servicecatalog/service_endpoints_gen_test.go b/internal/service/servicecatalog/service_endpoints_gen_test.go index 92ccea15f3b..615dbc52a13 100644 --- a/internal/service/servicecatalog/service_endpoints_gen_test.go +++ b/internal/service/servicecatalog/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" servicecatalog_sdkv1 "github.com/aws/aws-sdk-go/service/servicecatalog" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ServiceCatalogConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go index 80fe9d1ca70..30fc7657694 100644 --- a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go +++ b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" servicecatalogappregistry_sdkv2 "github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ServiceCatalogAppRegistryClient(ctx) + var result apiCallParams + _, err := client.ListApplications(ctx, &servicecatalogappregistry_sdkv2.ListApplicationsInput{}, func(opts *servicecatalogappregistry_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/servicediscovery/service_endpoints_gen_test.go b/internal/service/servicediscovery/service_endpoints_gen_test.go index 347e6243960..a0f27192d88 100644 --- a/internal/service/servicediscovery/service_endpoints_gen_test.go +++ b/internal/service/servicediscovery/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" servicediscovery_sdkv1 "github.com/aws/aws-sdk-go/service/servicediscovery" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.ServiceDiscoveryConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/servicequotas/service_endpoints_gen_test.go b/internal/service/servicequotas/service_endpoints_gen_test.go index 2c13f629da3..d320f6aae04 100644 --- a/internal/service/servicequotas/service_endpoints_gen_test.go +++ b/internal/service/servicequotas/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" servicequotas_sdkv2 "github.com/aws/aws-sdk-go-v2/service/servicequotas" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ServiceQuotasClient(ctx) + var result apiCallParams + _, err := client.ListServices(ctx, &servicequotas_sdkv2.ListServicesInput{}, func(opts *servicequotas_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ses/service_endpoints_gen_test.go b/internal/service/ses/service_endpoints_gen_test.go index 05a609de797..ab4637b92a3 100644 --- a/internal/service/ses/service_endpoints_gen_test.go +++ b/internal/service/ses/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" ses_sdkv1 "github.com/aws/aws-sdk-go/service/ses" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.SESConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/sesv2/service_endpoints_gen_test.go b/internal/service/sesv2/service_endpoints_gen_test.go index 8da45952329..a91a82f7a0c 100644 --- a/internal/service/sesv2/service_endpoints_gen_test.go +++ b/internal/service/sesv2/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" sesv2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/sesv2" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SESV2Client(ctx) + var result apiCallParams + _, err := client.ListContactLists(ctx, &sesv2_sdkv2.ListContactListsInput{}, func(opts *sesv2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/sfn/service_endpoints_gen_test.go b/internal/service/sfn/service_endpoints_gen_test.go index a42cebc2c93..55a869b397e 100644 --- a/internal/service/sfn/service_endpoints_gen_test.go +++ b/internal/service/sfn/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" sfn_sdkv1 "github.com/aws/aws-sdk-go/service/sfn" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -319,7 +323,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.SFNConn(ctx) @@ -328,9 +332,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -389,6 +394,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -401,36 +407,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -494,74 +506,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/shield/service_endpoints_gen_test.go b/internal/service/shield/service_endpoints_gen_test.go index ecd3909c3f5..57e1f0407c7 100644 --- a/internal/service/shield/service_endpoints_gen_test.go +++ b/internal/service/shield/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" shield_sdkv2 "github.com/aws/aws-sdk-go-v2/service/shield" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.ShieldClient(ctx) + var result apiCallParams + _, err := client.ListProtectionGroups(ctx, &shield_sdkv2.ListProtectionGroupsInput{}, func(opts *shield_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/signer/service_endpoints_gen_test.go b/internal/service/signer/service_endpoints_gen_test.go index 283fa443a43..b5eb672d95b 100644 --- a/internal/service/signer/service_endpoints_gen_test.go +++ b/internal/service/signer/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" signer_sdkv2 "github.com/aws/aws-sdk-go-v2/service/signer" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SignerClient(ctx) + var result apiCallParams + _, err := client.ListSigningJobs(ctx, &signer_sdkv2.ListSigningJobsInput{}, func(opts *signer_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/simpledb/service_endpoints_gen_test.go b/internal/service/simpledb/service_endpoints_gen_test.go index 6a79e5f12aa..5a64a3ffc11 100644 --- a/internal/service/simpledb/service_endpoints_gen_test.go +++ b/internal/service/simpledb/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" simpledb_sdkv1 "github.com/aws/aws-sdk-go/service/simpledb" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/go-cty/cty" @@ -48,11 +46,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -319,7 +323,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.SimpleDBConn(ctx) @@ -328,9 +332,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -389,6 +394,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -401,36 +407,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -494,74 +506,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/sns/service_endpoints_gen_test.go b/internal/service/sns/service_endpoints_gen_test.go index 554db312d25..f5b20c61401 100644 --- a/internal/service/sns/service_endpoints_gen_test.go +++ b/internal/service/sns/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" sns_sdkv2 "github.com/aws/aws-sdk-go-v2/service/sns" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SNSClient(ctx) + var result apiCallParams + _, err := client.ListSubscriptions(ctx, &sns_sdkv2.ListSubscriptionsInput{}, func(opts *sns_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/sqs/service_endpoints_gen_test.go b/internal/service/sqs/service_endpoints_gen_test.go index 0790c9ccd7d..6c349f1c4e9 100644 --- a/internal/service/sqs/service_endpoints_gen_test.go +++ b/internal/service/sqs/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" sqs_sdkv2 "github.com/aws/aws-sdk-go-v2/service/sqs" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SQSClient(ctx) + var result apiCallParams + _, err := client.ListQueues(ctx, &sqs_sdkv2.ListQueuesInput{}, func(opts *sqs_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ssm/service_endpoints_gen_test.go b/internal/service/ssm/service_endpoints_gen_test.go index ed5267fdc85..0fa03bb25ee 100644 --- a/internal/service/ssm/service_endpoints_gen_test.go +++ b/internal/service/ssm/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ssm_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ssm" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SSMClient(ctx) + var result apiCallParams + _, err := client.ListDocuments(ctx, &ssm_sdkv2.ListDocumentsInput{}, func(opts *ssm_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ssmcontacts/service_endpoints_gen_test.go b/internal/service/ssmcontacts/service_endpoints_gen_test.go index 5cb571d4060..9d5863b84ba 100644 --- a/internal/service/ssmcontacts/service_endpoints_gen_test.go +++ b/internal/service/ssmcontacts/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ssmcontacts_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ssmcontacts" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SSMContactsClient(ctx) + var result apiCallParams + _, err := client.ListContacts(ctx, &ssmcontacts_sdkv2.ListContactsInput{}, func(opts *ssmcontacts_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ssmincidents/service_endpoints_gen_test.go b/internal/service/ssmincidents/service_endpoints_gen_test.go index 0b849bad1b7..23cc83b956f 100644 --- a/internal/service/ssmincidents/service_endpoints_gen_test.go +++ b/internal/service/ssmincidents/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ssmincidents_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ssmincidents" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SSMIncidentsClient(ctx) + var result apiCallParams + _, err := client.ListResponsePlans(ctx, &ssmincidents_sdkv2.ListResponsePlansInput{}, func(opts *ssmincidents_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ssmsap/service_endpoints_gen_test.go b/internal/service/ssmsap/service_endpoints_gen_test.go index b1e953191e6..30bd9c3b8eb 100644 --- a/internal/service/ssmsap/service_endpoints_gen_test.go +++ b/internal/service/ssmsap/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ssmsap_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ssmsap" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SSMSAPClient(ctx) + var result apiCallParams + _, err := client.ListApplications(ctx, &ssmsap_sdkv2.ListApplicationsInput{}, func(opts *ssmsap_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/sso/service_endpoints_gen_test.go b/internal/service/sso/service_endpoints_gen_test.go index 755eab8603a..1fa79ce2bff 100644 --- a/internal/service/sso/service_endpoints_gen_test.go +++ b/internal/service/sso/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" sso_sdkv2 "github.com/aws/aws-sdk-go-v2/service/sso" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,19 +271,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SSOClient(ctx) + var result apiCallParams + _, err := client.ListAccounts(ctx, &sso_sdkv2.ListAccountsInput{ AccessToken: aws_sdkv2.String("mock-access-token"), }, func(opts *sso_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -287,7 +295,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -327,6 +335,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -339,30 +348,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -426,10 +440,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -463,6 +481,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/ssoadmin/service_endpoints_gen_test.go b/internal/service/ssoadmin/service_endpoints_gen_test.go index 15eb1ff772d..f9149e2efb6 100644 --- a/internal/service/ssoadmin/service_endpoints_gen_test.go +++ b/internal/service/ssoadmin/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ssoadmin_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ssoadmin" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SSOAdminClient(ctx) + var result apiCallParams + _, err := client.ListInstances(ctx, &ssoadmin_sdkv2.ListInstancesInput{}, func(opts *ssoadmin_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/storagegateway/service_endpoints_gen_test.go b/internal/service/storagegateway/service_endpoints_gen_test.go index 7d737ae6f69..a761f29929a 100644 --- a/internal/service/storagegateway/service_endpoints_gen_test.go +++ b/internal/service/storagegateway/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" storagegateway_sdkv1 "github.com/aws/aws-sdk-go/service/storagegateway" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,7 +269,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.StorageGatewayConn(ctx) @@ -274,9 +278,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -316,6 +321,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -328,30 +334,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -415,74 +426,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/sts/service_endpoints_gen_test.go b/internal/service/sts/service_endpoints_gen_test.go index 05f13c36aad..6d826e5de56 100644 --- a/internal/service/sts/service_endpoints_gen_test.go +++ b/internal/service/sts/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" sts_sdkv2 "github.com/aws/aws-sdk-go-v2/service/sts" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -374,17 +381,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.STSClient(ctx) + var result apiCallParams + _, err := client.GetCallerIdentity(ctx, &sts_sdkv2.GetCallerIdentityInput{}, func(opts *sts_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -395,7 +403,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -443,6 +451,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -455,18 +464,21 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } @@ -476,6 +488,7 @@ func expectTfAwsEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(tfAwsEnvVar, awsEnvVar), }, + region: "us-west-2", } } @@ -485,18 +498,21 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(deprecatedEnvVar, awsEnvVar), }, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -560,10 +576,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -597,6 +617,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/swf/service_endpoints_gen_test.go b/internal/service/swf/service_endpoints_gen_test.go index 2f291c05822..ef31eb1179d 100644 --- a/internal/service/swf/service_endpoints_gen_test.go +++ b/internal/service/swf/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" swf_sdkv2 "github.com/aws/aws-sdk-go-v2/service/swf" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,19 +271,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SWFClient(ctx) + var result apiCallParams + _, err := client.ListDomains(ctx, &swf_sdkv2.ListDomainsInput{ RegistrationStatus: "REGISTERED", }, func(opts *swf_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -287,7 +295,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -327,6 +335,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -339,30 +348,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -426,10 +440,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -463,6 +481,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/synthetics/service_endpoints_gen_test.go b/internal/service/synthetics/service_endpoints_gen_test.go index db2bec9a557..a6d0aaad241 100644 --- a/internal/service/synthetics/service_endpoints_gen_test.go +++ b/internal/service/synthetics/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" synthetics_sdkv2 "github.com/aws/aws-sdk-go-v2/service/synthetics" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.SyntheticsClient(ctx) + var result apiCallParams + _, err := client.ListGroups(ctx, &synthetics_sdkv2.ListGroupsInput{}, func(opts *synthetics_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go index cf1ab36eae5..9bb478754eb 100644 --- a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go +++ b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" timestreaminfluxdb_sdkv2 "github.com/aws/aws-sdk-go-v2/service/timestreaminfluxdb" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.TimestreamInfluxDBClient(ctx) + var result apiCallParams + _, err := client.ListDbInstances(ctx, ×treaminfluxdb_sdkv2.ListDbInstancesInput{}, func(opts *timestreaminfluxdb_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/transcribe/service_endpoints_gen_test.go b/internal/service/transcribe/service_endpoints_gen_test.go index 4a30e72660a..e4838123240 100644 --- a/internal/service/transcribe/service_endpoints_gen_test.go +++ b/internal/service/transcribe/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" transcribe_sdkv2 "github.com/aws/aws-sdk-go-v2/service/transcribe" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -318,17 +325,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.TranscribeClient(ctx) + var result apiCallParams + _, err := client.ListLanguageModels(ctx, &transcribe_sdkv2.ListLanguageModelsInput{}, func(opts *transcribe_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -339,7 +347,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -398,6 +406,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -410,36 +419,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -503,10 +518,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -540,6 +559,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/transfer/service_endpoints_gen_test.go b/internal/service/transfer/service_endpoints_gen_test.go index 49dcdbea2ad..0acee7ca893 100644 --- a/internal/service/transfer/service_endpoints_gen_test.go +++ b/internal/service/transfer/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" transfer_sdkv2 "github.com/aws/aws-sdk-go-v2/service/transfer" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.TransferClient(ctx) + var result apiCallParams + _, err := client.ListConnectors(ctx, &transfer_sdkv2.ListConnectorsInput{}, func(opts *transfer_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/verifiedpermissions/service_endpoints_gen_test.go b/internal/service/verifiedpermissions/service_endpoints_gen_test.go index b4f1792cefe..0299976cde4 100644 --- a/internal/service/verifiedpermissions/service_endpoints_gen_test.go +++ b/internal/service/verifiedpermissions/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" verifiedpermissions_sdkv2 "github.com/aws/aws-sdk-go-v2/service/verifiedpermissions" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.VerifiedPermissionsClient(ctx) + var result apiCallParams + _, err := client.ListPolicyStores(ctx, &verifiedpermissions_sdkv2.ListPolicyStoresInput{}, func(opts *verifiedpermissions_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/vpclattice/service_endpoints_gen_test.go b/internal/service/vpclattice/service_endpoints_gen_test.go index 99170a9a660..00e790cecdd 100644 --- a/internal/service/vpclattice/service_endpoints_gen_test.go +++ b/internal/service/vpclattice/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" vpclattice_sdkv2 "github.com/aws/aws-sdk-go-v2/service/vpclattice" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.VPCLatticeClient(ctx) + var result apiCallParams + _, err := client.ListServices(ctx, &vpclattice_sdkv2.ListServicesInput{}, func(opts *vpclattice_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/waf/service_endpoints_gen_test.go b/internal/service/waf/service_endpoints_gen_test.go index d9f6265ee2e..de5cfd1ec91 100644 --- a/internal/service/waf/service_endpoints_gen_test.go +++ b/internal/service/waf/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" waf_sdkv2 "github.com/aws/aws-sdk-go-v2/service/waf" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.WAFClient(ctx) + var result apiCallParams + _, err := client.ListRules(ctx, &waf_sdkv2.ListRulesInput{}, func(opts *waf_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/wafregional/service_endpoints_gen_test.go b/internal/service/wafregional/service_endpoints_gen_test.go index c6d6752912c..76a40eaa4b2 100644 --- a/internal/service/wafregional/service_endpoints_gen_test.go +++ b/internal/service/wafregional/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" wafregional_sdkv2 "github.com/aws/aws-sdk-go-v2/service/wafregional" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.WAFRegionalClient(ctx) + var result apiCallParams + _, err := client.ListRules(ctx, &wafregional_sdkv2.ListRulesInput{}, func(opts *wafregional_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/wafv2/service_endpoints_gen_test.go b/internal/service/wafv2/service_endpoints_gen_test.go index 52aab664b69..73aff954c86 100644 --- a/internal/service/wafv2/service_endpoints_gen_test.go +++ b/internal/service/wafv2/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" wafv2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/wafv2" awstypes "github.com/aws/aws-sdk-go-v2/service/wafv2/types" "github.com/aws/smithy-go/middleware" @@ -48,11 +49,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -265,19 +272,20 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.WAFV2Client(ctx) + var result apiCallParams + _, err := client.ListRuleGroups(ctx, &wafv2_sdkv2.ListRuleGroupsInput{ Scope: awstypes.ScopeRegional, }, func(opts *wafv2_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -288,7 +296,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -328,6 +336,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -340,30 +349,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -427,10 +441,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -464,6 +482,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/wellarchitected/service_endpoints_gen_test.go b/internal/service/wellarchitected/service_endpoints_gen_test.go index f331b21f319..2b9085267c3 100644 --- a/internal/service/wellarchitected/service_endpoints_gen_test.go +++ b/internal/service/wellarchitected/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" wellarchitected_sdkv2 "github.com/aws/aws-sdk-go-v2/service/wellarchitected" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.WellArchitectedClient(ctx) + var result apiCallParams + _, err := client.ListProfiles(ctx, &wellarchitected_sdkv2.ListProfilesInput{}, func(opts *wellarchitected_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/worklink/service_endpoints_gen_test.go b/internal/service/worklink/service_endpoints_gen_test.go index d1b673c0706..0f5a6163e29 100644 --- a/internal/service/worklink/service_endpoints_gen_test.go +++ b/internal/service/worklink/service_endpoints_gen_test.go @@ -9,14 +9,12 @@ import ( "net/url" "os" "path/filepath" - "reflect" "strings" "testing" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" worklink_sdkv1 "github.com/aws/aws-sdk-go/service/worklink" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" "github.com/google/go-cmp/cmp" "github.com/hashicorp/aws-sdk-go-base/v2/servicemocks" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -47,11 +45,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -268,7 +272,7 @@ func defaultFIPSEndpoint(region string) string { return url.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() client := meta.WorkLinkConn(ctx) @@ -277,9 +281,10 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin req.HTTPRequest.URL.Path = "/" - endpoint := req.HTTPRequest.URL.String() - - return endpoint + return apiCallParams{ + endpoint: req.HTTPRequest.URL.String(), + region: aws_sdkv1.StringValue(client.Config.Region), + } } func withNoConfig(_ *caseSetup) { @@ -319,6 +324,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -331,30 +337,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -418,74 +429,15 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) - - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) - } -} - -func addRetrieveEndpointURLMiddleware(t *testing.T, endpoint *string) func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - retrieveEndpointURLMiddleware(t, endpoint), - middleware.After, - ) - } -} - -func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Retrieve Endpoint", - func(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - t.Helper() - - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - t.Fatalf("Expected *github.com/aws/smithy-go/transport/http.Request, got %s", fullTypeName(in.Request)) - } + callParams := callF(ctx, t, meta) - url := request.URL - url.RawQuery = "" - url.Path = "/" - - *endpoint = url.String() - - return next.HandleFinalize(ctx, in) - }) -} - -var errCancelOperation = fmt.Errorf("Test: Canceling request") - -func addCancelRequestMiddleware() func(*middleware.Stack) error { - return func(stack *middleware.Stack) error { - return stack.Finalize.Add( - cancelRequestMiddleware(), - middleware.After, - ) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) } -} -// cancelRequestMiddleware creates a Smithy middleware that intercepts the request before sending and cancels it -func cancelRequestMiddleware() middleware.FinalizeMiddleware { - return middleware.FinalizeMiddlewareFunc( - "Test: Cancel Requests", - func(_ context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (middleware.FinalizeOutput, middleware.Metadata, error) { - return middleware.FinalizeOutput{}, middleware.Metadata{}, errCancelOperation - }) -} - -func fullTypeName(i interface{}) string { - return fullValueTypeName(reflect.ValueOf(i)) -} - -func fullValueTypeName(v reflect.Value) string { - if v.Kind() == reflect.Ptr { - return "*" + fullValueTypeName(reflect.Indirect(v)) + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } - - requestType := v.Type() - return fmt.Sprintf("%s.%s", requestType.PkgPath(), requestType.Name()) } func generateSharedConfigFile(config configFile) string { diff --git a/internal/service/workspaces/service_endpoints_gen_test.go b/internal/service/workspaces/service_endpoints_gen_test.go index 657b7e47d89..3df80d84334 100644 --- a/internal/service/workspaces/service_endpoints_gen_test.go +++ b/internal/service/workspaces/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" workspaces_sdkv2 "github.com/aws/aws-sdk-go-v2/service/workspaces" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.WorkSpacesClient(ctx) + var result apiCallParams + _, err := client.DescribeWorkspaces(ctx, &workspaces_sdkv2.DescribeWorkspacesInput{}, func(opts *workspaces_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/workspacesweb/service_endpoints_gen_test.go b/internal/service/workspacesweb/service_endpoints_gen_test.go index 751bdacc5bd..a622ddc2af8 100644 --- a/internal/service/workspacesweb/service_endpoints_gen_test.go +++ b/internal/service/workspacesweb/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" workspacesweb_sdkv2 "github.com/aws/aws-sdk-go-v2/service/workspacesweb" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.WorkSpacesWebClient(ctx) + var result apiCallParams + _, err := client.ListPortals(ctx, &workspacesweb_sdkv2.ListPortalsInput{}, func(opts *workspacesweb_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/internal/service/xray/service_endpoints_gen_test.go b/internal/service/xray/service_endpoints_gen_test.go index 38585beee1b..a4479722259 100644 --- a/internal/service/xray/service_endpoints_gen_test.go +++ b/internal/service/xray/service_endpoints_gen_test.go @@ -14,6 +14,7 @@ import ( "testing" aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" xray_sdkv2 "github.com/aws/aws-sdk-go-v2/service/xray" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" @@ -47,11 +48,17 @@ type configFile struct { type caseExpectations struct { diags diag.Diagnostics endpoint string + region string +} + +type apiCallParams struct { + endpoint string + region string } type setupFunc func(setup *caseSetup) -type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) string +type callFunc func(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams const ( packageNameConfigEndpoint = "https://packagename-config.endpoint.test/" @@ -264,17 +271,18 @@ func defaultFIPSEndpoint(region string) string { return ep.URI.String() } -func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) string { +func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) apiCallParams { t.Helper() - var endpoint string - client := meta.XRayClient(ctx) + var result apiCallParams + _, err := client.ListResourcePolicies(ctx, &xray_sdkv2.ListResourcePoliciesInput{}, func(opts *xray_sdkv2.Options) { opts.APIOptions = append(opts.APIOptions, - addRetrieveEndpointURLMiddleware(t, &endpoint), + addRetrieveEndpointURLMiddleware(t, &result.endpoint), + addRetrieveRegionMiddleware(&result.region), addCancelRequestMiddleware(), ) }, @@ -285,7 +293,7 @@ func callService(ctx context.Context, t *testing.T, meta *conns.AWSClient) strin t.Fatalf("Unexpected error: %s", err) } - return endpoint + return result } func withNoConfig(_ *caseSetup) { @@ -325,6 +333,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), + region: "us-west-2", } } @@ -337,30 +346,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, + region: "us-west-2", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, + region: "us-west-2", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, + region: "us-west-2", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, + region: "us-west-2", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, + region: "us-west-2", } } @@ -424,10 +438,14 @@ func testEndpointCase(t *testing.T, region string, testcase endpointTestCase, ca meta := p.Meta().(*conns.AWSClient) - endpoint := callF(ctx, t, meta) + callParams := callF(ctx, t, meta) - if endpoint != testcase.expected.endpoint { - t.Errorf("expected endpoint %q, got %q", testcase.expected.endpoint, endpoint) + if e, a := testcase.expected.endpoint, callParams.endpoint; e != a { + t.Errorf("expected endpoint %q, got %q", e, a) + } + + if e, a := testcase.expected.region, callParams.region; e != a { + t.Errorf("expected region %q, got %q", e, a) } } @@ -461,6 +479,26 @@ func retrieveEndpointURLMiddleware(t *testing.T, endpoint *string) middleware.Fi }) } +func addRetrieveRegionMiddleware(region *string) func(*middleware.Stack) error { + return func(stack *middleware.Stack) error { + return stack.Serialize.Add( + retrieveRegionMiddleware(region), + middleware.After, + ) + } +} + +func retrieveRegionMiddleware(region *string) middleware.SerializeMiddleware { + return middleware.SerializeMiddlewareFunc( + "Test: Retrieve Region", + func(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (middleware.SerializeOutput, middleware.Metadata, error) { + *region = awsmiddleware.GetRegion(ctx) + + return next.HandleSerialize(ctx, in) + }, + ) +} + var errCancelOperation = fmt.Errorf("Test: Canceling request") func addCancelRequestMiddleware() func(*middleware.Stack) error { diff --git a/names/data/read.go b/names/data/read.go index 854e7c0d685..d8262e810e1 100644 --- a/names/data/read.go +++ b/names/data/read.go @@ -171,7 +171,7 @@ func (sr ServiceRecord) EndpointAPIParams() string { return sr[colEndpointAPIParams] } -func (sr ServiceRecord) colEndpointOverrideRegion() string { +func (sr ServiceRecord) EndpointOverrideRegion() string { return sr[colEndpointOverrideRegion] } From 6254738b3b600763895a8d987f99b59a196e0bd5 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 09:39:13 -0700 Subject: [PATCH 05/15] Adds support for services where the provider overrides the endpoint and the service has a regional endpoint --- .../generate/serviceendpointtests/file.gtpl | 17 ++++++++++++----- internal/generate/serviceendpointtests/main.go | 4 ++++ .../service_endpoints_gen_test.go | 7 ++++--- .../account/service_endpoints_gen_test.go | 7 ++++--- .../service/acm/service_endpoints_gen_test.go | 7 ++++--- .../acmpca/service_endpoints_gen_test.go | 7 ++++--- .../service/amp/service_endpoints_gen_test.go | 7 ++++--- .../amplify/service_endpoints_gen_test.go | 7 ++++--- .../apigateway/service_endpoints_gen_test.go | 7 ++++--- .../apigatewayv2/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../appconfig/service_endpoints_gen_test.go | 7 ++++--- .../appfabric/service_endpoints_gen_test.go | 7 ++++--- .../appflow/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../appmesh/service_endpoints_gen_test.go | 7 ++++--- .../apprunner/service_endpoints_gen_test.go | 7 ++++--- .../appstream/service_endpoints_gen_test.go | 7 ++++--- .../appsync/service_endpoints_gen_test.go | 7 ++++--- .../athena/service_endpoints_gen_test.go | 7 ++++--- .../auditmanager/service_endpoints_gen_test.go | 7 ++++--- .../autoscaling/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../backup/service_endpoints_gen_test.go | 7 ++++--- .../service/batch/service_endpoints_gen_test.go | 9 +++++---- .../service_endpoints_gen_test.go | 7 ++++--- .../bedrock/service_endpoints_gen_test.go | 7 ++++--- .../bedrockagent/service_endpoints_gen_test.go | 7 ++++--- .../budgets/service_endpoints_gen_test.go | 7 ++++--- .../service/ce/service_endpoints_gen_test.go | 7 ++++--- .../chatbot/service_endpoints_gen_test.go | 7 ++++--- .../service/chime/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../chimesdkvoice/service_endpoints_gen_test.go | 7 ++++--- .../cleanrooms/service_endpoints_gen_test.go | 7 ++++--- .../cloud9/service_endpoints_gen_test.go | 7 ++++--- .../cloudcontrol/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../cloudfront/service_endpoints_gen_test.go | 7 ++++--- .../cloudhsmv2/service_endpoints_gen_test.go | 7 ++++--- .../cloudsearch/service_endpoints_gen_test.go | 7 ++++--- .../cloudtrail/service_endpoints_gen_test.go | 7 ++++--- .../cloudwatch/service_endpoints_gen_test.go | 7 ++++--- .../codeartifact/service_endpoints_gen_test.go | 7 ++++--- .../codebuild/service_endpoints_gen_test.go | 7 ++++--- .../codecommit/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../codepipeline/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../cognitoidp/service_endpoints_gen_test.go | 7 ++++--- .../comprehend/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../configservice/service_endpoints_gen_test.go | 7 ++++--- .../connect/service_endpoints_gen_test.go | 7 ++++--- .../connectcases/service_endpoints_gen_test.go | 7 ++++--- .../controltower/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service/cur/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../dataexchange/service_endpoints_gen_test.go | 7 ++++--- .../datapipeline/service_endpoints_gen_test.go | 7 ++++--- .../datasync/service_endpoints_gen_test.go | 7 ++++--- .../datazone/service_endpoints_gen_test.go | 7 ++++--- .../service/dax/service_endpoints_gen_test.go | 7 ++++--- .../deploy/service_endpoints_gen_test.go | 7 ++++--- .../detective/service_endpoints_gen_test.go | 7 ++++--- .../devicefarm/service_endpoints_gen_test.go | 7 ++++--- .../devopsguru/service_endpoints_gen_test.go | 7 ++++--- .../directconnect/service_endpoints_gen_test.go | 7 ++++--- .../service/dlm/service_endpoints_gen_test.go | 7 ++++--- .../service/dms/service_endpoints_gen_test.go | 7 ++++--- .../service/docdb/service_endpoints_gen_test.go | 7 ++++--- .../docdbelastic/service_endpoints_gen_test.go | 7 ++++--- .../service/drs/service_endpoints_gen_test.go | 7 ++++--- .../service/ds/service_endpoints_gen_test.go | 9 +++++---- .../dynamodb/service_endpoints_gen_test.go | 7 ++++--- .../service/ec2/service_endpoints_gen_test.go | 9 +++++---- .../service/ecr/service_endpoints_gen_test.go | 7 ++++--- .../ecrpublic/service_endpoints_gen_test.go | 7 ++++--- .../service/ecs/service_endpoints_gen_test.go | 9 +++++---- .../service/efs/service_endpoints_gen_test.go | 7 ++++--- .../service/eks/service_endpoints_gen_test.go | 7 ++++--- .../elasticache/service_endpoints_gen_test.go | 9 +++++---- .../service_endpoints_gen_test.go | 7 ++++--- .../elasticsearch/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service/elb/service_endpoints_gen_test.go | 7 ++++--- .../service/elbv2/service_endpoints_gen_test.go | 9 +++++---- .../service/emr/service_endpoints_gen_test.go | 9 +++++---- .../emrcontainers/service_endpoints_gen_test.go | 7 ++++--- .../emrserverless/service_endpoints_gen_test.go | 7 ++++--- .../events/service_endpoints_gen_test.go | 7 ++++--- .../evidently/service_endpoints_gen_test.go | 7 ++++--- .../finspace/service_endpoints_gen_test.go | 7 ++++--- .../firehose/service_endpoints_gen_test.go | 7 ++++--- .../service/fis/service_endpoints_gen_test.go | 7 ++++--- .../service/fms/service_endpoints_gen_test.go | 7 ++++--- .../service/fsx/service_endpoints_gen_test.go | 7 ++++--- .../gamelift/service_endpoints_gen_test.go | 7 ++++--- .../glacier/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service/glue/service_endpoints_gen_test.go | 7 ++++--- .../grafana/service_endpoints_gen_test.go | 7 ++++--- .../greengrass/service_endpoints_gen_test.go | 7 ++++--- .../groundstation/service_endpoints_gen_test.go | 7 ++++--- .../guardduty/service_endpoints_gen_test.go | 7 ++++--- .../healthlake/service_endpoints_gen_test.go | 7 ++++--- .../service/iam/service_endpoints_gen_test.go | 7 ++++--- .../identitystore/service_endpoints_gen_test.go | 7 ++++--- .../imagebuilder/service_endpoints_gen_test.go | 7 ++++--- .../inspector/service_endpoints_gen_test.go | 7 ++++--- .../inspector2/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service/iot/service_endpoints_gen_test.go | 7 ++++--- .../iotanalytics/service_endpoints_gen_test.go | 7 ++++--- .../iotevents/service_endpoints_gen_test.go | 7 ++++--- .../service/ivs/service_endpoints_gen_test.go | 7 ++++--- .../ivschat/service_endpoints_gen_test.go | 7 ++++--- .../service/kafka/service_endpoints_gen_test.go | 7 ++++--- .../kafkaconnect/service_endpoints_gen_test.go | 7 ++++--- .../kendra/service_endpoints_gen_test.go | 7 ++++--- .../keyspaces/service_endpoints_gen_test.go | 7 ++++--- .../kinesis/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../kinesisvideo/service_endpoints_gen_test.go | 7 ++++--- .../service/kms/service_endpoints_gen_test.go | 7 ++++--- .../lakeformation/service_endpoints_gen_test.go | 7 ++++--- .../lambda/service_endpoints_gen_test.go | 7 ++++--- .../launchwizard/service_endpoints_gen_test.go | 7 ++++--- .../lexmodels/service_endpoints_gen_test.go | 7 ++++--- .../lexv2models/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../lightsail/service_endpoints_gen_test.go | 7 ++++--- .../location/service_endpoints_gen_test.go | 7 ++++--- .../service/logs/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service/m2/service_endpoints_gen_test.go | 7 ++++--- .../macie2/service_endpoints_gen_test.go | 7 ++++--- .../mediaconnect/service_endpoints_gen_test.go | 7 ++++--- .../mediaconvert/service_endpoints_gen_test.go | 7 ++++--- .../medialive/service_endpoints_gen_test.go | 7 ++++--- .../mediapackage/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../mediastore/service_endpoints_gen_test.go | 7 ++++--- .../memorydb/service_endpoints_gen_test.go | 7 ++++--- .../service/mq/service_endpoints_gen_test.go | 7 ++++--- .../neptune/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service/oam/service_endpoints_gen_test.go | 7 ++++--- .../opensearch/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../opsworks/service_endpoints_gen_test.go | 7 ++++--- .../organizations/service_endpoints_gen_test.go | 7 ++++--- .../service/osis/service_endpoints_gen_test.go | 7 ++++--- .../outposts/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../pinpoint/service_endpoints_gen_test.go | 7 ++++--- .../service/pipes/service_endpoints_gen_test.go | 7 ++++--- .../service/polly/service_endpoints_gen_test.go | 7 ++++--- .../pricing/service_endpoints_gen_test.go | 7 ++++--- .../qbusiness/service_endpoints_gen_test.go | 7 ++++--- .../service/qldb/service_endpoints_gen_test.go | 7 ++++--- .../quicksight/service_endpoints_gen_test.go | 7 ++++--- .../service/ram/service_endpoints_gen_test.go | 7 ++++--- .../service/rbin/service_endpoints_gen_test.go | 7 ++++--- .../service/rds/service_endpoints_gen_test.go | 9 +++++---- .../redshift/service_endpoints_gen_test.go | 9 +++++---- .../redshiftdata/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 9 +++++---- .../rekognition/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../rolesanywhere/service_endpoints_gen_test.go | 7 ++++--- .../route53/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service/rum/service_endpoints_gen_test.go | 7 ++++--- .../service/s3/service_endpoints_gen_test.go | 7 ++++--- .../s3outposts/service_endpoints_gen_test.go | 7 ++++--- .../sagemaker/service_endpoints_gen_test.go | 7 ++++--- .../scheduler/service_endpoints_gen_test.go | 7 ++++--- .../schemas/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../securityhub/service_endpoints_gen_test.go | 7 ++++--- .../securitylake/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../servicequotas/service_endpoints_gen_test.go | 7 ++++--- .../service/ses/service_endpoints_gen_test.go | 7 ++++--- .../service/sesv2/service_endpoints_gen_test.go | 7 ++++--- .../service/sfn/service_endpoints_gen_test.go | 7 ++++--- .../shield/service_endpoints_gen_test.go | 7 ++++--- .../signer/service_endpoints_gen_test.go | 7 ++++--- .../simpledb/service_endpoints_gen_test.go | 7 ++++--- .../service/sns/service_endpoints_gen_test.go | 7 ++++--- .../service/sqs/service_endpoints_gen_test.go | 7 ++++--- .../service/ssm/service_endpoints_gen_test.go | 7 ++++--- .../ssmcontacts/service_endpoints_gen_test.go | 7 ++++--- .../ssmincidents/service_endpoints_gen_test.go | 7 ++++--- .../ssmsap/service_endpoints_gen_test.go | 7 ++++--- .../service/sso/service_endpoints_gen_test.go | 7 ++++--- .../ssoadmin/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../service/sts/service_endpoints_gen_test.go | 7 ++++--- .../service/swf/service_endpoints_gen_test.go | 7 ++++--- .../synthetics/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../transcribe/service_endpoints_gen_test.go | 7 ++++--- .../transfer/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../vpclattice/service_endpoints_gen_test.go | 7 ++++--- .../service/waf/service_endpoints_gen_test.go | 7 ++++--- .../wafregional/service_endpoints_gen_test.go | 7 ++++--- .../service/wafv2/service_endpoints_gen_test.go | 7 ++++--- .../service_endpoints_gen_test.go | 7 ++++--- .../worklink/service_endpoints_gen_test.go | 7 ++++--- .../workspaces/service_endpoints_gen_test.go | 7 ++++--- .../workspacesweb/service_endpoints_gen_test.go | 7 ++++--- .../service/xray/service_endpoints_gen_test.go | 7 ++++--- 230 files changed, 938 insertions(+), 699 deletions(-) diff --git a/internal/generate/serviceendpointtests/file.gtpl b/internal/generate/serviceendpointtests/file.gtpl index 86b69d09145..083e96e88ff 100644 --- a/internal/generate/serviceendpointtests/file.gtpl +++ b/internal/generate/serviceendpointtests/file.gtpl @@ -115,12 +115,19 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "{{ .Region }}" //lintignore:AWSAT003 + const providerRegion = "{{ .Region }}" //lintignore:AWSAT003 + {{ if .OverrideRegionRegionalEndpoint -}} + // {{ .HumanFriendly }} has a single regional endpoint + // However, the AWS SDK's endpoint resolution returns one for whatever region you're using + const expectedEndpointRegion = "{{ .OverrideRegion }}" //lintignore:AWSAT003 + {{ else -}} + const expectedEndpointRegion = providerRegion + {{ end }} testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -479,7 +486,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -489,7 +496,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) @@ -498,7 +505,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } {{ end -}} diff --git a/internal/generate/serviceendpointtests/main.go b/internal/generate/serviceendpointtests/main.go index ecd05ad05be..c390cd3469b 100644 --- a/internal/generate/serviceendpointtests/main.go +++ b/internal/generate/serviceendpointtests/main.go @@ -56,6 +56,7 @@ func main() { g.Infof("Generating internal/service/%s/%s", packageName, filename) td := TemplateData{ + HumanFriendly: l.HumanFriendly(), PackageName: packageName, ProviderNameUpper: l.ProviderNameUpper(), Region: "us-west-2", @@ -113,6 +114,7 @@ func main() { } type TemplateData struct { + HumanFriendly string PackageName string GoV1Package string GoV2Package string @@ -129,6 +131,8 @@ type TemplateData struct { Aliases []string ImportAwsTypes bool OverrideRegion string + // The provider switches to the required region, but the service has a regional endpoint + OverrideRegionRegionalEndpoint bool } //go:embed file.gtpl diff --git a/internal/service/accessanalyzer/service_endpoints_gen_test.go b/internal/service/accessanalyzer/service_endpoints_gen_test.go index 8c8ec59494e..8f85b0c381b 100644 --- a/internal/service/accessanalyzer/service_endpoints_gen_test.go +++ b/internal/service/accessanalyzer/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/account/service_endpoints_gen_test.go b/internal/service/account/service_endpoints_gen_test.go index 4b58dc9af87..ef02a21aa2c 100644 --- a/internal/service/account/service_endpoints_gen_test.go +++ b/internal/service/account/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/acm/service_endpoints_gen_test.go b/internal/service/acm/service_endpoints_gen_test.go index 3300b5e1f96..d13416cb5c7 100644 --- a/internal/service/acm/service_endpoints_gen_test.go +++ b/internal/service/acm/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/acmpca/service_endpoints_gen_test.go b/internal/service/acmpca/service_endpoints_gen_test.go index 1508661beb4..2904250b49c 100644 --- a/internal/service/acmpca/service_endpoints_gen_test.go +++ b/internal/service/acmpca/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/amp/service_endpoints_gen_test.go b/internal/service/amp/service_endpoints_gen_test.go index 01247411638..73316c17f9d 100644 --- a/internal/service/amp/service_endpoints_gen_test.go +++ b/internal/service/amp/service_endpoints_gen_test.go @@ -83,12 +83,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -344,7 +345,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/amplify/service_endpoints_gen_test.go b/internal/service/amplify/service_endpoints_gen_test.go index c6bf2586810..6aadc3ac42e 100644 --- a/internal/service/amplify/service_endpoints_gen_test.go +++ b/internal/service/amplify/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/apigateway/service_endpoints_gen_test.go b/internal/service/apigateway/service_endpoints_gen_test.go index 70bb3bd9795..9ba12b07283 100644 --- a/internal/service/apigateway/service_endpoints_gen_test.go +++ b/internal/service/apigateway/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/apigatewayv2/service_endpoints_gen_test.go b/internal/service/apigatewayv2/service_endpoints_gen_test.go index 38572114848..b70d9b68959 100644 --- a/internal/service/apigatewayv2/service_endpoints_gen_test.go +++ b/internal/service/apigatewayv2/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/appautoscaling/service_endpoints_gen_test.go b/internal/service/appautoscaling/service_endpoints_gen_test.go index a4542247ebe..b8db52ea220 100644 --- a/internal/service/appautoscaling/service_endpoints_gen_test.go +++ b/internal/service/appautoscaling/service_endpoints_gen_test.go @@ -82,12 +82,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -286,7 +287,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/appconfig/service_endpoints_gen_test.go b/internal/service/appconfig/service_endpoints_gen_test.go index 9706e603a14..c010c2a47cf 100644 --- a/internal/service/appconfig/service_endpoints_gen_test.go +++ b/internal/service/appconfig/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/appfabric/service_endpoints_gen_test.go b/internal/service/appfabric/service_endpoints_gen_test.go index 7c5a57b9719..fce8d8d2c6a 100644 --- a/internal/service/appfabric/service_endpoints_gen_test.go +++ b/internal/service/appfabric/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/appflow/service_endpoints_gen_test.go b/internal/service/appflow/service_endpoints_gen_test.go index d20ba352b9a..820e589773e 100644 --- a/internal/service/appflow/service_endpoints_gen_test.go +++ b/internal/service/appflow/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/appintegrations/service_endpoints_gen_test.go b/internal/service/appintegrations/service_endpoints_gen_test.go index 785cd68b300..8619b126cf2 100644 --- a/internal/service/appintegrations/service_endpoints_gen_test.go +++ b/internal/service/appintegrations/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/applicationinsights/service_endpoints_gen_test.go b/internal/service/applicationinsights/service_endpoints_gen_test.go index 6c228f1aec6..bacdbf78fe1 100644 --- a/internal/service/applicationinsights/service_endpoints_gen_test.go +++ b/internal/service/applicationinsights/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/appmesh/service_endpoints_gen_test.go b/internal/service/appmesh/service_endpoints_gen_test.go index 078bf7ffdfa..e7bbc44dd35 100644 --- a/internal/service/appmesh/service_endpoints_gen_test.go +++ b/internal/service/appmesh/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/apprunner/service_endpoints_gen_test.go b/internal/service/apprunner/service_endpoints_gen_test.go index e79c046d92e..eb5ca81a486 100644 --- a/internal/service/apprunner/service_endpoints_gen_test.go +++ b/internal/service/apprunner/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/appstream/service_endpoints_gen_test.go b/internal/service/appstream/service_endpoints_gen_test.go index 4e2a9ee571b..a6368b15f9b 100644 --- a/internal/service/appstream/service_endpoints_gen_test.go +++ b/internal/service/appstream/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/appsync/service_endpoints_gen_test.go b/internal/service/appsync/service_endpoints_gen_test.go index 1bd556b0708..f5c4f89895a 100644 --- a/internal/service/appsync/service_endpoints_gen_test.go +++ b/internal/service/appsync/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/athena/service_endpoints_gen_test.go b/internal/service/athena/service_endpoints_gen_test.go index ddbf0f4da18..009cc226324 100644 --- a/internal/service/athena/service_endpoints_gen_test.go +++ b/internal/service/athena/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/auditmanager/service_endpoints_gen_test.go b/internal/service/auditmanager/service_endpoints_gen_test.go index 1ceaf5875d9..08f11701d1f 100644 --- a/internal/service/auditmanager/service_endpoints_gen_test.go +++ b/internal/service/auditmanager/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/autoscaling/service_endpoints_gen_test.go b/internal/service/autoscaling/service_endpoints_gen_test.go index 631a08cfd15..19eb1293eca 100644 --- a/internal/service/autoscaling/service_endpoints_gen_test.go +++ b/internal/service/autoscaling/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/autoscalingplans/service_endpoints_gen_test.go b/internal/service/autoscalingplans/service_endpoints_gen_test.go index c03a6ecba7b..f6e3e512475 100644 --- a/internal/service/autoscalingplans/service_endpoints_gen_test.go +++ b/internal/service/autoscalingplans/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/backup/service_endpoints_gen_test.go b/internal/service/backup/service_endpoints_gen_test.go index 974182b7a5a..c46faacfdca 100644 --- a/internal/service/backup/service_endpoints_gen_test.go +++ b/internal/service/backup/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/batch/service_endpoints_gen_test.go b/internal/service/batch/service_endpoints_gen_test.go index 8f1c622d84c..15b211cfeb5 100644 --- a/internal/service/batch/service_endpoints_gen_test.go +++ b/internal/service/batch/service_endpoints_gen_test.go @@ -79,12 +79,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -235,7 +236,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -245,7 +246,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) diff --git a/internal/service/bcmdataexports/service_endpoints_gen_test.go b/internal/service/bcmdataexports/service_endpoints_gen_test.go index 82830d3586e..7f4e2eaae1f 100644 --- a/internal/service/bcmdataexports/service_endpoints_gen_test.go +++ b/internal/service/bcmdataexports/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/bedrock/service_endpoints_gen_test.go b/internal/service/bedrock/service_endpoints_gen_test.go index 1f0eef21aec..13b86ef0251 100644 --- a/internal/service/bedrock/service_endpoints_gen_test.go +++ b/internal/service/bedrock/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/bedrockagent/service_endpoints_gen_test.go b/internal/service/bedrockagent/service_endpoints_gen_test.go index 2f9fd0c7818..a610a85fc87 100644 --- a/internal/service/bedrockagent/service_endpoints_gen_test.go +++ b/internal/service/bedrockagent/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/budgets/service_endpoints_gen_test.go b/internal/service/budgets/service_endpoints_gen_test.go index f4c59600b30..b1e9da08b96 100644 --- a/internal/service/budgets/service_endpoints_gen_test.go +++ b/internal/service/budgets/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ce/service_endpoints_gen_test.go b/internal/service/ce/service_endpoints_gen_test.go index 7b6a828e079..dcc0264f659 100644 --- a/internal/service/ce/service_endpoints_gen_test.go +++ b/internal/service/ce/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/chatbot/service_endpoints_gen_test.go b/internal/service/chatbot/service_endpoints_gen_test.go index 2b040cd1b01..5aa395536a6 100644 --- a/internal/service/chatbot/service_endpoints_gen_test.go +++ b/internal/service/chatbot/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/chime/service_endpoints_gen_test.go b/internal/service/chime/service_endpoints_gen_test.go index 5270248fee4..88330c604bc 100644 --- a/internal/service/chime/service_endpoints_gen_test.go +++ b/internal/service/chime/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go index 0e5fde79ac2..6d99d21a184 100644 --- a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go +++ b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/chimesdkvoice/service_endpoints_gen_test.go b/internal/service/chimesdkvoice/service_endpoints_gen_test.go index f4a8c9ea85e..4273629de8d 100644 --- a/internal/service/chimesdkvoice/service_endpoints_gen_test.go +++ b/internal/service/chimesdkvoice/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cleanrooms/service_endpoints_gen_test.go b/internal/service/cleanrooms/service_endpoints_gen_test.go index e46e28e1de1..9a2781aaaf1 100644 --- a/internal/service/cleanrooms/service_endpoints_gen_test.go +++ b/internal/service/cleanrooms/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cloud9/service_endpoints_gen_test.go b/internal/service/cloud9/service_endpoints_gen_test.go index 61eafc8591e..65a76ce34e4 100644 --- a/internal/service/cloud9/service_endpoints_gen_test.go +++ b/internal/service/cloud9/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cloudcontrol/service_endpoints_gen_test.go b/internal/service/cloudcontrol/service_endpoints_gen_test.go index 55342dbfa6a..1976cb6497d 100644 --- a/internal/service/cloudcontrol/service_endpoints_gen_test.go +++ b/internal/service/cloudcontrol/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cloudformation/service_endpoints_gen_test.go b/internal/service/cloudformation/service_endpoints_gen_test.go index 3ff29ed9a61..b72600bf306 100644 --- a/internal/service/cloudformation/service_endpoints_gen_test.go +++ b/internal/service/cloudformation/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cloudfront/service_endpoints_gen_test.go b/internal/service/cloudfront/service_endpoints_gen_test.go index 666d510ca53..053968c30a7 100644 --- a/internal/service/cloudfront/service_endpoints_gen_test.go +++ b/internal/service/cloudfront/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cloudhsmv2/service_endpoints_gen_test.go b/internal/service/cloudhsmv2/service_endpoints_gen_test.go index 4e30e1aeb39..8ad170ec3ba 100644 --- a/internal/service/cloudhsmv2/service_endpoints_gen_test.go +++ b/internal/service/cloudhsmv2/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cloudsearch/service_endpoints_gen_test.go b/internal/service/cloudsearch/service_endpoints_gen_test.go index 4d365c3fcb8..d3894ce5dcb 100644 --- a/internal/service/cloudsearch/service_endpoints_gen_test.go +++ b/internal/service/cloudsearch/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cloudtrail/service_endpoints_gen_test.go b/internal/service/cloudtrail/service_endpoints_gen_test.go index 5ca967a3ddf..4c0bc780da1 100644 --- a/internal/service/cloudtrail/service_endpoints_gen_test.go +++ b/internal/service/cloudtrail/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cloudwatch/service_endpoints_gen_test.go b/internal/service/cloudwatch/service_endpoints_gen_test.go index 7779a37138d..54ea0ef08c3 100644 --- a/internal/service/cloudwatch/service_endpoints_gen_test.go +++ b/internal/service/cloudwatch/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/codeartifact/service_endpoints_gen_test.go b/internal/service/codeartifact/service_endpoints_gen_test.go index 030ad35b04a..cb61b10006d 100644 --- a/internal/service/codeartifact/service_endpoints_gen_test.go +++ b/internal/service/codeartifact/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/codebuild/service_endpoints_gen_test.go b/internal/service/codebuild/service_endpoints_gen_test.go index 1ff044a50d2..8deb044d1a4 100644 --- a/internal/service/codebuild/service_endpoints_gen_test.go +++ b/internal/service/codebuild/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/codecommit/service_endpoints_gen_test.go b/internal/service/codecommit/service_endpoints_gen_test.go index 746d773661f..4691c5afa62 100644 --- a/internal/service/codecommit/service_endpoints_gen_test.go +++ b/internal/service/codecommit/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/codeguruprofiler/service_endpoints_gen_test.go b/internal/service/codeguruprofiler/service_endpoints_gen_test.go index 66e1743b6a7..0de077e820e 100644 --- a/internal/service/codeguruprofiler/service_endpoints_gen_test.go +++ b/internal/service/codeguruprofiler/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/codegurureviewer/service_endpoints_gen_test.go b/internal/service/codegurureviewer/service_endpoints_gen_test.go index 7462cac8a9b..0963444088a 100644 --- a/internal/service/codegurureviewer/service_endpoints_gen_test.go +++ b/internal/service/codegurureviewer/service_endpoints_gen_test.go @@ -77,12 +77,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -232,7 +233,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/codepipeline/service_endpoints_gen_test.go b/internal/service/codepipeline/service_endpoints_gen_test.go index 931b203939b..c2d71821ae2 100644 --- a/internal/service/codepipeline/service_endpoints_gen_test.go +++ b/internal/service/codepipeline/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/codestarconnections/service_endpoints_gen_test.go b/internal/service/codestarconnections/service_endpoints_gen_test.go index 2a502bad65a..e6aaaa15761 100644 --- a/internal/service/codestarconnections/service_endpoints_gen_test.go +++ b/internal/service/codestarconnections/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/codestarnotifications/service_endpoints_gen_test.go b/internal/service/codestarnotifications/service_endpoints_gen_test.go index d5f24eff6ce..8813fefbf5c 100644 --- a/internal/service/codestarnotifications/service_endpoints_gen_test.go +++ b/internal/service/codestarnotifications/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cognitoidentity/service_endpoints_gen_test.go b/internal/service/cognitoidentity/service_endpoints_gen_test.go index 36916b5f4fb..a82fafe7efc 100644 --- a/internal/service/cognitoidentity/service_endpoints_gen_test.go +++ b/internal/service/cognitoidentity/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cognitoidp/service_endpoints_gen_test.go b/internal/service/cognitoidp/service_endpoints_gen_test.go index 7d05e2a1379..fe3220f8594 100644 --- a/internal/service/cognitoidp/service_endpoints_gen_test.go +++ b/internal/service/cognitoidp/service_endpoints_gen_test.go @@ -78,12 +78,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -282,7 +283,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/comprehend/service_endpoints_gen_test.go b/internal/service/comprehend/service_endpoints_gen_test.go index 74cc3e4b142..57e9b69e6a3 100644 --- a/internal/service/comprehend/service_endpoints_gen_test.go +++ b/internal/service/comprehend/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/computeoptimizer/service_endpoints_gen_test.go b/internal/service/computeoptimizer/service_endpoints_gen_test.go index 2d2dfecdde5..2402dc91f5d 100644 --- a/internal/service/computeoptimizer/service_endpoints_gen_test.go +++ b/internal/service/computeoptimizer/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/configservice/service_endpoints_gen_test.go b/internal/service/configservice/service_endpoints_gen_test.go index acbf517861c..b68e3bc36ef 100644 --- a/internal/service/configservice/service_endpoints_gen_test.go +++ b/internal/service/configservice/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/connect/service_endpoints_gen_test.go b/internal/service/connect/service_endpoints_gen_test.go index 319dbe0b0a5..e3aa1e34440 100644 --- a/internal/service/connect/service_endpoints_gen_test.go +++ b/internal/service/connect/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/connectcases/service_endpoints_gen_test.go b/internal/service/connectcases/service_endpoints_gen_test.go index 20ac881de8f..d7ceb380c6f 100644 --- a/internal/service/connectcases/service_endpoints_gen_test.go +++ b/internal/service/connectcases/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/controltower/service_endpoints_gen_test.go b/internal/service/controltower/service_endpoints_gen_test.go index 887db59d21b..b4d9f54384e 100644 --- a/internal/service/controltower/service_endpoints_gen_test.go +++ b/internal/service/controltower/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/costoptimizationhub/service_endpoints_gen_test.go b/internal/service/costoptimizationhub/service_endpoints_gen_test.go index 58f77598e63..893acc78f54 100644 --- a/internal/service/costoptimizationhub/service_endpoints_gen_test.go +++ b/internal/service/costoptimizationhub/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/cur/service_endpoints_gen_test.go b/internal/service/cur/service_endpoints_gen_test.go index 42794f22fb5..9f6152fb960 100644 --- a/internal/service/cur/service_endpoints_gen_test.go +++ b/internal/service/cur/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/customerprofiles/service_endpoints_gen_test.go b/internal/service/customerprofiles/service_endpoints_gen_test.go index 00cf76f4fbb..7e8d98ac44b 100644 --- a/internal/service/customerprofiles/service_endpoints_gen_test.go +++ b/internal/service/customerprofiles/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/dataexchange/service_endpoints_gen_test.go b/internal/service/dataexchange/service_endpoints_gen_test.go index 5fbf574df28..87e33c10b71 100644 --- a/internal/service/dataexchange/service_endpoints_gen_test.go +++ b/internal/service/dataexchange/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/datapipeline/service_endpoints_gen_test.go b/internal/service/datapipeline/service_endpoints_gen_test.go index 99360e65610..fa92028fa06 100644 --- a/internal/service/datapipeline/service_endpoints_gen_test.go +++ b/internal/service/datapipeline/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/datasync/service_endpoints_gen_test.go b/internal/service/datasync/service_endpoints_gen_test.go index 5a0d1be8a69..f9a25f123b8 100644 --- a/internal/service/datasync/service_endpoints_gen_test.go +++ b/internal/service/datasync/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/datazone/service_endpoints_gen_test.go b/internal/service/datazone/service_endpoints_gen_test.go index 0c27fa60bfb..fd5102c7f38 100644 --- a/internal/service/datazone/service_endpoints_gen_test.go +++ b/internal/service/datazone/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/dax/service_endpoints_gen_test.go b/internal/service/dax/service_endpoints_gen_test.go index 4ebf81ec360..da54384f371 100644 --- a/internal/service/dax/service_endpoints_gen_test.go +++ b/internal/service/dax/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/deploy/service_endpoints_gen_test.go b/internal/service/deploy/service_endpoints_gen_test.go index ffde79175a9..5638512178c 100644 --- a/internal/service/deploy/service_endpoints_gen_test.go +++ b/internal/service/deploy/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/detective/service_endpoints_gen_test.go b/internal/service/detective/service_endpoints_gen_test.go index d3fab2a1970..b577eed713f 100644 --- a/internal/service/detective/service_endpoints_gen_test.go +++ b/internal/service/detective/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/devicefarm/service_endpoints_gen_test.go b/internal/service/devicefarm/service_endpoints_gen_test.go index 4ca9a542a21..c70899c3125 100644 --- a/internal/service/devicefarm/service_endpoints_gen_test.go +++ b/internal/service/devicefarm/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/devopsguru/service_endpoints_gen_test.go b/internal/service/devopsguru/service_endpoints_gen_test.go index 75a5386525b..b1c84fab8ed 100644 --- a/internal/service/devopsguru/service_endpoints_gen_test.go +++ b/internal/service/devopsguru/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/directconnect/service_endpoints_gen_test.go b/internal/service/directconnect/service_endpoints_gen_test.go index 02d030df858..4bc9990928a 100644 --- a/internal/service/directconnect/service_endpoints_gen_test.go +++ b/internal/service/directconnect/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/dlm/service_endpoints_gen_test.go b/internal/service/dlm/service_endpoints_gen_test.go index 9c4a67dc1a8..f1bc623d56f 100644 --- a/internal/service/dlm/service_endpoints_gen_test.go +++ b/internal/service/dlm/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/dms/service_endpoints_gen_test.go b/internal/service/dms/service_endpoints_gen_test.go index 48378eea354..7150273745c 100644 --- a/internal/service/dms/service_endpoints_gen_test.go +++ b/internal/service/dms/service_endpoints_gen_test.go @@ -80,12 +80,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -341,7 +342,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/docdb/service_endpoints_gen_test.go b/internal/service/docdb/service_endpoints_gen_test.go index fe4d13e6ce0..b1086cb4f25 100644 --- a/internal/service/docdb/service_endpoints_gen_test.go +++ b/internal/service/docdb/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/docdbelastic/service_endpoints_gen_test.go b/internal/service/docdbelastic/service_endpoints_gen_test.go index 1ba28141d85..b3b0898a8bf 100644 --- a/internal/service/docdbelastic/service_endpoints_gen_test.go +++ b/internal/service/docdbelastic/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/drs/service_endpoints_gen_test.go b/internal/service/drs/service_endpoints_gen_test.go index df6fb584e22..652a1c8007d 100644 --- a/internal/service/drs/service_endpoints_gen_test.go +++ b/internal/service/drs/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ds/service_endpoints_gen_test.go b/internal/service/ds/service_endpoints_gen_test.go index 415c15977ea..a5397c18574 100644 --- a/internal/service/ds/service_endpoints_gen_test.go +++ b/internal/service/ds/service_endpoints_gen_test.go @@ -84,12 +84,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -289,7 +290,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -299,7 +300,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) diff --git a/internal/service/dynamodb/service_endpoints_gen_test.go b/internal/service/dynamodb/service_endpoints_gen_test.go index ccafdd4aabe..d048bad912e 100644 --- a/internal/service/dynamodb/service_endpoints_gen_test.go +++ b/internal/service/dynamodb/service_endpoints_gen_test.go @@ -80,12 +80,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -341,7 +342,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ec2/service_endpoints_gen_test.go b/internal/service/ec2/service_endpoints_gen_test.go index 1464a94d5e9..9fd673f9b51 100644 --- a/internal/service/ec2/service_endpoints_gen_test.go +++ b/internal/service/ec2/service_endpoints_gen_test.go @@ -79,12 +79,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -235,7 +236,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -245,7 +246,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) diff --git a/internal/service/ecr/service_endpoints_gen_test.go b/internal/service/ecr/service_endpoints_gen_test.go index eefc215a796..c87ad1be4d5 100644 --- a/internal/service/ecr/service_endpoints_gen_test.go +++ b/internal/service/ecr/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ecrpublic/service_endpoints_gen_test.go b/internal/service/ecrpublic/service_endpoints_gen_test.go index ca3b6bbf884..276f055ca8f 100644 --- a/internal/service/ecrpublic/service_endpoints_gen_test.go +++ b/internal/service/ecrpublic/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ecs/service_endpoints_gen_test.go b/internal/service/ecs/service_endpoints_gen_test.go index 18fc6939416..707fd2a9a7c 100644 --- a/internal/service/ecs/service_endpoints_gen_test.go +++ b/internal/service/ecs/service_endpoints_gen_test.go @@ -79,12 +79,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -235,7 +236,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -245,7 +246,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) diff --git a/internal/service/efs/service_endpoints_gen_test.go b/internal/service/efs/service_endpoints_gen_test.go index 14096e6da0d..07909ce9643 100644 --- a/internal/service/efs/service_endpoints_gen_test.go +++ b/internal/service/efs/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/eks/service_endpoints_gen_test.go b/internal/service/eks/service_endpoints_gen_test.go index b061fcb338a..2a9cbb4a202 100644 --- a/internal/service/eks/service_endpoints_gen_test.go +++ b/internal/service/eks/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/elasticache/service_endpoints_gen_test.go b/internal/service/elasticache/service_endpoints_gen_test.go index d3d662a63a0..463965f5353 100644 --- a/internal/service/elasticache/service_endpoints_gen_test.go +++ b/internal/service/elasticache/service_endpoints_gen_test.go @@ -79,12 +79,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -235,7 +236,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -245,7 +246,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) diff --git a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go index 7f27e36d421..8209ad02b3e 100644 --- a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go +++ b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/elasticsearch/service_endpoints_gen_test.go b/internal/service/elasticsearch/service_endpoints_gen_test.go index 110c1799671..aa5bd68d8cc 100644 --- a/internal/service/elasticsearch/service_endpoints_gen_test.go +++ b/internal/service/elasticsearch/service_endpoints_gen_test.go @@ -80,12 +80,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -341,7 +342,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/elastictranscoder/service_endpoints_gen_test.go b/internal/service/elastictranscoder/service_endpoints_gen_test.go index 2dd10b4e76f..0b3d88492fb 100644 --- a/internal/service/elastictranscoder/service_endpoints_gen_test.go +++ b/internal/service/elastictranscoder/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/elb/service_endpoints_gen_test.go b/internal/service/elb/service_endpoints_gen_test.go index 8f9c884fb13..f9164c8e0f5 100644 --- a/internal/service/elb/service_endpoints_gen_test.go +++ b/internal/service/elb/service_endpoints_gen_test.go @@ -78,12 +78,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -282,7 +283,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/elbv2/service_endpoints_gen_test.go b/internal/service/elbv2/service_endpoints_gen_test.go index 2e368b6fb20..59ccb82951a 100644 --- a/internal/service/elbv2/service_endpoints_gen_test.go +++ b/internal/service/elbv2/service_endpoints_gen_test.go @@ -84,12 +84,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -289,7 +290,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -299,7 +300,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) diff --git a/internal/service/emr/service_endpoints_gen_test.go b/internal/service/emr/service_endpoints_gen_test.go index 1db885ff332..f6dd828838f 100644 --- a/internal/service/emr/service_endpoints_gen_test.go +++ b/internal/service/emr/service_endpoints_gen_test.go @@ -79,12 +79,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -235,7 +236,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -245,7 +246,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) diff --git a/internal/service/emrcontainers/service_endpoints_gen_test.go b/internal/service/emrcontainers/service_endpoints_gen_test.go index dbb71f124ce..feeeccc75ae 100644 --- a/internal/service/emrcontainers/service_endpoints_gen_test.go +++ b/internal/service/emrcontainers/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/emrserverless/service_endpoints_gen_test.go b/internal/service/emrserverless/service_endpoints_gen_test.go index d97f3211586..d832012c1bf 100644 --- a/internal/service/emrserverless/service_endpoints_gen_test.go +++ b/internal/service/emrserverless/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/events/service_endpoints_gen_test.go b/internal/service/events/service_endpoints_gen_test.go index e85545ff586..e37660b9399 100644 --- a/internal/service/events/service_endpoints_gen_test.go +++ b/internal/service/events/service_endpoints_gen_test.go @@ -83,12 +83,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -344,7 +345,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/evidently/service_endpoints_gen_test.go b/internal/service/evidently/service_endpoints_gen_test.go index 9bd77888a78..cebb234f75d 100644 --- a/internal/service/evidently/service_endpoints_gen_test.go +++ b/internal/service/evidently/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/finspace/service_endpoints_gen_test.go b/internal/service/finspace/service_endpoints_gen_test.go index 38fdd1194cd..bb8b61cb1ff 100644 --- a/internal/service/finspace/service_endpoints_gen_test.go +++ b/internal/service/finspace/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/firehose/service_endpoints_gen_test.go b/internal/service/firehose/service_endpoints_gen_test.go index 8ab88f10ce5..0405fd79b85 100644 --- a/internal/service/firehose/service_endpoints_gen_test.go +++ b/internal/service/firehose/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/fis/service_endpoints_gen_test.go b/internal/service/fis/service_endpoints_gen_test.go index 72e7cc562df..6eb475b0e9f 100644 --- a/internal/service/fis/service_endpoints_gen_test.go +++ b/internal/service/fis/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/fms/service_endpoints_gen_test.go b/internal/service/fms/service_endpoints_gen_test.go index 7c1a3ff2b5d..f70d66b3664 100644 --- a/internal/service/fms/service_endpoints_gen_test.go +++ b/internal/service/fms/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/fsx/service_endpoints_gen_test.go b/internal/service/fsx/service_endpoints_gen_test.go index 1f4c52b1332..9061bd73374 100644 --- a/internal/service/fsx/service_endpoints_gen_test.go +++ b/internal/service/fsx/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/gamelift/service_endpoints_gen_test.go b/internal/service/gamelift/service_endpoints_gen_test.go index 7ad81367297..7aef9521ffe 100644 --- a/internal/service/gamelift/service_endpoints_gen_test.go +++ b/internal/service/gamelift/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/glacier/service_endpoints_gen_test.go b/internal/service/glacier/service_endpoints_gen_test.go index b48a5e43dc0..d79db986a0b 100644 --- a/internal/service/glacier/service_endpoints_gen_test.go +++ b/internal/service/glacier/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/globalaccelerator/service_endpoints_gen_test.go b/internal/service/globalaccelerator/service_endpoints_gen_test.go index bf007c35cf2..786265dcee5 100644 --- a/internal/service/globalaccelerator/service_endpoints_gen_test.go +++ b/internal/service/globalaccelerator/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/glue/service_endpoints_gen_test.go b/internal/service/glue/service_endpoints_gen_test.go index 512d474e2b5..4356c470f73 100644 --- a/internal/service/glue/service_endpoints_gen_test.go +++ b/internal/service/glue/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/grafana/service_endpoints_gen_test.go b/internal/service/grafana/service_endpoints_gen_test.go index d6a26260d9d..f8ac5445538 100644 --- a/internal/service/grafana/service_endpoints_gen_test.go +++ b/internal/service/grafana/service_endpoints_gen_test.go @@ -80,12 +80,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -341,7 +342,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/greengrass/service_endpoints_gen_test.go b/internal/service/greengrass/service_endpoints_gen_test.go index 1687151cc06..50744c22479 100644 --- a/internal/service/greengrass/service_endpoints_gen_test.go +++ b/internal/service/greengrass/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/groundstation/service_endpoints_gen_test.go b/internal/service/groundstation/service_endpoints_gen_test.go index 9af8d1f5e06..1c412c1088d 100644 --- a/internal/service/groundstation/service_endpoints_gen_test.go +++ b/internal/service/groundstation/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/guardduty/service_endpoints_gen_test.go b/internal/service/guardduty/service_endpoints_gen_test.go index 45419dcbf9f..2fbdf000f0f 100644 --- a/internal/service/guardduty/service_endpoints_gen_test.go +++ b/internal/service/guardduty/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/healthlake/service_endpoints_gen_test.go b/internal/service/healthlake/service_endpoints_gen_test.go index 527c7ce3db7..141cf631d61 100644 --- a/internal/service/healthlake/service_endpoints_gen_test.go +++ b/internal/service/healthlake/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/iam/service_endpoints_gen_test.go b/internal/service/iam/service_endpoints_gen_test.go index 86973dcab56..2384fbd8971 100644 --- a/internal/service/iam/service_endpoints_gen_test.go +++ b/internal/service/iam/service_endpoints_gen_test.go @@ -80,12 +80,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -341,7 +342,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/identitystore/service_endpoints_gen_test.go b/internal/service/identitystore/service_endpoints_gen_test.go index 68059c14168..e8479602ca9 100644 --- a/internal/service/identitystore/service_endpoints_gen_test.go +++ b/internal/service/identitystore/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/imagebuilder/service_endpoints_gen_test.go b/internal/service/imagebuilder/service_endpoints_gen_test.go index 654598b7e75..5b2f1512e20 100644 --- a/internal/service/imagebuilder/service_endpoints_gen_test.go +++ b/internal/service/imagebuilder/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/inspector/service_endpoints_gen_test.go b/internal/service/inspector/service_endpoints_gen_test.go index e333640cd72..053bd8653ab 100644 --- a/internal/service/inspector/service_endpoints_gen_test.go +++ b/internal/service/inspector/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/inspector2/service_endpoints_gen_test.go b/internal/service/inspector2/service_endpoints_gen_test.go index de9e1513140..86c46123946 100644 --- a/internal/service/inspector2/service_endpoints_gen_test.go +++ b/internal/service/inspector2/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/internetmonitor/service_endpoints_gen_test.go b/internal/service/internetmonitor/service_endpoints_gen_test.go index 1f317645caa..e20284d4bf2 100644 --- a/internal/service/internetmonitor/service_endpoints_gen_test.go +++ b/internal/service/internetmonitor/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/iot/service_endpoints_gen_test.go b/internal/service/iot/service_endpoints_gen_test.go index 8fffbf002c2..265141f7fd5 100644 --- a/internal/service/iot/service_endpoints_gen_test.go +++ b/internal/service/iot/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/iotanalytics/service_endpoints_gen_test.go b/internal/service/iotanalytics/service_endpoints_gen_test.go index 51dae5933c7..76d3f7040b0 100644 --- a/internal/service/iotanalytics/service_endpoints_gen_test.go +++ b/internal/service/iotanalytics/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/iotevents/service_endpoints_gen_test.go b/internal/service/iotevents/service_endpoints_gen_test.go index ac8772046ee..a5c6790c829 100644 --- a/internal/service/iotevents/service_endpoints_gen_test.go +++ b/internal/service/iotevents/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ivs/service_endpoints_gen_test.go b/internal/service/ivs/service_endpoints_gen_test.go index cd57a711bcb..9655c8f08da 100644 --- a/internal/service/ivs/service_endpoints_gen_test.go +++ b/internal/service/ivs/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ivschat/service_endpoints_gen_test.go b/internal/service/ivschat/service_endpoints_gen_test.go index 204c0452ec9..cb67ac3095a 100644 --- a/internal/service/ivschat/service_endpoints_gen_test.go +++ b/internal/service/ivschat/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/kafka/service_endpoints_gen_test.go b/internal/service/kafka/service_endpoints_gen_test.go index e87c511839d..3151243d585 100644 --- a/internal/service/kafka/service_endpoints_gen_test.go +++ b/internal/service/kafka/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/kafkaconnect/service_endpoints_gen_test.go b/internal/service/kafkaconnect/service_endpoints_gen_test.go index 0e16d745ceb..ec22dec5490 100644 --- a/internal/service/kafkaconnect/service_endpoints_gen_test.go +++ b/internal/service/kafkaconnect/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/kendra/service_endpoints_gen_test.go b/internal/service/kendra/service_endpoints_gen_test.go index bfb08816444..d7a0bf19606 100644 --- a/internal/service/kendra/service_endpoints_gen_test.go +++ b/internal/service/kendra/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/keyspaces/service_endpoints_gen_test.go b/internal/service/keyspaces/service_endpoints_gen_test.go index f12ae03c6fc..8a99d34ac11 100644 --- a/internal/service/keyspaces/service_endpoints_gen_test.go +++ b/internal/service/keyspaces/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/kinesis/service_endpoints_gen_test.go b/internal/service/kinesis/service_endpoints_gen_test.go index dd3ca34006b..451736d03b9 100644 --- a/internal/service/kinesis/service_endpoints_gen_test.go +++ b/internal/service/kinesis/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/kinesisanalytics/service_endpoints_gen_test.go b/internal/service/kinesisanalytics/service_endpoints_gen_test.go index edf1dc33a2a..65956ff61c7 100644 --- a/internal/service/kinesisanalytics/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalytics/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go index 387c7ccc131..d550deca391 100644 --- a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/kinesisvideo/service_endpoints_gen_test.go b/internal/service/kinesisvideo/service_endpoints_gen_test.go index b19c1585009..db17c5c5e64 100644 --- a/internal/service/kinesisvideo/service_endpoints_gen_test.go +++ b/internal/service/kinesisvideo/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/kms/service_endpoints_gen_test.go b/internal/service/kms/service_endpoints_gen_test.go index e7efbe194b2..dcc8a9b3c42 100644 --- a/internal/service/kms/service_endpoints_gen_test.go +++ b/internal/service/kms/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/lakeformation/service_endpoints_gen_test.go b/internal/service/lakeformation/service_endpoints_gen_test.go index e08e8d6b08a..2cfee9446a9 100644 --- a/internal/service/lakeformation/service_endpoints_gen_test.go +++ b/internal/service/lakeformation/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/lambda/service_endpoints_gen_test.go b/internal/service/lambda/service_endpoints_gen_test.go index 4c888551ec9..c01dfd25841 100644 --- a/internal/service/lambda/service_endpoints_gen_test.go +++ b/internal/service/lambda/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/launchwizard/service_endpoints_gen_test.go b/internal/service/launchwizard/service_endpoints_gen_test.go index 83da718c7de..b63fa60dc83 100644 --- a/internal/service/launchwizard/service_endpoints_gen_test.go +++ b/internal/service/launchwizard/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/lexmodels/service_endpoints_gen_test.go b/internal/service/lexmodels/service_endpoints_gen_test.go index cfcf77833b9..292dc27b757 100644 --- a/internal/service/lexmodels/service_endpoints_gen_test.go +++ b/internal/service/lexmodels/service_endpoints_gen_test.go @@ -82,12 +82,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -408,7 +409,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/lexv2models/service_endpoints_gen_test.go b/internal/service/lexv2models/service_endpoints_gen_test.go index 120c98549c4..a34ee670692 100644 --- a/internal/service/lexv2models/service_endpoints_gen_test.go +++ b/internal/service/lexv2models/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/licensemanager/service_endpoints_gen_test.go b/internal/service/licensemanager/service_endpoints_gen_test.go index d50c1f5af8b..0faa571e235 100644 --- a/internal/service/licensemanager/service_endpoints_gen_test.go +++ b/internal/service/licensemanager/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/lightsail/service_endpoints_gen_test.go b/internal/service/lightsail/service_endpoints_gen_test.go index 4caad1df614..1fbd146b152 100644 --- a/internal/service/lightsail/service_endpoints_gen_test.go +++ b/internal/service/lightsail/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/location/service_endpoints_gen_test.go b/internal/service/location/service_endpoints_gen_test.go index b610e667ac7..2f217365c21 100644 --- a/internal/service/location/service_endpoints_gen_test.go +++ b/internal/service/location/service_endpoints_gen_test.go @@ -78,12 +78,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -282,7 +283,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/logs/service_endpoints_gen_test.go b/internal/service/logs/service_endpoints_gen_test.go index 1db1798af69..442f6ebc3be 100644 --- a/internal/service/logs/service_endpoints_gen_test.go +++ b/internal/service/logs/service_endpoints_gen_test.go @@ -83,12 +83,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -344,7 +345,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/lookoutmetrics/service_endpoints_gen_test.go b/internal/service/lookoutmetrics/service_endpoints_gen_test.go index d46c1f58976..da910cbf8b3 100644 --- a/internal/service/lookoutmetrics/service_endpoints_gen_test.go +++ b/internal/service/lookoutmetrics/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/m2/service_endpoints_gen_test.go b/internal/service/m2/service_endpoints_gen_test.go index 0f5426277f5..8ec0aad3862 100644 --- a/internal/service/m2/service_endpoints_gen_test.go +++ b/internal/service/m2/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/macie2/service_endpoints_gen_test.go b/internal/service/macie2/service_endpoints_gen_test.go index 03c76cf8854..5a070c96908 100644 --- a/internal/service/macie2/service_endpoints_gen_test.go +++ b/internal/service/macie2/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/mediaconnect/service_endpoints_gen_test.go b/internal/service/mediaconnect/service_endpoints_gen_test.go index 6cb7d55b3ea..e7bc3084c36 100644 --- a/internal/service/mediaconnect/service_endpoints_gen_test.go +++ b/internal/service/mediaconnect/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/mediaconvert/service_endpoints_gen_test.go b/internal/service/mediaconvert/service_endpoints_gen_test.go index 37d50011580..364f62b855b 100644 --- a/internal/service/mediaconvert/service_endpoints_gen_test.go +++ b/internal/service/mediaconvert/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/medialive/service_endpoints_gen_test.go b/internal/service/medialive/service_endpoints_gen_test.go index 880a46cd65b..6ef17b824e4 100644 --- a/internal/service/medialive/service_endpoints_gen_test.go +++ b/internal/service/medialive/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/mediapackage/service_endpoints_gen_test.go b/internal/service/mediapackage/service_endpoints_gen_test.go index d890f593180..4e96cd3947c 100644 --- a/internal/service/mediapackage/service_endpoints_gen_test.go +++ b/internal/service/mediapackage/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/mediapackagev2/service_endpoints_gen_test.go b/internal/service/mediapackagev2/service_endpoints_gen_test.go index 41a560fffa9..2c015d02d08 100644 --- a/internal/service/mediapackagev2/service_endpoints_gen_test.go +++ b/internal/service/mediapackagev2/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/mediastore/service_endpoints_gen_test.go b/internal/service/mediastore/service_endpoints_gen_test.go index 5c7f21a68fb..0922866e573 100644 --- a/internal/service/mediastore/service_endpoints_gen_test.go +++ b/internal/service/mediastore/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/memorydb/service_endpoints_gen_test.go b/internal/service/memorydb/service_endpoints_gen_test.go index d14bd125dd5..d79a8418cb2 100644 --- a/internal/service/memorydb/service_endpoints_gen_test.go +++ b/internal/service/memorydb/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/mq/service_endpoints_gen_test.go b/internal/service/mq/service_endpoints_gen_test.go index bb79b95542f..5a2373caaad 100644 --- a/internal/service/mq/service_endpoints_gen_test.go +++ b/internal/service/mq/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/neptune/service_endpoints_gen_test.go b/internal/service/neptune/service_endpoints_gen_test.go index 797188b4c61..f72a38daff9 100644 --- a/internal/service/neptune/service_endpoints_gen_test.go +++ b/internal/service/neptune/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/networkfirewall/service_endpoints_gen_test.go b/internal/service/networkfirewall/service_endpoints_gen_test.go index d38e4368f3d..15708170853 100644 --- a/internal/service/networkfirewall/service_endpoints_gen_test.go +++ b/internal/service/networkfirewall/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/networkmanager/service_endpoints_gen_test.go b/internal/service/networkmanager/service_endpoints_gen_test.go index 037cec3b0e5..74eb910c3ea 100644 --- a/internal/service/networkmanager/service_endpoints_gen_test.go +++ b/internal/service/networkmanager/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/oam/service_endpoints_gen_test.go b/internal/service/oam/service_endpoints_gen_test.go index 9c0c6725882..9d354ef593a 100644 --- a/internal/service/oam/service_endpoints_gen_test.go +++ b/internal/service/oam/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/opensearch/service_endpoints_gen_test.go b/internal/service/opensearch/service_endpoints_gen_test.go index da31730a13e..831a579c8f4 100644 --- a/internal/service/opensearch/service_endpoints_gen_test.go +++ b/internal/service/opensearch/service_endpoints_gen_test.go @@ -78,12 +78,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -282,7 +283,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/opensearchserverless/service_endpoints_gen_test.go b/internal/service/opensearchserverless/service_endpoints_gen_test.go index e29a1283da2..24ba65684cd 100644 --- a/internal/service/opensearchserverless/service_endpoints_gen_test.go +++ b/internal/service/opensearchserverless/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/opsworks/service_endpoints_gen_test.go b/internal/service/opsworks/service_endpoints_gen_test.go index 55bb8e08af6..9df1e2ad33e 100644 --- a/internal/service/opsworks/service_endpoints_gen_test.go +++ b/internal/service/opsworks/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/organizations/service_endpoints_gen_test.go b/internal/service/organizations/service_endpoints_gen_test.go index 369572d285c..2ee8737d177 100644 --- a/internal/service/organizations/service_endpoints_gen_test.go +++ b/internal/service/organizations/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/osis/service_endpoints_gen_test.go b/internal/service/osis/service_endpoints_gen_test.go index cadf575e39f..8620075b93b 100644 --- a/internal/service/osis/service_endpoints_gen_test.go +++ b/internal/service/osis/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/outposts/service_endpoints_gen_test.go b/internal/service/outposts/service_endpoints_gen_test.go index 3cf7e0a690a..0f074b790ac 100644 --- a/internal/service/outposts/service_endpoints_gen_test.go +++ b/internal/service/outposts/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/pcaconnectorad/service_endpoints_gen_test.go b/internal/service/pcaconnectorad/service_endpoints_gen_test.go index 4ba71e399cd..45f5ae06d59 100644 --- a/internal/service/pcaconnectorad/service_endpoints_gen_test.go +++ b/internal/service/pcaconnectorad/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/pinpoint/service_endpoints_gen_test.go b/internal/service/pinpoint/service_endpoints_gen_test.go index 47b6740144c..0e4576cb12f 100644 --- a/internal/service/pinpoint/service_endpoints_gen_test.go +++ b/internal/service/pinpoint/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/pipes/service_endpoints_gen_test.go b/internal/service/pipes/service_endpoints_gen_test.go index d39f4d1121e..b691f4c0b19 100644 --- a/internal/service/pipes/service_endpoints_gen_test.go +++ b/internal/service/pipes/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/polly/service_endpoints_gen_test.go b/internal/service/polly/service_endpoints_gen_test.go index 054842576d2..54cc7ed6c95 100644 --- a/internal/service/polly/service_endpoints_gen_test.go +++ b/internal/service/polly/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/pricing/service_endpoints_gen_test.go b/internal/service/pricing/service_endpoints_gen_test.go index 9923cffa860..a302b07f614 100644 --- a/internal/service/pricing/service_endpoints_gen_test.go +++ b/internal/service/pricing/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/qbusiness/service_endpoints_gen_test.go b/internal/service/qbusiness/service_endpoints_gen_test.go index 2edba1a8591..03e23bb13dd 100644 --- a/internal/service/qbusiness/service_endpoints_gen_test.go +++ b/internal/service/qbusiness/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/qldb/service_endpoints_gen_test.go b/internal/service/qldb/service_endpoints_gen_test.go index 96aaa0bd9ec..e7c41fc71eb 100644 --- a/internal/service/qldb/service_endpoints_gen_test.go +++ b/internal/service/qldb/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/quicksight/service_endpoints_gen_test.go b/internal/service/quicksight/service_endpoints_gen_test.go index a9d4370efc1..44ead5f8667 100644 --- a/internal/service/quicksight/service_endpoints_gen_test.go +++ b/internal/service/quicksight/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ram/service_endpoints_gen_test.go b/internal/service/ram/service_endpoints_gen_test.go index 17a35491251..cc97f4b7b7c 100644 --- a/internal/service/ram/service_endpoints_gen_test.go +++ b/internal/service/ram/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/rbin/service_endpoints_gen_test.go b/internal/service/rbin/service_endpoints_gen_test.go index b00adec3ba0..2de4de719ce 100644 --- a/internal/service/rbin/service_endpoints_gen_test.go +++ b/internal/service/rbin/service_endpoints_gen_test.go @@ -82,12 +82,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -286,7 +287,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/rds/service_endpoints_gen_test.go b/internal/service/rds/service_endpoints_gen_test.go index a0064b02c24..32a33b9535b 100644 --- a/internal/service/rds/service_endpoints_gen_test.go +++ b/internal/service/rds/service_endpoints_gen_test.go @@ -79,12 +79,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -235,7 +236,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -245,7 +246,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) diff --git a/internal/service/redshift/service_endpoints_gen_test.go b/internal/service/redshift/service_endpoints_gen_test.go index f2ef409ddba..8a833f32aa7 100644 --- a/internal/service/redshift/service_endpoints_gen_test.go +++ b/internal/service/redshift/service_endpoints_gen_test.go @@ -79,12 +79,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -235,7 +236,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -245,7 +246,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) diff --git a/internal/service/redshiftdata/service_endpoints_gen_test.go b/internal/service/redshiftdata/service_endpoints_gen_test.go index 30ea5948a4a..025fa76ac0c 100644 --- a/internal/service/redshiftdata/service_endpoints_gen_test.go +++ b/internal/service/redshiftdata/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/redshiftserverless/service_endpoints_gen_test.go b/internal/service/redshiftserverless/service_endpoints_gen_test.go index 8f3186026c8..8f00ebb3dae 100644 --- a/internal/service/redshiftserverless/service_endpoints_gen_test.go +++ b/internal/service/redshiftserverless/service_endpoints_gen_test.go @@ -79,12 +79,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -235,7 +236,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV1) + testEndpointCase(t, providerRegion, testcase, callServiceV1) }) } }) @@ -245,7 +246,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callServiceV2) + testEndpointCase(t, providerRegion, testcase, callServiceV2) }) } }) diff --git a/internal/service/rekognition/service_endpoints_gen_test.go b/internal/service/rekognition/service_endpoints_gen_test.go index aad5629ef3b..a094ad04fb5 100644 --- a/internal/service/rekognition/service_endpoints_gen_test.go +++ b/internal/service/rekognition/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/resourceexplorer2/service_endpoints_gen_test.go b/internal/service/resourceexplorer2/service_endpoints_gen_test.go index 4bda68a3fdb..009ac8bbc23 100644 --- a/internal/service/resourceexplorer2/service_endpoints_gen_test.go +++ b/internal/service/resourceexplorer2/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/resourcegroups/service_endpoints_gen_test.go b/internal/service/resourcegroups/service_endpoints_gen_test.go index 138b84814b4..621b152a8bc 100644 --- a/internal/service/resourcegroups/service_endpoints_gen_test.go +++ b/internal/service/resourcegroups/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go index 0338f657a9e..9f11765ca87 100644 --- a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go +++ b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/rolesanywhere/service_endpoints_gen_test.go b/internal/service/rolesanywhere/service_endpoints_gen_test.go index 160eb2a4dd3..041917575aa 100644 --- a/internal/service/rolesanywhere/service_endpoints_gen_test.go +++ b/internal/service/rolesanywhere/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/route53/service_endpoints_gen_test.go b/internal/service/route53/service_endpoints_gen_test.go index 099b7bc7caf..e399b8728a0 100644 --- a/internal/service/route53/service_endpoints_gen_test.go +++ b/internal/service/route53/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/route53domains/service_endpoints_gen_test.go b/internal/service/route53domains/service_endpoints_gen_test.go index 5b24c0e3b63..6d639ee5513 100644 --- a/internal/service/route53domains/service_endpoints_gen_test.go +++ b/internal/service/route53domains/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go index 4553c9c8499..092dd2f3d43 100644 --- a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go +++ b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go index 67c21e99cb6..ace05bc6cf8 100644 --- a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go +++ b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/route53resolver/service_endpoints_gen_test.go b/internal/service/route53resolver/service_endpoints_gen_test.go index 56342008766..a909b46b673 100644 --- a/internal/service/route53resolver/service_endpoints_gen_test.go +++ b/internal/service/route53resolver/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/rum/service_endpoints_gen_test.go b/internal/service/rum/service_endpoints_gen_test.go index 61947621e1e..024eb6192d5 100644 --- a/internal/service/rum/service_endpoints_gen_test.go +++ b/internal/service/rum/service_endpoints_gen_test.go @@ -78,12 +78,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -282,7 +283,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/s3/service_endpoints_gen_test.go b/internal/service/s3/service_endpoints_gen_test.go index 7f5f2e91ce2..1467a9397b6 100644 --- a/internal/service/s3/service_endpoints_gen_test.go +++ b/internal/service/s3/service_endpoints_gen_test.go @@ -83,12 +83,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -409,7 +410,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/s3outposts/service_endpoints_gen_test.go b/internal/service/s3outposts/service_endpoints_gen_test.go index 38898f8981a..daf40e38165 100644 --- a/internal/service/s3outposts/service_endpoints_gen_test.go +++ b/internal/service/s3outposts/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/sagemaker/service_endpoints_gen_test.go b/internal/service/sagemaker/service_endpoints_gen_test.go index c7773fc1b0b..1251d4316d6 100644 --- a/internal/service/sagemaker/service_endpoints_gen_test.go +++ b/internal/service/sagemaker/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/scheduler/service_endpoints_gen_test.go b/internal/service/scheduler/service_endpoints_gen_test.go index fc64f85b76a..6a7f48fca4c 100644 --- a/internal/service/scheduler/service_endpoints_gen_test.go +++ b/internal/service/scheduler/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/schemas/service_endpoints_gen_test.go b/internal/service/schemas/service_endpoints_gen_test.go index 176ba06039b..8f2e7b751b1 100644 --- a/internal/service/schemas/service_endpoints_gen_test.go +++ b/internal/service/schemas/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/secretsmanager/service_endpoints_gen_test.go b/internal/service/secretsmanager/service_endpoints_gen_test.go index 00ea073b9cb..6c86fe874e8 100644 --- a/internal/service/secretsmanager/service_endpoints_gen_test.go +++ b/internal/service/secretsmanager/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/securityhub/service_endpoints_gen_test.go b/internal/service/securityhub/service_endpoints_gen_test.go index 563ad55f966..bf08932ca97 100644 --- a/internal/service/securityhub/service_endpoints_gen_test.go +++ b/internal/service/securityhub/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/securitylake/service_endpoints_gen_test.go b/internal/service/securitylake/service_endpoints_gen_test.go index a7363fab1ea..e10b2ceacbd 100644 --- a/internal/service/securitylake/service_endpoints_gen_test.go +++ b/internal/service/securitylake/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/serverlessrepo/service_endpoints_gen_test.go b/internal/service/serverlessrepo/service_endpoints_gen_test.go index ba8602adba2..3086c306bfa 100644 --- a/internal/service/serverlessrepo/service_endpoints_gen_test.go +++ b/internal/service/serverlessrepo/service_endpoints_gen_test.go @@ -80,12 +80,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -341,7 +342,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/servicecatalog/service_endpoints_gen_test.go b/internal/service/servicecatalog/service_endpoints_gen_test.go index 615dbc52a13..5a11232f0da 100644 --- a/internal/service/servicecatalog/service_endpoints_gen_test.go +++ b/internal/service/servicecatalog/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go index 30fc7657694..6ad5530bf18 100644 --- a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go +++ b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/servicediscovery/service_endpoints_gen_test.go b/internal/service/servicediscovery/service_endpoints_gen_test.go index a0f27192d88..eda90bf434d 100644 --- a/internal/service/servicediscovery/service_endpoints_gen_test.go +++ b/internal/service/servicediscovery/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/servicequotas/service_endpoints_gen_test.go b/internal/service/servicequotas/service_endpoints_gen_test.go index d320f6aae04..ff588d54d17 100644 --- a/internal/service/servicequotas/service_endpoints_gen_test.go +++ b/internal/service/servicequotas/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ses/service_endpoints_gen_test.go b/internal/service/ses/service_endpoints_gen_test.go index ab4637b92a3..2c65be024db 100644 --- a/internal/service/ses/service_endpoints_gen_test.go +++ b/internal/service/ses/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/sesv2/service_endpoints_gen_test.go b/internal/service/sesv2/service_endpoints_gen_test.go index a91a82f7a0c..1165dc0d663 100644 --- a/internal/service/sesv2/service_endpoints_gen_test.go +++ b/internal/service/sesv2/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/sfn/service_endpoints_gen_test.go b/internal/service/sfn/service_endpoints_gen_test.go index 55a869b397e..c522c95a377 100644 --- a/internal/service/sfn/service_endpoints_gen_test.go +++ b/internal/service/sfn/service_endpoints_gen_test.go @@ -78,12 +78,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -282,7 +283,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/shield/service_endpoints_gen_test.go b/internal/service/shield/service_endpoints_gen_test.go index 57e1f0407c7..5a4225ce208 100644 --- a/internal/service/shield/service_endpoints_gen_test.go +++ b/internal/service/shield/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/signer/service_endpoints_gen_test.go b/internal/service/signer/service_endpoints_gen_test.go index b5eb672d95b..0e2057b53b0 100644 --- a/internal/service/signer/service_endpoints_gen_test.go +++ b/internal/service/signer/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/simpledb/service_endpoints_gen_test.go b/internal/service/simpledb/service_endpoints_gen_test.go index 5a64a3ffc11..569d45bd00e 100644 --- a/internal/service/simpledb/service_endpoints_gen_test.go +++ b/internal/service/simpledb/service_endpoints_gen_test.go @@ -78,12 +78,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -282,7 +283,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/sns/service_endpoints_gen_test.go b/internal/service/sns/service_endpoints_gen_test.go index f5b20c61401..2f63b368c16 100644 --- a/internal/service/sns/service_endpoints_gen_test.go +++ b/internal/service/sns/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/sqs/service_endpoints_gen_test.go b/internal/service/sqs/service_endpoints_gen_test.go index 6c349f1c4e9..d50234f962e 100644 --- a/internal/service/sqs/service_endpoints_gen_test.go +++ b/internal/service/sqs/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ssm/service_endpoints_gen_test.go b/internal/service/ssm/service_endpoints_gen_test.go index 0fa03bb25ee..e2bc5f82112 100644 --- a/internal/service/ssm/service_endpoints_gen_test.go +++ b/internal/service/ssm/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ssmcontacts/service_endpoints_gen_test.go b/internal/service/ssmcontacts/service_endpoints_gen_test.go index 9d5863b84ba..56ab194925a 100644 --- a/internal/service/ssmcontacts/service_endpoints_gen_test.go +++ b/internal/service/ssmcontacts/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ssmincidents/service_endpoints_gen_test.go b/internal/service/ssmincidents/service_endpoints_gen_test.go index 23cc83b956f..28fcd4cb2c7 100644 --- a/internal/service/ssmincidents/service_endpoints_gen_test.go +++ b/internal/service/ssmincidents/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ssmsap/service_endpoints_gen_test.go b/internal/service/ssmsap/service_endpoints_gen_test.go index 30bd9c3b8eb..3f4595984a8 100644 --- a/internal/service/ssmsap/service_endpoints_gen_test.go +++ b/internal/service/ssmsap/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/sso/service_endpoints_gen_test.go b/internal/service/sso/service_endpoints_gen_test.go index 1fa79ce2bff..0f4a7efd9db 100644 --- a/internal/service/sso/service_endpoints_gen_test.go +++ b/internal/service/sso/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/ssoadmin/service_endpoints_gen_test.go b/internal/service/ssoadmin/service_endpoints_gen_test.go index f9149e2efb6..d3c3c20a652 100644 --- a/internal/service/ssoadmin/service_endpoints_gen_test.go +++ b/internal/service/ssoadmin/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/storagegateway/service_endpoints_gen_test.go b/internal/service/storagegateway/service_endpoints_gen_test.go index a761f29929a..20f0daa74bf 100644 --- a/internal/service/storagegateway/service_endpoints_gen_test.go +++ b/internal/service/storagegateway/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/sts/service_endpoints_gen_test.go b/internal/service/sts/service_endpoints_gen_test.go index 6d826e5de56..724d0dcc782 100644 --- a/internal/service/sts/service_endpoints_gen_test.go +++ b/internal/service/sts/service_endpoints_gen_test.go @@ -80,12 +80,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -341,7 +342,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/swf/service_endpoints_gen_test.go b/internal/service/swf/service_endpoints_gen_test.go index ef31eb1179d..2f20742b2dd 100644 --- a/internal/service/swf/service_endpoints_gen_test.go +++ b/internal/service/swf/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/synthetics/service_endpoints_gen_test.go b/internal/service/synthetics/service_endpoints_gen_test.go index a6d0aaad241..4c0ef4cc543 100644 --- a/internal/service/synthetics/service_endpoints_gen_test.go +++ b/internal/service/synthetics/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go index 9bb478754eb..b49a8accff2 100644 --- a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go +++ b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/transcribe/service_endpoints_gen_test.go b/internal/service/transcribe/service_endpoints_gen_test.go index e4838123240..64faf0ba296 100644 --- a/internal/service/transcribe/service_endpoints_gen_test.go +++ b/internal/service/transcribe/service_endpoints_gen_test.go @@ -81,12 +81,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -285,7 +286,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/transfer/service_endpoints_gen_test.go b/internal/service/transfer/service_endpoints_gen_test.go index 0acee7ca893..bf4085fdc5e 100644 --- a/internal/service/transfer/service_endpoints_gen_test.go +++ b/internal/service/transfer/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/verifiedpermissions/service_endpoints_gen_test.go b/internal/service/verifiedpermissions/service_endpoints_gen_test.go index 0299976cde4..483d0697c27 100644 --- a/internal/service/verifiedpermissions/service_endpoints_gen_test.go +++ b/internal/service/verifiedpermissions/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/vpclattice/service_endpoints_gen_test.go b/internal/service/vpclattice/service_endpoints_gen_test.go index 00e790cecdd..51e4d4feb7f 100644 --- a/internal/service/vpclattice/service_endpoints_gen_test.go +++ b/internal/service/vpclattice/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/waf/service_endpoints_gen_test.go b/internal/service/waf/service_endpoints_gen_test.go index de5cfd1ec91..80f4fba7b7e 100644 --- a/internal/service/waf/service_endpoints_gen_test.go +++ b/internal/service/waf/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/wafregional/service_endpoints_gen_test.go b/internal/service/wafregional/service_endpoints_gen_test.go index 76a40eaa4b2..1920668894c 100644 --- a/internal/service/wafregional/service_endpoints_gen_test.go +++ b/internal/service/wafregional/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/wafv2/service_endpoints_gen_test.go b/internal/service/wafv2/service_endpoints_gen_test.go index 73aff954c86..fe349568dba 100644 --- a/internal/service/wafv2/service_endpoints_gen_test.go +++ b/internal/service/wafv2/service_endpoints_gen_test.go @@ -77,12 +77,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -232,7 +233,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/wellarchitected/service_endpoints_gen_test.go b/internal/service/wellarchitected/service_endpoints_gen_test.go index 2b9085267c3..d8ccf19f443 100644 --- a/internal/service/wellarchitected/service_endpoints_gen_test.go +++ b/internal/service/wellarchitected/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/worklink/service_endpoints_gen_test.go b/internal/service/worklink/service_endpoints_gen_test.go index 0f5a6163e29..a79e8ca1e59 100644 --- a/internal/service/worklink/service_endpoints_gen_test.go +++ b/internal/service/worklink/service_endpoints_gen_test.go @@ -73,12 +73,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -228,7 +229,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/workspaces/service_endpoints_gen_test.go b/internal/service/workspaces/service_endpoints_gen_test.go index 3df80d84334..12242e85806 100644 --- a/internal/service/workspaces/service_endpoints_gen_test.go +++ b/internal/service/workspaces/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/workspacesweb/service_endpoints_gen_test.go b/internal/service/workspacesweb/service_endpoints_gen_test.go index a622ddc2af8..a239f3a8f10 100644 --- a/internal/service/workspacesweb/service_endpoints_gen_test.go +++ b/internal/service/workspacesweb/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } diff --git a/internal/service/xray/service_endpoints_gen_test.go b/internal/service/xray/service_endpoints_gen_test.go index a4479722259..b3e1484f8d7 100644 --- a/internal/service/xray/service_endpoints_gen_test.go +++ b/internal/service/xray/service_endpoints_gen_test.go @@ -76,12 +76,13 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const region = "us-west-2" //lintignore:AWSAT003 + const providerRegion = "us-west-2" //lintignore:AWSAT003 + const expectedEndpointRegion = providerRegion testcases := map[string]endpointTestCase{ "no config": { with: []setupFunc{withNoConfig}, - expected: expectDefaultEndpoint(region), + expected: expectDefaultEndpoint(expectedEndpointRegion), }, // Package name endpoint on Config @@ -231,7 +232,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S testcase := testcase t.Run(name, func(t *testing.T) { - testEndpointCase(t, region, testcase, callService) + testEndpointCase(t, providerRegion, testcase, callService) }) } } From ad703ab131f283ac90d62966cc8c0d185f6ba741 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 09:47:39 -0700 Subject: [PATCH 06/15] `route53domains` --- internal/generate/serviceendpointtests/main.go | 4 ++++ .../route53domains/service_endpoints_gen_test.go | 16 +++++++++------- .../service/route53domains/service_package.go | 8 +++++--- names/data/names_data.csv | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/internal/generate/serviceendpointtests/main.go b/internal/generate/serviceendpointtests/main.go index c390cd3469b..e25b2d53e69 100644 --- a/internal/generate/serviceendpointtests/main.go +++ b/internal/generate/serviceendpointtests/main.go @@ -96,6 +96,10 @@ func main() { // case "costoptimizationhub", "cur", "route53domains": // td.Region = "us-east-1" // } + switch packageName { + case "route53domains": + td.OverrideRegionRegionalEndpoint = true + } if td.APICall == "" { g.Fatalf("error generating service endpoint tests: package %q missing APICall", packageName) diff --git a/internal/service/route53domains/service_endpoints_gen_test.go b/internal/service/route53domains/service_endpoints_gen_test.go index 6d639ee5513..b6f7c174651 100644 --- a/internal/service/route53domains/service_endpoints_gen_test.go +++ b/internal/service/route53domains/service_endpoints_gen_test.go @@ -77,7 +77,9 @@ const ( func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 - const expectedEndpointRegion = providerRegion + // Route 53 Domains has a single regional endpoint + // However, the AWS SDK's endpoint resolution returns one for whatever region you're using + const expectedEndpointRegion = "us-east-1" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ "no config": { @@ -334,7 +336,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: "us-east-1", } } @@ -347,35 +349,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: "us-east-1", } } diff --git a/internal/service/route53domains/service_package.go b/internal/service/route53domains/service_package.go index 1568cddb0fe..3a072ade9a0 100644 --- a/internal/service/route53domains/service_package.go +++ b/internal/service/route53domains/service_package.go @@ -17,6 +17,11 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( cfg := *(config["aws_sdkv2_config"].(*aws.Config)) return route53domains.NewFromConfig(cfg, func(o *route53domains.Options) { + if config["partition"].(string) == names.StandardPartitionID { + // Route 53 Domains is only available in AWS Commercial us-east-1 Region. + o.Region = names.USEast1RegionID + } + if endpoint := config[names.AttrEndpoint].(string); endpoint != "" { tflog.Debug(ctx, "setting endpoint", map[string]any{ "tf_aws.endpoint": endpoint, @@ -27,9 +32,6 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( tflog.Debug(ctx, "endpoint set, ignoring UseFIPSEndpoint setting") o.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateDisabled } - } else if config["partition"].(string) == names.StandardPartitionID { - // Route 53 Domains is only available in AWS Commercial us-east-1 Region. - o.Region = names.USEast1RegionID } }), nil } diff --git a/names/data/names_data.csv b/names/data/names_data.csv index f8e8b284af6..1e68389b0b4 100644 --- a/names/data/names_data.csv +++ b/names/data/names_data.csv @@ -310,7 +310,7 @@ resourcegroupstaggingapi,resourcegroupstaggingapi,resourcegroupstaggingapi,resou robomaker,robomaker,robomaker,robomaker,,robomaker,,,RoboMaker,RoboMaker,,1,,,aws_robomaker_,,robomaker_,RoboMaker,AWS,,x,,,,,RoboMaker,,,, rolesanywhere,rolesanywhere,rolesanywhere,rolesanywhere,,rolesanywhere,,,RolesAnywhere,RolesAnywhere,,,2,,aws_rolesanywhere_,,rolesanywhere_,Roles Anywhere,AWS,,,,,,,RolesAnywhere,ListProfiles,,, route53,route53,route53,route53,,route53,,,Route53,Route53,x,,2,aws_route53_(?!resolver_),aws_route53_,,route53_cidr_;route53_delegation_;route53_health_;route53_hosted_;route53_key_;route53_query_;route53_record;route53_traffic_;route53_vpc_;route53_zone,Route 53,Amazon,,,,,,,Route 53,ListHostedZones,,us-east-1, -route53domains,route53domains,route53domains,route53domains,,route53domains,,,Route53Domains,Route53Domains,x,,2,,aws_route53domains_,,route53domains_,Route 53 Domains,Amazon,,,,,,,Route 53 Domains,ListDomains,,, +route53domains,route53domains,route53domains,route53domains,,route53domains,,,Route53Domains,Route53Domains,x,,2,,aws_route53domains_,,route53domains_,Route 53 Domains,Amazon,,,,,,,Route 53 Domains,ListDomains,,us-east-1, route53profiles,route53profiles,route53profiles,route53profiles,,route53profiles,,,Route53Profiles,Route53Profiles,,,2,,aws_route53profiles_,,route53profiles_,Route 53 Profiles,Amazon,,,,,,,Route 53 Profiles,ListProfiles,,, route53-recovery-cluster,route53recoverycluster,route53recoverycluster,route53recoverycluster,,route53recoverycluster,,,Route53RecoveryCluster,Route53RecoveryCluster,,1,,,aws_route53recoverycluster_,,route53recoverycluster_,Route 53 Recovery Cluster,Amazon,,x,,,,,Route53 Recovery Cluster,,,, route53-recovery-control-config,route53recoverycontrolconfig,route53recoverycontrolconfig,route53recoverycontrolconfig,,route53recoverycontrolconfig,,,Route53RecoveryControlConfig,Route53RecoveryControlConfig,x,1,,,aws_route53recoverycontrolconfig_,,route53recoverycontrolconfig_,Route 53 Recovery Control Config,Amazon,,,,,,,Route53 Recovery Control Config,ListClusters,,, From a932e7fcf085ee30bcd011ce65961be79a6a53a9 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 10:10:16 -0700 Subject: [PATCH 07/15] `shield` --- .../service/shield/service_endpoints_gen_test.go | 12 ++++++------ names/data/names_data.csv | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/shield/service_endpoints_gen_test.go b/internal/service/shield/service_endpoints_gen_test.go index 5a4225ce208..08f363af585 100644 --- a/internal/service/shield/service_endpoints_gen_test.go +++ b/internal/service/shield/service_endpoints_gen_test.go @@ -334,7 +334,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: "us-east-1", } } @@ -347,35 +347,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: "us-east-1", } } diff --git a/names/data/names_data.csv b/names/data/names_data.csv index 1e68389b0b4..ff528928463 100644 --- a/names/data/names_data.csv +++ b/names/data/names_data.csv @@ -340,7 +340,7 @@ service-quotas,servicequotas,servicequotas,servicequotas,,servicequotas,,,Servic ses,ses,ses,ses,,ses,,,SES,SES,,1,,,aws_ses_,,ses_,SES (Simple Email),Amazon,,,,,,,SES,ListIdentities,,, sesv2,sesv2,sesv2,sesv2,,sesv2,,,SESV2,SESV2,,,2,,aws_sesv2_,,sesv2_,SESv2 (Simple Email V2),Amazon,,,,,,,SESv2,ListContactLists,,, stepfunctions,stepfunctions,sfn,sfn,,sfn,,stepfunctions,SFN,SFN,,1,,,aws_sfn_,,sfn_,SFN (Step Functions),AWS,,,,,,,SFN,ListActivities,,, -shield,shield,shield,shield,,shield,,,Shield,Shield,x,,2,,aws_shield_,,shield_,Shield,AWS,,,,,,,Shield,ListProtectionGroups,,, +shield,shield,shield,shield,,shield,,,Shield,Shield,x,,2,,aws_shield_,,shield_,Shield,AWS,,,,,,,Shield,ListProtectionGroups,,us-east-1, signer,signer,signer,signer,,signer,,,Signer,Signer,,,2,,aws_signer_,,signer_,Signer,AWS,,,,,,,signer,ListSigningJobs,,, sms,sms,sms,sms,,sms,,,SMS,SMS,,1,,,aws_sms_,,sms_,SMS (Server Migration),AWS,,x,,,,,SMS,,,, snow-device-management,snowdevicemanagement,snowdevicemanagement,snowdevicemanagement,,snowdevicemanagement,,,SnowDeviceManagement,SnowDeviceManagement,,1,,,aws_snowdevicemanagement_,,snowdevicemanagement_,Snow Device Management,AWS,,x,,,,,Snow Device Management,,,, From a5a0927706875336f96084c74733ee8e49cab77c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 10:16:49 -0700 Subject: [PATCH 08/15] `costoptimizationhub` --- .../generate/serviceendpointtests/file.gtpl | 3 ++- .../generate/serviceendpointtests/main.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../account/service_endpoints_gen_test.go | 3 ++- .../service/acm/service_endpoints_gen_test.go | 3 ++- .../acmpca/service_endpoints_gen_test.go | 3 ++- .../service/amp/service_endpoints_gen_test.go | 3 ++- .../amplify/service_endpoints_gen_test.go | 3 ++- .../apigateway/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../appconfig/service_endpoints_gen_test.go | 3 ++- .../appfabric/service_endpoints_gen_test.go | 3 ++- .../appflow/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../appmesh/service_endpoints_gen_test.go | 3 ++- .../apprunner/service_endpoints_gen_test.go | 3 ++- .../appstream/service_endpoints_gen_test.go | 3 ++- .../appsync/service_endpoints_gen_test.go | 3 ++- .../athena/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../autoscaling/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../backup/service_endpoints_gen_test.go | 3 ++- .../batch/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../bedrock/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../budgets/service_endpoints_gen_test.go | 3 ++- .../service/ce/service_endpoints_gen_test.go | 3 ++- .../chatbot/service_endpoints_gen_test.go | 3 ++- .../chime/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../cleanrooms/service_endpoints_gen_test.go | 3 ++- .../cloud9/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../cloudfront/service_endpoints_gen_test.go | 3 ++- .../cloudhsmv2/service_endpoints_gen_test.go | 3 ++- .../cloudsearch/service_endpoints_gen_test.go | 3 ++- .../cloudtrail/service_endpoints_gen_test.go | 3 ++- .../cloudwatch/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../codebuild/service_endpoints_gen_test.go | 3 ++- .../codecommit/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../cognitoidp/service_endpoints_gen_test.go | 3 ++- .../comprehend/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../connect/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 19 +++++++++++-------- .../costoptimizationhub/service_package.go | 8 +++++--- .../service/cur/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../datasync/service_endpoints_gen_test.go | 3 ++- .../datazone/service_endpoints_gen_test.go | 3 ++- .../service/dax/service_endpoints_gen_test.go | 3 ++- .../deploy/service_endpoints_gen_test.go | 3 ++- .../detective/service_endpoints_gen_test.go | 3 ++- .../devicefarm/service_endpoints_gen_test.go | 3 ++- .../devopsguru/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service/dlm/service_endpoints_gen_test.go | 3 ++- .../service/dms/service_endpoints_gen_test.go | 3 ++- .../docdb/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service/drs/service_endpoints_gen_test.go | 3 ++- .../service/ds/service_endpoints_gen_test.go | 3 ++- .../dynamodb/service_endpoints_gen_test.go | 3 ++- .../service/ec2/service_endpoints_gen_test.go | 3 ++- .../service/ecr/service_endpoints_gen_test.go | 3 ++- .../ecrpublic/service_endpoints_gen_test.go | 3 ++- .../service/ecs/service_endpoints_gen_test.go | 3 ++- .../service/efs/service_endpoints_gen_test.go | 3 ++- .../service/eks/service_endpoints_gen_test.go | 3 ++- .../elasticache/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service/elb/service_endpoints_gen_test.go | 3 ++- .../elbv2/service_endpoints_gen_test.go | 3 ++- .../service/emr/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../events/service_endpoints_gen_test.go | 3 ++- .../evidently/service_endpoints_gen_test.go | 3 ++- .../finspace/service_endpoints_gen_test.go | 3 ++- .../firehose/service_endpoints_gen_test.go | 3 ++- .../service/fis/service_endpoints_gen_test.go | 3 ++- .../service/fms/service_endpoints_gen_test.go | 3 ++- .../service/fsx/service_endpoints_gen_test.go | 3 ++- .../gamelift/service_endpoints_gen_test.go | 3 ++- .../glacier/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../glue/service_endpoints_gen_test.go | 3 ++- .../grafana/service_endpoints_gen_test.go | 3 ++- .../greengrass/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../guardduty/service_endpoints_gen_test.go | 3 ++- .../healthlake/service_endpoints_gen_test.go | 3 ++- .../service/iam/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../inspector/service_endpoints_gen_test.go | 3 ++- .../inspector2/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service/iot/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../iotevents/service_endpoints_gen_test.go | 3 ++- .../service/ivs/service_endpoints_gen_test.go | 3 ++- .../ivschat/service_endpoints_gen_test.go | 3 ++- .../kafka/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../kendra/service_endpoints_gen_test.go | 3 ++- .../keyspaces/service_endpoints_gen_test.go | 3 ++- .../kinesis/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service/kms/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../lambda/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../lexmodels/service_endpoints_gen_test.go | 3 ++- .../lexv2models/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../lightsail/service_endpoints_gen_test.go | 3 ++- .../location/service_endpoints_gen_test.go | 3 ++- .../logs/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service/m2/service_endpoints_gen_test.go | 3 ++- .../macie2/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../medialive/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../mediastore/service_endpoints_gen_test.go | 3 ++- .../memorydb/service_endpoints_gen_test.go | 3 ++- .../service/mq/service_endpoints_gen_test.go | 3 ++- .../neptune/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service/oam/service_endpoints_gen_test.go | 3 ++- .../opensearch/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../opsworks/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../osis/service_endpoints_gen_test.go | 3 ++- .../outposts/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../pinpoint/service_endpoints_gen_test.go | 3 ++- .../pipes/service_endpoints_gen_test.go | 3 ++- .../polly/service_endpoints_gen_test.go | 3 ++- .../pricing/service_endpoints_gen_test.go | 3 ++- .../qbusiness/service_endpoints_gen_test.go | 3 ++- .../qldb/service_endpoints_gen_test.go | 3 ++- .../quicksight/service_endpoints_gen_test.go | 3 ++- .../service/ram/service_endpoints_gen_test.go | 3 ++- .../rbin/service_endpoints_gen_test.go | 3 ++- .../service/rds/service_endpoints_gen_test.go | 3 ++- .../redshift/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../rekognition/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../route53/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service/rum/service_endpoints_gen_test.go | 3 ++- .../service/s3/service_endpoints_gen_test.go | 3 ++- .../s3outposts/service_endpoints_gen_test.go | 3 ++- .../sagemaker/service_endpoints_gen_test.go | 3 ++- .../scheduler/service_endpoints_gen_test.go | 3 ++- .../schemas/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../securityhub/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service/ses/service_endpoints_gen_test.go | 3 ++- .../sesv2/service_endpoints_gen_test.go | 3 ++- .../service/sfn/service_endpoints_gen_test.go | 3 ++- .../shield/service_endpoints_gen_test.go | 3 ++- .../signer/service_endpoints_gen_test.go | 3 ++- .../simpledb/service_endpoints_gen_test.go | 3 ++- .../service/sns/service_endpoints_gen_test.go | 3 ++- .../service/sqs/service_endpoints_gen_test.go | 3 ++- .../service/ssm/service_endpoints_gen_test.go | 3 ++- .../ssmcontacts/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../ssmsap/service_endpoints_gen_test.go | 3 ++- .../service/sso/service_endpoints_gen_test.go | 3 ++- .../ssoadmin/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../service/sts/service_endpoints_gen_test.go | 3 ++- .../service/swf/service_endpoints_gen_test.go | 3 ++- .../synthetics/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../transcribe/service_endpoints_gen_test.go | 3 ++- .../transfer/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../vpclattice/service_endpoints_gen_test.go | 3 ++- .../service/waf/service_endpoints_gen_test.go | 3 ++- .../wafregional/service_endpoints_gen_test.go | 3 ++- .../wafv2/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../worklink/service_endpoints_gen_test.go | 3 ++- .../workspaces/service_endpoints_gen_test.go | 3 ++- .../service_endpoints_gen_test.go | 3 ++- .../xray/service_endpoints_gen_test.go | 3 ++- names/data/names_data.csv | 2 +- 232 files changed, 475 insertions(+), 241 deletions(-) diff --git a/internal/generate/serviceendpointtests/file.gtpl b/internal/generate/serviceendpointtests/file.gtpl index 083e96e88ff..92c7a6bf8df 100644 --- a/internal/generate/serviceendpointtests/file.gtpl +++ b/internal/generate/serviceendpointtests/file.gtpl @@ -468,7 +468,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -720,6 +720,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, } } diff --git a/internal/generate/serviceendpointtests/main.go b/internal/generate/serviceendpointtests/main.go index e25b2d53e69..7118006dd87 100644 --- a/internal/generate/serviceendpointtests/main.go +++ b/internal/generate/serviceendpointtests/main.go @@ -96,8 +96,9 @@ func main() { // case "costoptimizationhub", "cur", "route53domains": // td.Region = "us-east-1" // } + // This should be moved to service data switch packageName { - case "route53domains": + case "costoptimizationhub", "route53domains": td.OverrideRegionRegionalEndpoint = true } diff --git a/internal/service/accessanalyzer/service_endpoints_gen_test.go b/internal/service/accessanalyzer/service_endpoints_gen_test.go index 8f85b0c381b..a43efcc2b67 100644 --- a/internal/service/accessanalyzer/service_endpoints_gen_test.go +++ b/internal/service/accessanalyzer/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/account/service_endpoints_gen_test.go b/internal/service/account/service_endpoints_gen_test.go index ef02a21aa2c..f97813968c4 100644 --- a/internal/service/account/service_endpoints_gen_test.go +++ b/internal/service/account/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/acm/service_endpoints_gen_test.go b/internal/service/acm/service_endpoints_gen_test.go index d13416cb5c7..fc35503cf5f 100644 --- a/internal/service/acm/service_endpoints_gen_test.go +++ b/internal/service/acm/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/acmpca/service_endpoints_gen_test.go b/internal/service/acmpca/service_endpoints_gen_test.go index 2904250b49c..f18eda8c88e 100644 --- a/internal/service/acmpca/service_endpoints_gen_test.go +++ b/internal/service/acmpca/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/amp/service_endpoints_gen_test.go b/internal/service/amp/service_endpoints_gen_test.go index 73316c17f9d..0b532cf6af6 100644 --- a/internal/service/amp/service_endpoints_gen_test.go +++ b/internal/service/amp/service_endpoints_gen_test.go @@ -329,7 +329,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -484,6 +484,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/amplify/service_endpoints_gen_test.go b/internal/service/amplify/service_endpoints_gen_test.go index 6aadc3ac42e..048f653d244 100644 --- a/internal/service/amplify/service_endpoints_gen_test.go +++ b/internal/service/amplify/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/apigateway/service_endpoints_gen_test.go b/internal/service/apigateway/service_endpoints_gen_test.go index 9ba12b07283..c15570dba93 100644 --- a/internal/service/apigateway/service_endpoints_gen_test.go +++ b/internal/service/apigateway/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/apigatewayv2/service_endpoints_gen_test.go b/internal/service/apigatewayv2/service_endpoints_gen_test.go index b70d9b68959..38dc9073999 100644 --- a/internal/service/apigatewayv2/service_endpoints_gen_test.go +++ b/internal/service/apigatewayv2/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/appautoscaling/service_endpoints_gen_test.go b/internal/service/appautoscaling/service_endpoints_gen_test.go index b8db52ea220..e345c3e4590 100644 --- a/internal/service/appautoscaling/service_endpoints_gen_test.go +++ b/internal/service/appautoscaling/service_endpoints_gen_test.go @@ -271,7 +271,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -417,6 +417,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/appconfig/service_endpoints_gen_test.go b/internal/service/appconfig/service_endpoints_gen_test.go index c010c2a47cf..34156e1171e 100644 --- a/internal/service/appconfig/service_endpoints_gen_test.go +++ b/internal/service/appconfig/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/appfabric/service_endpoints_gen_test.go b/internal/service/appfabric/service_endpoints_gen_test.go index fce8d8d2c6a..6dd0a7777fc 100644 --- a/internal/service/appfabric/service_endpoints_gen_test.go +++ b/internal/service/appfabric/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/appflow/service_endpoints_gen_test.go b/internal/service/appflow/service_endpoints_gen_test.go index 820e589773e..9e713f73151 100644 --- a/internal/service/appflow/service_endpoints_gen_test.go +++ b/internal/service/appflow/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/appintegrations/service_endpoints_gen_test.go b/internal/service/appintegrations/service_endpoints_gen_test.go index 8619b126cf2..43fcb918212 100644 --- a/internal/service/appintegrations/service_endpoints_gen_test.go +++ b/internal/service/appintegrations/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/applicationinsights/service_endpoints_gen_test.go b/internal/service/applicationinsights/service_endpoints_gen_test.go index bacdbf78fe1..443ee8fe2f5 100644 --- a/internal/service/applicationinsights/service_endpoints_gen_test.go +++ b/internal/service/applicationinsights/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/appmesh/service_endpoints_gen_test.go b/internal/service/appmesh/service_endpoints_gen_test.go index e7bbc44dd35..2f3a6df4265 100644 --- a/internal/service/appmesh/service_endpoints_gen_test.go +++ b/internal/service/appmesh/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/apprunner/service_endpoints_gen_test.go b/internal/service/apprunner/service_endpoints_gen_test.go index eb5ca81a486..6ff94561b82 100644 --- a/internal/service/apprunner/service_endpoints_gen_test.go +++ b/internal/service/apprunner/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/appstream/service_endpoints_gen_test.go b/internal/service/appstream/service_endpoints_gen_test.go index a6368b15f9b..2fe34fd3a13 100644 --- a/internal/service/appstream/service_endpoints_gen_test.go +++ b/internal/service/appstream/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -343,6 +343,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/appsync/service_endpoints_gen_test.go b/internal/service/appsync/service_endpoints_gen_test.go index f5c4f89895a..f44fe52e6e5 100644 --- a/internal/service/appsync/service_endpoints_gen_test.go +++ b/internal/service/appsync/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/athena/service_endpoints_gen_test.go b/internal/service/athena/service_endpoints_gen_test.go index 009cc226324..9b537454c7b 100644 --- a/internal/service/athena/service_endpoints_gen_test.go +++ b/internal/service/athena/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/auditmanager/service_endpoints_gen_test.go b/internal/service/auditmanager/service_endpoints_gen_test.go index 08f11701d1f..fab37816c49 100644 --- a/internal/service/auditmanager/service_endpoints_gen_test.go +++ b/internal/service/auditmanager/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/autoscaling/service_endpoints_gen_test.go b/internal/service/autoscaling/service_endpoints_gen_test.go index 19eb1293eca..06c3ab9f68d 100644 --- a/internal/service/autoscaling/service_endpoints_gen_test.go +++ b/internal/service/autoscaling/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/autoscalingplans/service_endpoints_gen_test.go b/internal/service/autoscalingplans/service_endpoints_gen_test.go index f6e3e512475..bc9da45f5a6 100644 --- a/internal/service/autoscalingplans/service_endpoints_gen_test.go +++ b/internal/service/autoscalingplans/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/backup/service_endpoints_gen_test.go b/internal/service/backup/service_endpoints_gen_test.go index c46faacfdca..7ec4905fc60 100644 --- a/internal/service/backup/service_endpoints_gen_test.go +++ b/internal/service/backup/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/batch/service_endpoints_gen_test.go b/internal/service/batch/service_endpoints_gen_test.go index 15b211cfeb5..dad2a823917 100644 --- a/internal/service/batch/service_endpoints_gen_test.go +++ b/internal/service/batch/service_endpoints_gen_test.go @@ -219,7 +219,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -371,6 +371,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/bcmdataexports/service_endpoints_gen_test.go b/internal/service/bcmdataexports/service_endpoints_gen_test.go index 7f4e2eaae1f..0de4b6638ed 100644 --- a/internal/service/bcmdataexports/service_endpoints_gen_test.go +++ b/internal/service/bcmdataexports/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/bedrock/service_endpoints_gen_test.go b/internal/service/bedrock/service_endpoints_gen_test.go index 13b86ef0251..ecdcff96157 100644 --- a/internal/service/bedrock/service_endpoints_gen_test.go +++ b/internal/service/bedrock/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/bedrockagent/service_endpoints_gen_test.go b/internal/service/bedrockagent/service_endpoints_gen_test.go index a610a85fc87..2afa372c4b9 100644 --- a/internal/service/bedrockagent/service_endpoints_gen_test.go +++ b/internal/service/bedrockagent/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/budgets/service_endpoints_gen_test.go b/internal/service/budgets/service_endpoints_gen_test.go index b1e9da08b96..577bb54f05e 100644 --- a/internal/service/budgets/service_endpoints_gen_test.go +++ b/internal/service/budgets/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -343,6 +343,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ce/service_endpoints_gen_test.go b/internal/service/ce/service_endpoints_gen_test.go index dcc0264f659..7e1eb4c2636 100644 --- a/internal/service/ce/service_endpoints_gen_test.go +++ b/internal/service/ce/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/chatbot/service_endpoints_gen_test.go b/internal/service/chatbot/service_endpoints_gen_test.go index 5aa395536a6..2efda3fd1c3 100644 --- a/internal/service/chatbot/service_endpoints_gen_test.go +++ b/internal/service/chatbot/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/chime/service_endpoints_gen_test.go b/internal/service/chime/service_endpoints_gen_test.go index 88330c604bc..b9f58c587f3 100644 --- a/internal/service/chime/service_endpoints_gen_test.go +++ b/internal/service/chime/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go index 6d99d21a184..001b7c63205 100644 --- a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go +++ b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/chimesdkvoice/service_endpoints_gen_test.go b/internal/service/chimesdkvoice/service_endpoints_gen_test.go index 4273629de8d..ab338d1ad80 100644 --- a/internal/service/chimesdkvoice/service_endpoints_gen_test.go +++ b/internal/service/chimesdkvoice/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cleanrooms/service_endpoints_gen_test.go b/internal/service/cleanrooms/service_endpoints_gen_test.go index 9a2781aaaf1..9aa22a8f1a7 100644 --- a/internal/service/cleanrooms/service_endpoints_gen_test.go +++ b/internal/service/cleanrooms/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cloud9/service_endpoints_gen_test.go b/internal/service/cloud9/service_endpoints_gen_test.go index 65a76ce34e4..a71c4d33511 100644 --- a/internal/service/cloud9/service_endpoints_gen_test.go +++ b/internal/service/cloud9/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cloudcontrol/service_endpoints_gen_test.go b/internal/service/cloudcontrol/service_endpoints_gen_test.go index 1976cb6497d..1692f142e74 100644 --- a/internal/service/cloudcontrol/service_endpoints_gen_test.go +++ b/internal/service/cloudcontrol/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cloudformation/service_endpoints_gen_test.go b/internal/service/cloudformation/service_endpoints_gen_test.go index b72600bf306..f43b47c9e64 100644 --- a/internal/service/cloudformation/service_endpoints_gen_test.go +++ b/internal/service/cloudformation/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -343,6 +343,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cloudfront/service_endpoints_gen_test.go b/internal/service/cloudfront/service_endpoints_gen_test.go index 053968c30a7..9d5e8085952 100644 --- a/internal/service/cloudfront/service_endpoints_gen_test.go +++ b/internal/service/cloudfront/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cloudhsmv2/service_endpoints_gen_test.go b/internal/service/cloudhsmv2/service_endpoints_gen_test.go index 8ad170ec3ba..5fe454d101e 100644 --- a/internal/service/cloudhsmv2/service_endpoints_gen_test.go +++ b/internal/service/cloudhsmv2/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cloudsearch/service_endpoints_gen_test.go b/internal/service/cloudsearch/service_endpoints_gen_test.go index d3894ce5dcb..9a4b9913426 100644 --- a/internal/service/cloudsearch/service_endpoints_gen_test.go +++ b/internal/service/cloudsearch/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cloudtrail/service_endpoints_gen_test.go b/internal/service/cloudtrail/service_endpoints_gen_test.go index 4c0bc780da1..22a8575dccb 100644 --- a/internal/service/cloudtrail/service_endpoints_gen_test.go +++ b/internal/service/cloudtrail/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cloudwatch/service_endpoints_gen_test.go b/internal/service/cloudwatch/service_endpoints_gen_test.go index 54ea0ef08c3..9ccb32de420 100644 --- a/internal/service/cloudwatch/service_endpoints_gen_test.go +++ b/internal/service/cloudwatch/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/codeartifact/service_endpoints_gen_test.go b/internal/service/codeartifact/service_endpoints_gen_test.go index cb61b10006d..654705532fb 100644 --- a/internal/service/codeartifact/service_endpoints_gen_test.go +++ b/internal/service/codeartifact/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/codebuild/service_endpoints_gen_test.go b/internal/service/codebuild/service_endpoints_gen_test.go index 8deb044d1a4..e69c4734c9a 100644 --- a/internal/service/codebuild/service_endpoints_gen_test.go +++ b/internal/service/codebuild/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/codecommit/service_endpoints_gen_test.go b/internal/service/codecommit/service_endpoints_gen_test.go index 4691c5afa62..fb555e6b8ad 100644 --- a/internal/service/codecommit/service_endpoints_gen_test.go +++ b/internal/service/codecommit/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/codeguruprofiler/service_endpoints_gen_test.go b/internal/service/codeguruprofiler/service_endpoints_gen_test.go index 0de077e820e..1ee72b8e10a 100644 --- a/internal/service/codeguruprofiler/service_endpoints_gen_test.go +++ b/internal/service/codeguruprofiler/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/codegurureviewer/service_endpoints_gen_test.go b/internal/service/codegurureviewer/service_endpoints_gen_test.go index 0963444088a..2f83259e47c 100644 --- a/internal/service/codegurureviewer/service_endpoints_gen_test.go +++ b/internal/service/codegurureviewer/service_endpoints_gen_test.go @@ -217,7 +217,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -344,6 +344,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/codepipeline/service_endpoints_gen_test.go b/internal/service/codepipeline/service_endpoints_gen_test.go index c2d71821ae2..49d4863fb47 100644 --- a/internal/service/codepipeline/service_endpoints_gen_test.go +++ b/internal/service/codepipeline/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/codestarconnections/service_endpoints_gen_test.go b/internal/service/codestarconnections/service_endpoints_gen_test.go index e6aaaa15761..6a9ca491ef4 100644 --- a/internal/service/codestarconnections/service_endpoints_gen_test.go +++ b/internal/service/codestarconnections/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/codestarnotifications/service_endpoints_gen_test.go b/internal/service/codestarnotifications/service_endpoints_gen_test.go index 8813fefbf5c..f0445e8fcec 100644 --- a/internal/service/codestarnotifications/service_endpoints_gen_test.go +++ b/internal/service/codestarnotifications/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cognitoidentity/service_endpoints_gen_test.go b/internal/service/cognitoidentity/service_endpoints_gen_test.go index a82fafe7efc..7962ad305df 100644 --- a/internal/service/cognitoidentity/service_endpoints_gen_test.go +++ b/internal/service/cognitoidentity/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -343,6 +343,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/cognitoidp/service_endpoints_gen_test.go b/internal/service/cognitoidp/service_endpoints_gen_test.go index fe3220f8594..e1185f511cd 100644 --- a/internal/service/cognitoidp/service_endpoints_gen_test.go +++ b/internal/service/cognitoidp/service_endpoints_gen_test.go @@ -267,7 +267,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -402,6 +402,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/comprehend/service_endpoints_gen_test.go b/internal/service/comprehend/service_endpoints_gen_test.go index 57e9b69e6a3..59d33d00417 100644 --- a/internal/service/comprehend/service_endpoints_gen_test.go +++ b/internal/service/comprehend/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/computeoptimizer/service_endpoints_gen_test.go b/internal/service/computeoptimizer/service_endpoints_gen_test.go index 2402dc91f5d..d3d4b02bf40 100644 --- a/internal/service/computeoptimizer/service_endpoints_gen_test.go +++ b/internal/service/computeoptimizer/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/configservice/service_endpoints_gen_test.go b/internal/service/configservice/service_endpoints_gen_test.go index b68e3bc36ef..13cc7526cd9 100644 --- a/internal/service/configservice/service_endpoints_gen_test.go +++ b/internal/service/configservice/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/connect/service_endpoints_gen_test.go b/internal/service/connect/service_endpoints_gen_test.go index e3aa1e34440..16bc1fc07d1 100644 --- a/internal/service/connect/service_endpoints_gen_test.go +++ b/internal/service/connect/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/connectcases/service_endpoints_gen_test.go b/internal/service/connectcases/service_endpoints_gen_test.go index d7ceb380c6f..1fb87b8888f 100644 --- a/internal/service/connectcases/service_endpoints_gen_test.go +++ b/internal/service/connectcases/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/controltower/service_endpoints_gen_test.go b/internal/service/controltower/service_endpoints_gen_test.go index b4d9f54384e..62b58f4657b 100644 --- a/internal/service/controltower/service_endpoints_gen_test.go +++ b/internal/service/controltower/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/costoptimizationhub/service_endpoints_gen_test.go b/internal/service/costoptimizationhub/service_endpoints_gen_test.go index 893acc78f54..6af05a9f555 100644 --- a/internal/service/costoptimizationhub/service_endpoints_gen_test.go +++ b/internal/service/costoptimizationhub/service_endpoints_gen_test.go @@ -77,7 +77,9 @@ const ( func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 - const expectedEndpointRegion = providerRegion + // Cost Optimization Hub has a single regional endpoint + // However, the AWS SDK's endpoint resolution returns one for whatever region you're using + const expectedEndpointRegion = "us-east-1" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ "no config": { @@ -216,7 +218,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -334,48 +336,49 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: "us-east-1", } } func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-east-1", } } func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: "us-east-1", } } diff --git a/internal/service/costoptimizationhub/service_package.go b/internal/service/costoptimizationhub/service_package.go index ef035f5ff3a..db43c01421e 100644 --- a/internal/service/costoptimizationhub/service_package.go +++ b/internal/service/costoptimizationhub/service_package.go @@ -17,6 +17,11 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( cfg := *(config["aws_sdkv2_config"].(*aws.Config)) return costoptimizationhub.NewFromConfig(cfg, func(o *costoptimizationhub.Options) { + if config["partition"].(string) == names.StandardPartitionID { + // Cost Optimization Hub endpoint is available only in us-east-1 Region. + o.Region = names.USEast1RegionID + } + if endpoint := config[names.AttrEndpoint].(string); endpoint != "" { tflog.Debug(ctx, "setting endpoint", map[string]any{ "tf_aws.endpoint": endpoint, @@ -27,9 +32,6 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( tflog.Debug(ctx, "endpoint set, ignoring UseFIPSEndpoint setting") o.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateDisabled } - } else if config["partition"].(string) == names.StandardPartitionID { - // Cost Optimization Hub endpoint is available only in us-east-1 Region. - o.Region = names.USEast1RegionID } }), nil } diff --git a/internal/service/cur/service_endpoints_gen_test.go b/internal/service/cur/service_endpoints_gen_test.go index 9f6152fb960..5ada6b83d3f 100644 --- a/internal/service/cur/service_endpoints_gen_test.go +++ b/internal/service/cur/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/customerprofiles/service_endpoints_gen_test.go b/internal/service/customerprofiles/service_endpoints_gen_test.go index 7e8d98ac44b..00ff71d2df9 100644 --- a/internal/service/customerprofiles/service_endpoints_gen_test.go +++ b/internal/service/customerprofiles/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/dataexchange/service_endpoints_gen_test.go b/internal/service/dataexchange/service_endpoints_gen_test.go index 87e33c10b71..838d252fbda 100644 --- a/internal/service/dataexchange/service_endpoints_gen_test.go +++ b/internal/service/dataexchange/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/datapipeline/service_endpoints_gen_test.go b/internal/service/datapipeline/service_endpoints_gen_test.go index fa92028fa06..5f11dec05fe 100644 --- a/internal/service/datapipeline/service_endpoints_gen_test.go +++ b/internal/service/datapipeline/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/datasync/service_endpoints_gen_test.go b/internal/service/datasync/service_endpoints_gen_test.go index f9a25f123b8..1f456e28c47 100644 --- a/internal/service/datasync/service_endpoints_gen_test.go +++ b/internal/service/datasync/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/datazone/service_endpoints_gen_test.go b/internal/service/datazone/service_endpoints_gen_test.go index fd5102c7f38..050dbb715de 100644 --- a/internal/service/datazone/service_endpoints_gen_test.go +++ b/internal/service/datazone/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/dax/service_endpoints_gen_test.go b/internal/service/dax/service_endpoints_gen_test.go index da54384f371..63ccc07a6e3 100644 --- a/internal/service/dax/service_endpoints_gen_test.go +++ b/internal/service/dax/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/deploy/service_endpoints_gen_test.go b/internal/service/deploy/service_endpoints_gen_test.go index 5638512178c..715ff17e2fc 100644 --- a/internal/service/deploy/service_endpoints_gen_test.go +++ b/internal/service/deploy/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/detective/service_endpoints_gen_test.go b/internal/service/detective/service_endpoints_gen_test.go index b577eed713f..8c31fef9387 100644 --- a/internal/service/detective/service_endpoints_gen_test.go +++ b/internal/service/detective/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/devicefarm/service_endpoints_gen_test.go b/internal/service/devicefarm/service_endpoints_gen_test.go index c70899c3125..ee2d9996962 100644 --- a/internal/service/devicefarm/service_endpoints_gen_test.go +++ b/internal/service/devicefarm/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/devopsguru/service_endpoints_gen_test.go b/internal/service/devopsguru/service_endpoints_gen_test.go index b1c84fab8ed..24e05cc7112 100644 --- a/internal/service/devopsguru/service_endpoints_gen_test.go +++ b/internal/service/devopsguru/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/directconnect/service_endpoints_gen_test.go b/internal/service/directconnect/service_endpoints_gen_test.go index 4bc9990928a..261e5062ff0 100644 --- a/internal/service/directconnect/service_endpoints_gen_test.go +++ b/internal/service/directconnect/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/dlm/service_endpoints_gen_test.go b/internal/service/dlm/service_endpoints_gen_test.go index f1bc623d56f..7357ec27d1b 100644 --- a/internal/service/dlm/service_endpoints_gen_test.go +++ b/internal/service/dlm/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/dms/service_endpoints_gen_test.go b/internal/service/dms/service_endpoints_gen_test.go index 7150273745c..019f7701806 100644 --- a/internal/service/dms/service_endpoints_gen_test.go +++ b/internal/service/dms/service_endpoints_gen_test.go @@ -326,7 +326,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -472,6 +472,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/docdb/service_endpoints_gen_test.go b/internal/service/docdb/service_endpoints_gen_test.go index b1086cb4f25..7ea095ce11b 100644 --- a/internal/service/docdb/service_endpoints_gen_test.go +++ b/internal/service/docdb/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/docdbelastic/service_endpoints_gen_test.go b/internal/service/docdbelastic/service_endpoints_gen_test.go index b3b0898a8bf..59bfb2a445c 100644 --- a/internal/service/docdbelastic/service_endpoints_gen_test.go +++ b/internal/service/docdbelastic/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/drs/service_endpoints_gen_test.go b/internal/service/drs/service_endpoints_gen_test.go index 652a1c8007d..57e23a53040 100644 --- a/internal/service/drs/service_endpoints_gen_test.go +++ b/internal/service/drs/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ds/service_endpoints_gen_test.go b/internal/service/ds/service_endpoints_gen_test.go index a5397c18574..209bcff0474 100644 --- a/internal/service/ds/service_endpoints_gen_test.go +++ b/internal/service/ds/service_endpoints_gen_test.go @@ -273,7 +273,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -444,6 +444,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/dynamodb/service_endpoints_gen_test.go b/internal/service/dynamodb/service_endpoints_gen_test.go index d048bad912e..84b6b7a6579 100644 --- a/internal/service/dynamodb/service_endpoints_gen_test.go +++ b/internal/service/dynamodb/service_endpoints_gen_test.go @@ -326,7 +326,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -459,6 +459,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ec2/service_endpoints_gen_test.go b/internal/service/ec2/service_endpoints_gen_test.go index 9fd673f9b51..c13c883b5cc 100644 --- a/internal/service/ec2/service_endpoints_gen_test.go +++ b/internal/service/ec2/service_endpoints_gen_test.go @@ -219,7 +219,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -371,6 +371,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ecr/service_endpoints_gen_test.go b/internal/service/ecr/service_endpoints_gen_test.go index c87ad1be4d5..fda423a88dd 100644 --- a/internal/service/ecr/service_endpoints_gen_test.go +++ b/internal/service/ecr/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ecrpublic/service_endpoints_gen_test.go b/internal/service/ecrpublic/service_endpoints_gen_test.go index 276f055ca8f..d3de88e3cff 100644 --- a/internal/service/ecrpublic/service_endpoints_gen_test.go +++ b/internal/service/ecrpublic/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ecs/service_endpoints_gen_test.go b/internal/service/ecs/service_endpoints_gen_test.go index 707fd2a9a7c..8d678703935 100644 --- a/internal/service/ecs/service_endpoints_gen_test.go +++ b/internal/service/ecs/service_endpoints_gen_test.go @@ -219,7 +219,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -371,6 +371,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/efs/service_endpoints_gen_test.go b/internal/service/efs/service_endpoints_gen_test.go index 07909ce9643..8b1a46893fb 100644 --- a/internal/service/efs/service_endpoints_gen_test.go +++ b/internal/service/efs/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/eks/service_endpoints_gen_test.go b/internal/service/eks/service_endpoints_gen_test.go index 2a9cbb4a202..c77c09d7f6a 100644 --- a/internal/service/eks/service_endpoints_gen_test.go +++ b/internal/service/eks/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/elasticache/service_endpoints_gen_test.go b/internal/service/elasticache/service_endpoints_gen_test.go index 463965f5353..b0ce9e0eb2c 100644 --- a/internal/service/elasticache/service_endpoints_gen_test.go +++ b/internal/service/elasticache/service_endpoints_gen_test.go @@ -219,7 +219,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -371,6 +371,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go index 8209ad02b3e..d3697ef233d 100644 --- a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go +++ b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/elasticsearch/service_endpoints_gen_test.go b/internal/service/elasticsearch/service_endpoints_gen_test.go index aa5bd68d8cc..a0eef700e14 100644 --- a/internal/service/elasticsearch/service_endpoints_gen_test.go +++ b/internal/service/elasticsearch/service_endpoints_gen_test.go @@ -326,7 +326,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -472,6 +472,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/elastictranscoder/service_endpoints_gen_test.go b/internal/service/elastictranscoder/service_endpoints_gen_test.go index 0b3d88492fb..0797c47abd4 100644 --- a/internal/service/elastictranscoder/service_endpoints_gen_test.go +++ b/internal/service/elastictranscoder/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/elb/service_endpoints_gen_test.go b/internal/service/elb/service_endpoints_gen_test.go index f9164c8e0f5..549fe139859 100644 --- a/internal/service/elb/service_endpoints_gen_test.go +++ b/internal/service/elb/service_endpoints_gen_test.go @@ -267,7 +267,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -402,6 +402,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/elbv2/service_endpoints_gen_test.go b/internal/service/elbv2/service_endpoints_gen_test.go index 59ccb82951a..7fd32ab374b 100644 --- a/internal/service/elbv2/service_endpoints_gen_test.go +++ b/internal/service/elbv2/service_endpoints_gen_test.go @@ -273,7 +273,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -444,6 +444,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/emr/service_endpoints_gen_test.go b/internal/service/emr/service_endpoints_gen_test.go index f6dd828838f..72143df3a22 100644 --- a/internal/service/emr/service_endpoints_gen_test.go +++ b/internal/service/emr/service_endpoints_gen_test.go @@ -219,7 +219,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -371,6 +371,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/emrcontainers/service_endpoints_gen_test.go b/internal/service/emrcontainers/service_endpoints_gen_test.go index feeeccc75ae..f88bc20e660 100644 --- a/internal/service/emrcontainers/service_endpoints_gen_test.go +++ b/internal/service/emrcontainers/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/emrserverless/service_endpoints_gen_test.go b/internal/service/emrserverless/service_endpoints_gen_test.go index d832012c1bf..3dfd652ebaf 100644 --- a/internal/service/emrserverless/service_endpoints_gen_test.go +++ b/internal/service/emrserverless/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/events/service_endpoints_gen_test.go b/internal/service/events/service_endpoints_gen_test.go index e37660b9399..f194deb0208 100644 --- a/internal/service/events/service_endpoints_gen_test.go +++ b/internal/service/events/service_endpoints_gen_test.go @@ -329,7 +329,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -484,6 +484,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/evidently/service_endpoints_gen_test.go b/internal/service/evidently/service_endpoints_gen_test.go index cebb234f75d..80244a0d4b9 100644 --- a/internal/service/evidently/service_endpoints_gen_test.go +++ b/internal/service/evidently/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/finspace/service_endpoints_gen_test.go b/internal/service/finspace/service_endpoints_gen_test.go index bb8b61cb1ff..e673162ecaf 100644 --- a/internal/service/finspace/service_endpoints_gen_test.go +++ b/internal/service/finspace/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/firehose/service_endpoints_gen_test.go b/internal/service/firehose/service_endpoints_gen_test.go index 0405fd79b85..da0bd752bef 100644 --- a/internal/service/firehose/service_endpoints_gen_test.go +++ b/internal/service/firehose/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/fis/service_endpoints_gen_test.go b/internal/service/fis/service_endpoints_gen_test.go index 6eb475b0e9f..08f5764d5b4 100644 --- a/internal/service/fis/service_endpoints_gen_test.go +++ b/internal/service/fis/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/fms/service_endpoints_gen_test.go b/internal/service/fms/service_endpoints_gen_test.go index f70d66b3664..43520a4b881 100644 --- a/internal/service/fms/service_endpoints_gen_test.go +++ b/internal/service/fms/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -343,6 +343,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/fsx/service_endpoints_gen_test.go b/internal/service/fsx/service_endpoints_gen_test.go index 9061bd73374..d42b7662596 100644 --- a/internal/service/fsx/service_endpoints_gen_test.go +++ b/internal/service/fsx/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/gamelift/service_endpoints_gen_test.go b/internal/service/gamelift/service_endpoints_gen_test.go index 7aef9521ffe..abb0af5d8f8 100644 --- a/internal/service/gamelift/service_endpoints_gen_test.go +++ b/internal/service/gamelift/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/glacier/service_endpoints_gen_test.go b/internal/service/glacier/service_endpoints_gen_test.go index d79db986a0b..3561731803f 100644 --- a/internal/service/glacier/service_endpoints_gen_test.go +++ b/internal/service/glacier/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/globalaccelerator/service_endpoints_gen_test.go b/internal/service/globalaccelerator/service_endpoints_gen_test.go index 786265dcee5..e1058d85ecc 100644 --- a/internal/service/globalaccelerator/service_endpoints_gen_test.go +++ b/internal/service/globalaccelerator/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/glue/service_endpoints_gen_test.go b/internal/service/glue/service_endpoints_gen_test.go index 4356c470f73..7b1a4daef11 100644 --- a/internal/service/glue/service_endpoints_gen_test.go +++ b/internal/service/glue/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/grafana/service_endpoints_gen_test.go b/internal/service/grafana/service_endpoints_gen_test.go index f8ac5445538..923e647d3a8 100644 --- a/internal/service/grafana/service_endpoints_gen_test.go +++ b/internal/service/grafana/service_endpoints_gen_test.go @@ -326,7 +326,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -472,6 +472,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/greengrass/service_endpoints_gen_test.go b/internal/service/greengrass/service_endpoints_gen_test.go index 50744c22479..581afb59123 100644 --- a/internal/service/greengrass/service_endpoints_gen_test.go +++ b/internal/service/greengrass/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/groundstation/service_endpoints_gen_test.go b/internal/service/groundstation/service_endpoints_gen_test.go index 1c412c1088d..e556942ed58 100644 --- a/internal/service/groundstation/service_endpoints_gen_test.go +++ b/internal/service/groundstation/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/guardduty/service_endpoints_gen_test.go b/internal/service/guardduty/service_endpoints_gen_test.go index 2fbdf000f0f..71935273cfa 100644 --- a/internal/service/guardduty/service_endpoints_gen_test.go +++ b/internal/service/guardduty/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/healthlake/service_endpoints_gen_test.go b/internal/service/healthlake/service_endpoints_gen_test.go index 141cf631d61..898baf1323d 100644 --- a/internal/service/healthlake/service_endpoints_gen_test.go +++ b/internal/service/healthlake/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/iam/service_endpoints_gen_test.go b/internal/service/iam/service_endpoints_gen_test.go index 2384fbd8971..470ffc03dc6 100644 --- a/internal/service/iam/service_endpoints_gen_test.go +++ b/internal/service/iam/service_endpoints_gen_test.go @@ -326,7 +326,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -459,6 +459,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/identitystore/service_endpoints_gen_test.go b/internal/service/identitystore/service_endpoints_gen_test.go index e8479602ca9..6efa9d726cd 100644 --- a/internal/service/identitystore/service_endpoints_gen_test.go +++ b/internal/service/identitystore/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -343,6 +343,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/imagebuilder/service_endpoints_gen_test.go b/internal/service/imagebuilder/service_endpoints_gen_test.go index 5b2f1512e20..9c69c25619a 100644 --- a/internal/service/imagebuilder/service_endpoints_gen_test.go +++ b/internal/service/imagebuilder/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -332,6 +332,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/inspector/service_endpoints_gen_test.go b/internal/service/inspector/service_endpoints_gen_test.go index 053bd8653ab..d03fa2e9acc 100644 --- a/internal/service/inspector/service_endpoints_gen_test.go +++ b/internal/service/inspector/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/inspector2/service_endpoints_gen_test.go b/internal/service/inspector2/service_endpoints_gen_test.go index 86c46123946..1f317e757d5 100644 --- a/internal/service/inspector2/service_endpoints_gen_test.go +++ b/internal/service/inspector2/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/internetmonitor/service_endpoints_gen_test.go b/internal/service/internetmonitor/service_endpoints_gen_test.go index e20284d4bf2..f38c4a32aaa 100644 --- a/internal/service/internetmonitor/service_endpoints_gen_test.go +++ b/internal/service/internetmonitor/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/iot/service_endpoints_gen_test.go b/internal/service/iot/service_endpoints_gen_test.go index 265141f7fd5..3a6698acad2 100644 --- a/internal/service/iot/service_endpoints_gen_test.go +++ b/internal/service/iot/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/iotanalytics/service_endpoints_gen_test.go b/internal/service/iotanalytics/service_endpoints_gen_test.go index 76d3f7040b0..ac52ccc6379 100644 --- a/internal/service/iotanalytics/service_endpoints_gen_test.go +++ b/internal/service/iotanalytics/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/iotevents/service_endpoints_gen_test.go b/internal/service/iotevents/service_endpoints_gen_test.go index a5c6790c829..9b9cd7860d3 100644 --- a/internal/service/iotevents/service_endpoints_gen_test.go +++ b/internal/service/iotevents/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ivs/service_endpoints_gen_test.go b/internal/service/ivs/service_endpoints_gen_test.go index 9655c8f08da..cc6063199d1 100644 --- a/internal/service/ivs/service_endpoints_gen_test.go +++ b/internal/service/ivs/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ivschat/service_endpoints_gen_test.go b/internal/service/ivschat/service_endpoints_gen_test.go index cb67ac3095a..c719bdb3fb9 100644 --- a/internal/service/ivschat/service_endpoints_gen_test.go +++ b/internal/service/ivschat/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/kafka/service_endpoints_gen_test.go b/internal/service/kafka/service_endpoints_gen_test.go index 3151243d585..e6d5a215b39 100644 --- a/internal/service/kafka/service_endpoints_gen_test.go +++ b/internal/service/kafka/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/kafkaconnect/service_endpoints_gen_test.go b/internal/service/kafkaconnect/service_endpoints_gen_test.go index ec22dec5490..ed07d076f79 100644 --- a/internal/service/kafkaconnect/service_endpoints_gen_test.go +++ b/internal/service/kafkaconnect/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/kendra/service_endpoints_gen_test.go b/internal/service/kendra/service_endpoints_gen_test.go index d7a0bf19606..018d4b06fe4 100644 --- a/internal/service/kendra/service_endpoints_gen_test.go +++ b/internal/service/kendra/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/keyspaces/service_endpoints_gen_test.go b/internal/service/keyspaces/service_endpoints_gen_test.go index 8a99d34ac11..f0484ebff64 100644 --- a/internal/service/keyspaces/service_endpoints_gen_test.go +++ b/internal/service/keyspaces/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/kinesis/service_endpoints_gen_test.go b/internal/service/kinesis/service_endpoints_gen_test.go index 451736d03b9..7c9aeeba128 100644 --- a/internal/service/kinesis/service_endpoints_gen_test.go +++ b/internal/service/kinesis/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/kinesisanalytics/service_endpoints_gen_test.go b/internal/service/kinesisanalytics/service_endpoints_gen_test.go index 65956ff61c7..aaccc6a55f6 100644 --- a/internal/service/kinesisanalytics/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalytics/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go index d550deca391..593f02a837d 100644 --- a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/kinesisvideo/service_endpoints_gen_test.go b/internal/service/kinesisvideo/service_endpoints_gen_test.go index db17c5c5e64..33697a16d41 100644 --- a/internal/service/kinesisvideo/service_endpoints_gen_test.go +++ b/internal/service/kinesisvideo/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/kms/service_endpoints_gen_test.go b/internal/service/kms/service_endpoints_gen_test.go index dcc8a9b3c42..82b301eb763 100644 --- a/internal/service/kms/service_endpoints_gen_test.go +++ b/internal/service/kms/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/lakeformation/service_endpoints_gen_test.go b/internal/service/lakeformation/service_endpoints_gen_test.go index 2cfee9446a9..55c4b8da4c2 100644 --- a/internal/service/lakeformation/service_endpoints_gen_test.go +++ b/internal/service/lakeformation/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/lambda/service_endpoints_gen_test.go b/internal/service/lambda/service_endpoints_gen_test.go index c01dfd25841..43d0f62b39d 100644 --- a/internal/service/lambda/service_endpoints_gen_test.go +++ b/internal/service/lambda/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/launchwizard/service_endpoints_gen_test.go b/internal/service/launchwizard/service_endpoints_gen_test.go index b63fa60dc83..6289506c29c 100644 --- a/internal/service/launchwizard/service_endpoints_gen_test.go +++ b/internal/service/launchwizard/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/lexmodels/service_endpoints_gen_test.go b/internal/service/lexmodels/service_endpoints_gen_test.go index 292dc27b757..3aa7523d0d1 100644 --- a/internal/service/lexmodels/service_endpoints_gen_test.go +++ b/internal/service/lexmodels/service_endpoints_gen_test.go @@ -393,7 +393,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -550,6 +550,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/lexv2models/service_endpoints_gen_test.go b/internal/service/lexv2models/service_endpoints_gen_test.go index a34ee670692..22b7508ce2f 100644 --- a/internal/service/lexv2models/service_endpoints_gen_test.go +++ b/internal/service/lexv2models/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/licensemanager/service_endpoints_gen_test.go b/internal/service/licensemanager/service_endpoints_gen_test.go index 0faa571e235..0bd6ca94100 100644 --- a/internal/service/licensemanager/service_endpoints_gen_test.go +++ b/internal/service/licensemanager/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/lightsail/service_endpoints_gen_test.go b/internal/service/lightsail/service_endpoints_gen_test.go index 1fbd146b152..05895388adc 100644 --- a/internal/service/lightsail/service_endpoints_gen_test.go +++ b/internal/service/lightsail/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/location/service_endpoints_gen_test.go b/internal/service/location/service_endpoints_gen_test.go index 2f217365c21..d52bdd9ae2d 100644 --- a/internal/service/location/service_endpoints_gen_test.go +++ b/internal/service/location/service_endpoints_gen_test.go @@ -267,7 +267,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -402,6 +402,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/logs/service_endpoints_gen_test.go b/internal/service/logs/service_endpoints_gen_test.go index 442f6ebc3be..a4b4c83da6a 100644 --- a/internal/service/logs/service_endpoints_gen_test.go +++ b/internal/service/logs/service_endpoints_gen_test.go @@ -329,7 +329,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -484,6 +484,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/lookoutmetrics/service_endpoints_gen_test.go b/internal/service/lookoutmetrics/service_endpoints_gen_test.go index da910cbf8b3..49462347af1 100644 --- a/internal/service/lookoutmetrics/service_endpoints_gen_test.go +++ b/internal/service/lookoutmetrics/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/m2/service_endpoints_gen_test.go b/internal/service/m2/service_endpoints_gen_test.go index 8ec0aad3862..c4efea5b153 100644 --- a/internal/service/m2/service_endpoints_gen_test.go +++ b/internal/service/m2/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/macie2/service_endpoints_gen_test.go b/internal/service/macie2/service_endpoints_gen_test.go index 5a070c96908..a3169123bb0 100644 --- a/internal/service/macie2/service_endpoints_gen_test.go +++ b/internal/service/macie2/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/mediaconnect/service_endpoints_gen_test.go b/internal/service/mediaconnect/service_endpoints_gen_test.go index e7bc3084c36..8d05148011a 100644 --- a/internal/service/mediaconnect/service_endpoints_gen_test.go +++ b/internal/service/mediaconnect/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/mediaconvert/service_endpoints_gen_test.go b/internal/service/mediaconvert/service_endpoints_gen_test.go index 364f62b855b..279e79a4403 100644 --- a/internal/service/mediaconvert/service_endpoints_gen_test.go +++ b/internal/service/mediaconvert/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/medialive/service_endpoints_gen_test.go b/internal/service/medialive/service_endpoints_gen_test.go index 6ef17b824e4..bd1aaac0e17 100644 --- a/internal/service/medialive/service_endpoints_gen_test.go +++ b/internal/service/medialive/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/mediapackage/service_endpoints_gen_test.go b/internal/service/mediapackage/service_endpoints_gen_test.go index 4e96cd3947c..173b0fe859a 100644 --- a/internal/service/mediapackage/service_endpoints_gen_test.go +++ b/internal/service/mediapackage/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/mediapackagev2/service_endpoints_gen_test.go b/internal/service/mediapackagev2/service_endpoints_gen_test.go index 2c015d02d08..3acfaff7fa5 100644 --- a/internal/service/mediapackagev2/service_endpoints_gen_test.go +++ b/internal/service/mediapackagev2/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/mediastore/service_endpoints_gen_test.go b/internal/service/mediastore/service_endpoints_gen_test.go index 0922866e573..6e0aae00546 100644 --- a/internal/service/mediastore/service_endpoints_gen_test.go +++ b/internal/service/mediastore/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/memorydb/service_endpoints_gen_test.go b/internal/service/memorydb/service_endpoints_gen_test.go index d79a8418cb2..c682aecd312 100644 --- a/internal/service/memorydb/service_endpoints_gen_test.go +++ b/internal/service/memorydb/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/mq/service_endpoints_gen_test.go b/internal/service/mq/service_endpoints_gen_test.go index 5a2373caaad..a9005632141 100644 --- a/internal/service/mq/service_endpoints_gen_test.go +++ b/internal/service/mq/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/neptune/service_endpoints_gen_test.go b/internal/service/neptune/service_endpoints_gen_test.go index f72a38daff9..981aa85f9a5 100644 --- a/internal/service/neptune/service_endpoints_gen_test.go +++ b/internal/service/neptune/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/networkfirewall/service_endpoints_gen_test.go b/internal/service/networkfirewall/service_endpoints_gen_test.go index 15708170853..8daf1c4f059 100644 --- a/internal/service/networkfirewall/service_endpoints_gen_test.go +++ b/internal/service/networkfirewall/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/networkmanager/service_endpoints_gen_test.go b/internal/service/networkmanager/service_endpoints_gen_test.go index 74eb910c3ea..3031cdbb233 100644 --- a/internal/service/networkmanager/service_endpoints_gen_test.go +++ b/internal/service/networkmanager/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/oam/service_endpoints_gen_test.go b/internal/service/oam/service_endpoints_gen_test.go index 9d354ef593a..87204d19e9b 100644 --- a/internal/service/oam/service_endpoints_gen_test.go +++ b/internal/service/oam/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/opensearch/service_endpoints_gen_test.go b/internal/service/opensearch/service_endpoints_gen_test.go index 831a579c8f4..eadf94c5aca 100644 --- a/internal/service/opensearch/service_endpoints_gen_test.go +++ b/internal/service/opensearch/service_endpoints_gen_test.go @@ -267,7 +267,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -402,6 +402,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/opensearchserverless/service_endpoints_gen_test.go b/internal/service/opensearchserverless/service_endpoints_gen_test.go index 24ba65684cd..b2a922b82a4 100644 --- a/internal/service/opensearchserverless/service_endpoints_gen_test.go +++ b/internal/service/opensearchserverless/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/opsworks/service_endpoints_gen_test.go b/internal/service/opsworks/service_endpoints_gen_test.go index 9df1e2ad33e..66a485eb2a3 100644 --- a/internal/service/opsworks/service_endpoints_gen_test.go +++ b/internal/service/opsworks/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/organizations/service_endpoints_gen_test.go b/internal/service/organizations/service_endpoints_gen_test.go index 2ee8737d177..cbf8b7a209e 100644 --- a/internal/service/organizations/service_endpoints_gen_test.go +++ b/internal/service/organizations/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/osis/service_endpoints_gen_test.go b/internal/service/osis/service_endpoints_gen_test.go index 8620075b93b..37fb9ee9c58 100644 --- a/internal/service/osis/service_endpoints_gen_test.go +++ b/internal/service/osis/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/outposts/service_endpoints_gen_test.go b/internal/service/outposts/service_endpoints_gen_test.go index 0f074b790ac..e46b6e42240 100644 --- a/internal/service/outposts/service_endpoints_gen_test.go +++ b/internal/service/outposts/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/pcaconnectorad/service_endpoints_gen_test.go b/internal/service/pcaconnectorad/service_endpoints_gen_test.go index 45f5ae06d59..9d5c592f5b6 100644 --- a/internal/service/pcaconnectorad/service_endpoints_gen_test.go +++ b/internal/service/pcaconnectorad/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/pinpoint/service_endpoints_gen_test.go b/internal/service/pinpoint/service_endpoints_gen_test.go index 0e4576cb12f..18a9e2eff14 100644 --- a/internal/service/pinpoint/service_endpoints_gen_test.go +++ b/internal/service/pinpoint/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/pipes/service_endpoints_gen_test.go b/internal/service/pipes/service_endpoints_gen_test.go index b691f4c0b19..97467aef927 100644 --- a/internal/service/pipes/service_endpoints_gen_test.go +++ b/internal/service/pipes/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/polly/service_endpoints_gen_test.go b/internal/service/polly/service_endpoints_gen_test.go index 54cc7ed6c95..3a286eab79b 100644 --- a/internal/service/polly/service_endpoints_gen_test.go +++ b/internal/service/polly/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/pricing/service_endpoints_gen_test.go b/internal/service/pricing/service_endpoints_gen_test.go index a302b07f614..f2071c71664 100644 --- a/internal/service/pricing/service_endpoints_gen_test.go +++ b/internal/service/pricing/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/qbusiness/service_endpoints_gen_test.go b/internal/service/qbusiness/service_endpoints_gen_test.go index 03e23bb13dd..65ac2e0416f 100644 --- a/internal/service/qbusiness/service_endpoints_gen_test.go +++ b/internal/service/qbusiness/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/qldb/service_endpoints_gen_test.go b/internal/service/qldb/service_endpoints_gen_test.go index e7c41fc71eb..509a91fe81d 100644 --- a/internal/service/qldb/service_endpoints_gen_test.go +++ b/internal/service/qldb/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/quicksight/service_endpoints_gen_test.go b/internal/service/quicksight/service_endpoints_gen_test.go index 44ead5f8667..0ffbbeddab5 100644 --- a/internal/service/quicksight/service_endpoints_gen_test.go +++ b/internal/service/quicksight/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -331,6 +331,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ram/service_endpoints_gen_test.go b/internal/service/ram/service_endpoints_gen_test.go index cc97f4b7b7c..7c78205ab63 100644 --- a/internal/service/ram/service_endpoints_gen_test.go +++ b/internal/service/ram/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/rbin/service_endpoints_gen_test.go b/internal/service/rbin/service_endpoints_gen_test.go index 2de4de719ce..2dba988a2f0 100644 --- a/internal/service/rbin/service_endpoints_gen_test.go +++ b/internal/service/rbin/service_endpoints_gen_test.go @@ -271,7 +271,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -417,6 +417,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/rds/service_endpoints_gen_test.go b/internal/service/rds/service_endpoints_gen_test.go index 32a33b9535b..b63e968e22b 100644 --- a/internal/service/rds/service_endpoints_gen_test.go +++ b/internal/service/rds/service_endpoints_gen_test.go @@ -219,7 +219,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -371,6 +371,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/redshift/service_endpoints_gen_test.go b/internal/service/redshift/service_endpoints_gen_test.go index 8a833f32aa7..7c72dead57a 100644 --- a/internal/service/redshift/service_endpoints_gen_test.go +++ b/internal/service/redshift/service_endpoints_gen_test.go @@ -219,7 +219,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -371,6 +371,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/redshiftdata/service_endpoints_gen_test.go b/internal/service/redshiftdata/service_endpoints_gen_test.go index 025fa76ac0c..9e31e28f29c 100644 --- a/internal/service/redshiftdata/service_endpoints_gen_test.go +++ b/internal/service/redshiftdata/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -416,6 +416,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/redshiftserverless/service_endpoints_gen_test.go b/internal/service/redshiftserverless/service_endpoints_gen_test.go index 8f00ebb3dae..6d9fe73d464 100644 --- a/internal/service/redshiftserverless/service_endpoints_gen_test.go +++ b/internal/service/redshiftserverless/service_endpoints_gen_test.go @@ -219,7 +219,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -371,6 +371,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/rekognition/service_endpoints_gen_test.go b/internal/service/rekognition/service_endpoints_gen_test.go index a094ad04fb5..c1ae2b5bb29 100644 --- a/internal/service/rekognition/service_endpoints_gen_test.go +++ b/internal/service/rekognition/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/resourceexplorer2/service_endpoints_gen_test.go b/internal/service/resourceexplorer2/service_endpoints_gen_test.go index 009ac8bbc23..80bd72471be 100644 --- a/internal/service/resourceexplorer2/service_endpoints_gen_test.go +++ b/internal/service/resourceexplorer2/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/resourcegroups/service_endpoints_gen_test.go b/internal/service/resourcegroups/service_endpoints_gen_test.go index 621b152a8bc..feb8cd9a909 100644 --- a/internal/service/resourcegroups/service_endpoints_gen_test.go +++ b/internal/service/resourcegroups/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go index 9f11765ca87..92dfe745c77 100644 --- a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go +++ b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/rolesanywhere/service_endpoints_gen_test.go b/internal/service/rolesanywhere/service_endpoints_gen_test.go index 041917575aa..8fb6c003c67 100644 --- a/internal/service/rolesanywhere/service_endpoints_gen_test.go +++ b/internal/service/rolesanywhere/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/route53/service_endpoints_gen_test.go b/internal/service/route53/service_endpoints_gen_test.go index e399b8728a0..916152939d3 100644 --- a/internal/service/route53/service_endpoints_gen_test.go +++ b/internal/service/route53/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-east-1", } } diff --git a/internal/service/route53domains/service_endpoints_gen_test.go b/internal/service/route53domains/service_endpoints_gen_test.go index b6f7c174651..6f03d953f94 100644 --- a/internal/service/route53domains/service_endpoints_gen_test.go +++ b/internal/service/route53domains/service_endpoints_gen_test.go @@ -218,7 +218,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -343,6 +343,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-east-1", } } diff --git a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go index 092dd2f3d43..83a21f9a069 100644 --- a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go +++ b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go index ace05bc6cf8..d608dbca691 100644 --- a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go +++ b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -332,6 +332,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/route53resolver/service_endpoints_gen_test.go b/internal/service/route53resolver/service_endpoints_gen_test.go index a909b46b673..26c8559816c 100644 --- a/internal/service/route53resolver/service_endpoints_gen_test.go +++ b/internal/service/route53resolver/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/rum/service_endpoints_gen_test.go b/internal/service/rum/service_endpoints_gen_test.go index 024eb6192d5..36479355d6e 100644 --- a/internal/service/rum/service_endpoints_gen_test.go +++ b/internal/service/rum/service_endpoints_gen_test.go @@ -267,7 +267,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -402,6 +402,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/s3/service_endpoints_gen_test.go b/internal/service/s3/service_endpoints_gen_test.go index 1467a9397b6..84e006bbfa9 100644 --- a/internal/service/s3/service_endpoints_gen_test.go +++ b/internal/service/s3/service_endpoints_gen_test.go @@ -394,7 +394,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -546,6 +546,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/s3outposts/service_endpoints_gen_test.go b/internal/service/s3outposts/service_endpoints_gen_test.go index daf40e38165..87ca2971152 100644 --- a/internal/service/s3outposts/service_endpoints_gen_test.go +++ b/internal/service/s3outposts/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/sagemaker/service_endpoints_gen_test.go b/internal/service/sagemaker/service_endpoints_gen_test.go index 1251d4316d6..1b88316f72c 100644 --- a/internal/service/sagemaker/service_endpoints_gen_test.go +++ b/internal/service/sagemaker/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/scheduler/service_endpoints_gen_test.go b/internal/service/scheduler/service_endpoints_gen_test.go index 6a7f48fca4c..f3457019f19 100644 --- a/internal/service/scheduler/service_endpoints_gen_test.go +++ b/internal/service/scheduler/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/schemas/service_endpoints_gen_test.go b/internal/service/schemas/service_endpoints_gen_test.go index 8f2e7b751b1..d865e65f171 100644 --- a/internal/service/schemas/service_endpoints_gen_test.go +++ b/internal/service/schemas/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/secretsmanager/service_endpoints_gen_test.go b/internal/service/secretsmanager/service_endpoints_gen_test.go index 6c86fe874e8..a80c09bc23d 100644 --- a/internal/service/secretsmanager/service_endpoints_gen_test.go +++ b/internal/service/secretsmanager/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/securityhub/service_endpoints_gen_test.go b/internal/service/securityhub/service_endpoints_gen_test.go index bf08932ca97..613072f5f02 100644 --- a/internal/service/securityhub/service_endpoints_gen_test.go +++ b/internal/service/securityhub/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/securitylake/service_endpoints_gen_test.go b/internal/service/securitylake/service_endpoints_gen_test.go index e10b2ceacbd..fef4cbfca31 100644 --- a/internal/service/securitylake/service_endpoints_gen_test.go +++ b/internal/service/securitylake/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/serverlessrepo/service_endpoints_gen_test.go b/internal/service/serverlessrepo/service_endpoints_gen_test.go index 3086c306bfa..c319282c73c 100644 --- a/internal/service/serverlessrepo/service_endpoints_gen_test.go +++ b/internal/service/serverlessrepo/service_endpoints_gen_test.go @@ -326,7 +326,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -472,6 +472,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/servicecatalog/service_endpoints_gen_test.go b/internal/service/servicecatalog/service_endpoints_gen_test.go index 5a11232f0da..0b1fd28eaa3 100644 --- a/internal/service/servicecatalog/service_endpoints_gen_test.go +++ b/internal/service/servicecatalog/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go index 6ad5530bf18..0639df20380 100644 --- a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go +++ b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/servicediscovery/service_endpoints_gen_test.go b/internal/service/servicediscovery/service_endpoints_gen_test.go index eda90bf434d..364fabd4ce7 100644 --- a/internal/service/servicediscovery/service_endpoints_gen_test.go +++ b/internal/service/servicediscovery/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/servicequotas/service_endpoints_gen_test.go b/internal/service/servicequotas/service_endpoints_gen_test.go index ff588d54d17..e0b974ad80a 100644 --- a/internal/service/servicequotas/service_endpoints_gen_test.go +++ b/internal/service/servicequotas/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ses/service_endpoints_gen_test.go b/internal/service/ses/service_endpoints_gen_test.go index 2c65be024db..f2bcbc57f7c 100644 --- a/internal/service/ses/service_endpoints_gen_test.go +++ b/internal/service/ses/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/sesv2/service_endpoints_gen_test.go b/internal/service/sesv2/service_endpoints_gen_test.go index 1165dc0d663..be29063e294 100644 --- a/internal/service/sesv2/service_endpoints_gen_test.go +++ b/internal/service/sesv2/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/sfn/service_endpoints_gen_test.go b/internal/service/sfn/service_endpoints_gen_test.go index c522c95a377..c60eef49fa6 100644 --- a/internal/service/sfn/service_endpoints_gen_test.go +++ b/internal/service/sfn/service_endpoints_gen_test.go @@ -267,7 +267,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -402,6 +402,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/shield/service_endpoints_gen_test.go b/internal/service/shield/service_endpoints_gen_test.go index 08f363af585..53ca531b463 100644 --- a/internal/service/shield/service_endpoints_gen_test.go +++ b/internal/service/shield/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-east-1", } } diff --git a/internal/service/signer/service_endpoints_gen_test.go b/internal/service/signer/service_endpoints_gen_test.go index 0e2057b53b0..c8c938e1846 100644 --- a/internal/service/signer/service_endpoints_gen_test.go +++ b/internal/service/signer/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/simpledb/service_endpoints_gen_test.go b/internal/service/simpledb/service_endpoints_gen_test.go index 569d45bd00e..4485cdda6ec 100644 --- a/internal/service/simpledb/service_endpoints_gen_test.go +++ b/internal/service/simpledb/service_endpoints_gen_test.go @@ -267,7 +267,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -402,6 +402,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/sns/service_endpoints_gen_test.go b/internal/service/sns/service_endpoints_gen_test.go index 2f63b368c16..c4b7f1a0eb3 100644 --- a/internal/service/sns/service_endpoints_gen_test.go +++ b/internal/service/sns/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/sqs/service_endpoints_gen_test.go b/internal/service/sqs/service_endpoints_gen_test.go index d50234f962e..d16c0f1cded 100644 --- a/internal/service/sqs/service_endpoints_gen_test.go +++ b/internal/service/sqs/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ssm/service_endpoints_gen_test.go b/internal/service/ssm/service_endpoints_gen_test.go index e2bc5f82112..2676b633166 100644 --- a/internal/service/ssm/service_endpoints_gen_test.go +++ b/internal/service/ssm/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ssmcontacts/service_endpoints_gen_test.go b/internal/service/ssmcontacts/service_endpoints_gen_test.go index 56ab194925a..41263d24207 100644 --- a/internal/service/ssmcontacts/service_endpoints_gen_test.go +++ b/internal/service/ssmcontacts/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ssmincidents/service_endpoints_gen_test.go b/internal/service/ssmincidents/service_endpoints_gen_test.go index 28fcd4cb2c7..3de1cab521f 100644 --- a/internal/service/ssmincidents/service_endpoints_gen_test.go +++ b/internal/service/ssmincidents/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ssmsap/service_endpoints_gen_test.go b/internal/service/ssmsap/service_endpoints_gen_test.go index 3f4595984a8..40fcccc3750 100644 --- a/internal/service/ssmsap/service_endpoints_gen_test.go +++ b/internal/service/ssmsap/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/sso/service_endpoints_gen_test.go b/internal/service/sso/service_endpoints_gen_test.go index 0f4a7efd9db..55a1e27cffa 100644 --- a/internal/service/sso/service_endpoints_gen_test.go +++ b/internal/service/sso/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -343,6 +343,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/ssoadmin/service_endpoints_gen_test.go b/internal/service/ssoadmin/service_endpoints_gen_test.go index d3c3c20a652..325a38d7ec2 100644 --- a/internal/service/ssoadmin/service_endpoints_gen_test.go +++ b/internal/service/ssoadmin/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/storagegateway/service_endpoints_gen_test.go b/internal/service/storagegateway/service_endpoints_gen_test.go index 20f0daa74bf..e6bba441a2a 100644 --- a/internal/service/storagegateway/service_endpoints_gen_test.go +++ b/internal/service/storagegateway/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -329,6 +329,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/sts/service_endpoints_gen_test.go b/internal/service/sts/service_endpoints_gen_test.go index 724d0dcc782..039487231d9 100644 --- a/internal/service/sts/service_endpoints_gen_test.go +++ b/internal/service/sts/service_endpoints_gen_test.go @@ -326,7 +326,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -459,6 +459,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/swf/service_endpoints_gen_test.go b/internal/service/swf/service_endpoints_gen_test.go index 2f20742b2dd..5004e15e17e 100644 --- a/internal/service/swf/service_endpoints_gen_test.go +++ b/internal/service/swf/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -343,6 +343,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/synthetics/service_endpoints_gen_test.go b/internal/service/synthetics/service_endpoints_gen_test.go index 4c0ef4cc543..4d2b58231cb 100644 --- a/internal/service/synthetics/service_endpoints_gen_test.go +++ b/internal/service/synthetics/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go index b49a8accff2..3365150ba32 100644 --- a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go +++ b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/transcribe/service_endpoints_gen_test.go b/internal/service/transcribe/service_endpoints_gen_test.go index 64faf0ba296..58b7c15affe 100644 --- a/internal/service/transcribe/service_endpoints_gen_test.go +++ b/internal/service/transcribe/service_endpoints_gen_test.go @@ -270,7 +270,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -414,6 +414,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/transfer/service_endpoints_gen_test.go b/internal/service/transfer/service_endpoints_gen_test.go index bf4085fdc5e..8c13cac592e 100644 --- a/internal/service/transfer/service_endpoints_gen_test.go +++ b/internal/service/transfer/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/verifiedpermissions/service_endpoints_gen_test.go b/internal/service/verifiedpermissions/service_endpoints_gen_test.go index 483d0697c27..2b00bf670b6 100644 --- a/internal/service/verifiedpermissions/service_endpoints_gen_test.go +++ b/internal/service/verifiedpermissions/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/vpclattice/service_endpoints_gen_test.go b/internal/service/vpclattice/service_endpoints_gen_test.go index 51e4d4feb7f..f611a7f6539 100644 --- a/internal/service/vpclattice/service_endpoints_gen_test.go +++ b/internal/service/vpclattice/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/waf/service_endpoints_gen_test.go b/internal/service/waf/service_endpoints_gen_test.go index 80f4fba7b7e..f0cd1057fe9 100644 --- a/internal/service/waf/service_endpoints_gen_test.go +++ b/internal/service/waf/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/wafregional/service_endpoints_gen_test.go b/internal/service/wafregional/service_endpoints_gen_test.go index 1920668894c..d3b48a6e29a 100644 --- a/internal/service/wafregional/service_endpoints_gen_test.go +++ b/internal/service/wafregional/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/wafv2/service_endpoints_gen_test.go b/internal/service/wafv2/service_endpoints_gen_test.go index fe349568dba..8641d31337d 100644 --- a/internal/service/wafv2/service_endpoints_gen_test.go +++ b/internal/service/wafv2/service_endpoints_gen_test.go @@ -217,7 +217,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -344,6 +344,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/wellarchitected/service_endpoints_gen_test.go b/internal/service/wellarchitected/service_endpoints_gen_test.go index d8ccf19f443..dfe62d2a86a 100644 --- a/internal/service/wellarchitected/service_endpoints_gen_test.go +++ b/internal/service/wellarchitected/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/worklink/service_endpoints_gen_test.go b/internal/service/worklink/service_endpoints_gen_test.go index a79e8ca1e59..031b96551a1 100644 --- a/internal/service/worklink/service_endpoints_gen_test.go +++ b/internal/service/worklink/service_endpoints_gen_test.go @@ -213,7 +213,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -332,6 +332,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/workspaces/service_endpoints_gen_test.go b/internal/service/workspaces/service_endpoints_gen_test.go index 12242e85806..1281478d2a6 100644 --- a/internal/service/workspaces/service_endpoints_gen_test.go +++ b/internal/service/workspaces/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/workspacesweb/service_endpoints_gen_test.go b/internal/service/workspacesweb/service_endpoints_gen_test.go index a239f3a8f10..e9aa975b7d3 100644 --- a/internal/service/workspacesweb/service_endpoints_gen_test.go +++ b/internal/service/workspacesweb/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/internal/service/xray/service_endpoints_gen_test.go b/internal/service/xray/service_endpoints_gen_test.go index b3e1484f8d7..7825371e602 100644 --- a/internal/service/xray/service_endpoints_gen_test.go +++ b/internal/service/xray/service_endpoints_gen_test.go @@ -216,7 +216,7 @@ func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.S with: []setupFunc{ withUseFIPSInConfig, }, - expected: expectDefaultFIPSEndpoint(region), + expected: expectDefaultFIPSEndpoint(expectedEndpointRegion), }, "use fips config with package name endpoint config": { @@ -341,6 +341,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), + region: "us-west-2", } } diff --git a/names/data/names_data.csv b/names/data/names_data.csv index ff528928463..f8e645230fd 100644 --- a/names/data/names_data.csv +++ b/names/data/names_data.csv @@ -103,7 +103,7 @@ voice-id,voiceid,voiceid,voiceid,,voiceid,,,VoiceID,VoiceID,,1,,,aws_voiceid_,,v wisdom,wisdom,connectwisdomservice,wisdom,,wisdom,,connectwisdomservice,Wisdom,ConnectWisdomService,,1,,,aws_wisdom_,,wisdom_,Connect Wisdom,Amazon,,x,,,,,Wisdom,,,, ,,,,,,,,,,,,,,,,,Console Mobile Application,AWS,x,,,,,,,,,,No SDK support controltower,controltower,controltower,controltower,,controltower,,,ControlTower,ControlTower,,,2,,aws_controltower_,,controltower_,Control Tower,AWS,,,,,,,ControlTower,ListLandingZones,,, -cost-optimization-hub,costoptimizationhub,costoptimizationhub,costoptimizationhub,,costoptimizationhub,,,CostOptimizationHub,CostOptimizationHub,x,,2,,aws_costoptimizationhub_,,costoptimizationhub_,Cost Optimization Hub,AWS,,,,,,,Cost Optimization Hub,GetPreferences,,, +cost-optimization-hub,costoptimizationhub,costoptimizationhub,costoptimizationhub,,costoptimizationhub,,,CostOptimizationHub,CostOptimizationHub,x,,2,,aws_costoptimizationhub_,,costoptimizationhub_,Cost Optimization Hub,AWS,,,,,,,Cost Optimization Hub,GetPreferences,,us-east-1, cur,cur,costandusagereportservice,costandusagereportservice,,cur,,costandusagereportservice,CUR,CostandUsageReportService,x,,2,,aws_cur_,,cur_,Cost and Usage Report,AWS,,,,,,,Cost and Usage Report Service,DescribeReportDefinitions,,, ,,,,,,,,,,,,,,,,,Crypto Tools,AWS,x,,,,,,,,,,No SDK support ,,,,,,,,,,,,,,,,,Cryptographic Services Overview,AWS,x,,,,,,,,,,No SDK support From ab7ed4a4a0553d73efeb97b863d933246e371b22 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 10:21:43 -0700 Subject: [PATCH 09/15] `cur` --- .../generate/serviceendpointtests/main.go | 6 +----- .../service/cur/service_endpoints_gen_test.go | 20 ++++++++++--------- internal/service/cur/service_package.go | 10 ++++++---- names/data/names_data.csv | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/internal/generate/serviceendpointtests/main.go b/internal/generate/serviceendpointtests/main.go index 7118006dd87..1bb429ca23a 100644 --- a/internal/generate/serviceendpointtests/main.go +++ b/internal/generate/serviceendpointtests/main.go @@ -92,13 +92,9 @@ func main() { } } - // switch packageName { - // case "costoptimizationhub", "cur", "route53domains": - // td.Region = "us-east-1" - // } // This should be moved to service data switch packageName { - case "costoptimizationhub", "route53domains": + case "costoptimizationhub", "cur", "route53domains": td.OverrideRegionRegionalEndpoint = true } diff --git a/internal/service/cur/service_endpoints_gen_test.go b/internal/service/cur/service_endpoints_gen_test.go index 5ada6b83d3f..81f78671576 100644 --- a/internal/service/cur/service_endpoints_gen_test.go +++ b/internal/service/cur/service_endpoints_gen_test.go @@ -82,7 +82,9 @@ const ( func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 - const expectedEndpointRegion = providerRegion + // Cost and Usage Report has a single regional endpoint + // However, the AWS SDK's endpoint resolution returns one for whatever region you're using + const expectedEndpointRegion = "us-east-1" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ "no config": { @@ -407,56 +409,56 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: "us-east-1", } } func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: "us-east-1", } } func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: "us-east-1", } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: "us-east-1", } } diff --git a/internal/service/cur/service_package.go b/internal/service/cur/service_package.go index 1a7d2c12052..c642d641a1c 100644 --- a/internal/service/cur/service_package.go +++ b/internal/service/cur/service_package.go @@ -16,6 +16,12 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( cfg := *(config["aws_sdkv2_config"].(*aws.Config)) return costandusagereportservice.NewFromConfig(cfg, func(o *costandusagereportservice.Options) { + if config["partition"].(string) == names.StandardPartitionID { + // AWS Cost and Usage Reports is only available in AWS Commercial us-east-1 Region. + // https://docs.aws.amazon.com/general/latest/gr/billing.html. + o.Region = names.USEast1RegionID + } + if endpoint := config[names.AttrEndpoint].(string); endpoint != "" { tflog.Debug(ctx, "setting endpoint", map[string]any{ "tf_aws.endpoint": endpoint, @@ -26,10 +32,6 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( tflog.Debug(ctx, "endpoint set, ignoring UseFIPSEndpoint setting") o.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateDisabled } - } else if config["partition"].(string) == names.StandardPartitionID { - // AWS Cost and Usage Reports is only available in AWS Commercial us-east-1 Region. - // https://docs.aws.amazon.com/general/latest/gr/billing.html. - o.Region = names.USEast1RegionID } }), nil } diff --git a/names/data/names_data.csv b/names/data/names_data.csv index f8e645230fd..6563e124f8d 100644 --- a/names/data/names_data.csv +++ b/names/data/names_data.csv @@ -104,7 +104,7 @@ wisdom,wisdom,connectwisdomservice,wisdom,,wisdom,,connectwisdomservice,Wisdom,C ,,,,,,,,,,,,,,,,,Console Mobile Application,AWS,x,,,,,,,,,,No SDK support controltower,controltower,controltower,controltower,,controltower,,,ControlTower,ControlTower,,,2,,aws_controltower_,,controltower_,Control Tower,AWS,,,,,,,ControlTower,ListLandingZones,,, cost-optimization-hub,costoptimizationhub,costoptimizationhub,costoptimizationhub,,costoptimizationhub,,,CostOptimizationHub,CostOptimizationHub,x,,2,,aws_costoptimizationhub_,,costoptimizationhub_,Cost Optimization Hub,AWS,,,,,,,Cost Optimization Hub,GetPreferences,,us-east-1, -cur,cur,costandusagereportservice,costandusagereportservice,,cur,,costandusagereportservice,CUR,CostandUsageReportService,x,,2,,aws_cur_,,cur_,Cost and Usage Report,AWS,,,,,,,Cost and Usage Report Service,DescribeReportDefinitions,,, +cur,cur,costandusagereportservice,costandusagereportservice,,cur,,costandusagereportservice,CUR,CostandUsageReportService,x,,2,,aws_cur_,,cur_,Cost and Usage Report,AWS,,,,,,,Cost and Usage Report Service,DescribeReportDefinitions,,us-east-1, ,,,,,,,,,,,,,,,,,Crypto Tools,AWS,x,,,,,,,,,,No SDK support ,,,,,,,,,,,,,,,,,Cryptographic Services Overview,AWS,x,,,,,,,,,,No SDK support dataexchange,dataexchange,dataexchange,dataexchange,,dataexchange,,,DataExchange,DataExchange,,1,,,aws_dataexchange_,,dataexchange_,Data Exchange,AWS,,,,,,,DataExchange,ListDataSets,,, From 8f7528e7b330a8955a51629245aa7007cbc8aaac Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 11:09:12 -0700 Subject: [PATCH 10/15] `chatbot` --- .../generate/serviceendpointtests/file.gtpl | 4 ++-- internal/generate/serviceendpointtests/main.go | 9 ++++++++- .../chatbot/service_endpoints_gen_test.go | 6 ++++-- internal/service/chatbot/service_package.go | 18 ++++++++++-------- .../service_endpoints_gen_test.go | 4 ++-- .../service/cur/service_endpoints_gen_test.go | 4 ++-- .../service_endpoints_gen_test.go | 4 ++-- 7 files changed, 30 insertions(+), 19 deletions(-) diff --git a/internal/generate/serviceendpointtests/file.gtpl b/internal/generate/serviceendpointtests/file.gtpl index 92c7a6bf8df..6ca4769702e 100644 --- a/internal/generate/serviceendpointtests/file.gtpl +++ b/internal/generate/serviceendpointtests/file.gtpl @@ -117,8 +117,8 @@ const ( func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "{{ .Region }}" //lintignore:AWSAT003 {{ if .OverrideRegionRegionalEndpoint -}} - // {{ .HumanFriendly }} has a single regional endpoint - // However, the AWS SDK's endpoint resolution returns one for whatever region you're using + // {{ .HumanFriendly }} uses a regional endpoint but is only available in one region or a limited number of regions. + // The provider overrides the region for {{ .HumanFriendly }}, but the AWS SDK's endpoint resolution returns one for the current region. const expectedEndpointRegion = "{{ .OverrideRegion }}" //lintignore:AWSAT003 {{ else -}} const expectedEndpointRegion = providerRegion diff --git a/internal/generate/serviceendpointtests/main.go b/internal/generate/serviceendpointtests/main.go index 1bb429ca23a..79603a1f393 100644 --- a/internal/generate/serviceendpointtests/main.go +++ b/internal/generate/serviceendpointtests/main.go @@ -92,10 +92,17 @@ func main() { } } - // This should be moved to service data switch packageName { + // TODO: This case should be handled in service data case "costoptimizationhub", "cur", "route53domains": td.OverrideRegionRegionalEndpoint = true + + case "chatbot": + // chatbot is available in `us-east-2`, `us-west-2`, `eu-west-1`, and `ap-southeast-1` + // If the service is called from any other region, it defaults to `us-west-2` + td.Region = "us-east-1" + td.OverrideRegion = "us-west-2" + td.OverrideRegionRegionalEndpoint = true } if td.APICall == "" { diff --git a/internal/service/chatbot/service_endpoints_gen_test.go b/internal/service/chatbot/service_endpoints_gen_test.go index 2efda3fd1c3..d3f40a7f0a0 100644 --- a/internal/service/chatbot/service_endpoints_gen_test.go +++ b/internal/service/chatbot/service_endpoints_gen_test.go @@ -76,8 +76,10 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const providerRegion = "us-west-2" //lintignore:AWSAT003 - const expectedEndpointRegion = providerRegion + const providerRegion = "us-east-1" //lintignore:AWSAT003 + // Chatbot uses a regional endpoint but is only available in one region or a limited number of regions. + // The provider overrides the region for Chatbot, but the AWS SDK's endpoint resolution returns one for the current region. + const expectedEndpointRegion = "us-west-2" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ "no config": { diff --git a/internal/service/chatbot/service_package.go b/internal/service/chatbot/service_package.go index bdb6a493ae1..fbe7a9e657f 100644 --- a/internal/service/chatbot/service_package.go +++ b/internal/service/chatbot/service_package.go @@ -18,6 +18,16 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( cfg := *(config["aws_sdkv2_config"].(*aws.Config)) return chatbot.NewFromConfig(cfg, func(o *chatbot.Options) { + if config["partition"].(string) == names.StandardPartitionID { + // Chatbot endpoint is available only in the 4 regions us-east-2, us-west-2, eu-west-1, and ap-southeast-1. + // If the region from the context is one of those four, then use that region. If not default to us-west-2 + if slices.Contains([]string{names.USEast2RegionID, names.USWest2RegionID, names.EUWest1RegionID, names.APSoutheast1RegionID}, cfg.Region) { + o.Region = cfg.Region + } else { + o.Region = names.USWest2RegionID + } + } + if endpoint := config[names.AttrEndpoint].(string); endpoint != "" { tflog.Debug(ctx, "setting endpoint", map[string]any{ "tf_aws.endpoint": endpoint, @@ -28,14 +38,6 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( tflog.Debug(ctx, "endpoint set, ignoring UseFIPSEndpoint setting") o.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateDisabled } - } else if config["partition"].(string) == names.StandardPartitionID { - // Chatbot endpoint is available only in the 4 regions us-east-2, us-west-2, eu-west-1, and ap-southeast-1. - // If the region from the context is one of those four, then use that region. If not default to us-west-2 - if slices.Contains([]string{names.USEast2RegionID, names.USWest2RegionID, names.EUWest1RegionID, names.APSoutheast1RegionID}, cfg.Region) { - o.Region = cfg.Region - } else { - o.Region = names.USWest2RegionID - } } }), nil } diff --git a/internal/service/costoptimizationhub/service_endpoints_gen_test.go b/internal/service/costoptimizationhub/service_endpoints_gen_test.go index 6af05a9f555..de764636515 100644 --- a/internal/service/costoptimizationhub/service_endpoints_gen_test.go +++ b/internal/service/costoptimizationhub/service_endpoints_gen_test.go @@ -77,8 +77,8 @@ const ( func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 - // Cost Optimization Hub has a single regional endpoint - // However, the AWS SDK's endpoint resolution returns one for whatever region you're using + // Cost Optimization Hub uses a regional endpoint but is only available in one region or a limited number of regions. + // The provider overrides the region for Cost Optimization Hub, but the AWS SDK's endpoint resolution returns one for the current region. const expectedEndpointRegion = "us-east-1" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ diff --git a/internal/service/cur/service_endpoints_gen_test.go b/internal/service/cur/service_endpoints_gen_test.go index 81f78671576..03291ecdcd0 100644 --- a/internal/service/cur/service_endpoints_gen_test.go +++ b/internal/service/cur/service_endpoints_gen_test.go @@ -82,8 +82,8 @@ const ( func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 - // Cost and Usage Report has a single regional endpoint - // However, the AWS SDK's endpoint resolution returns one for whatever region you're using + // Cost and Usage Report uses a regional endpoint but is only available in one region or a limited number of regions. + // The provider overrides the region for Cost and Usage Report, but the AWS SDK's endpoint resolution returns one for the current region. const expectedEndpointRegion = "us-east-1" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ diff --git a/internal/service/route53domains/service_endpoints_gen_test.go b/internal/service/route53domains/service_endpoints_gen_test.go index 6f03d953f94..cfed69fe45a 100644 --- a/internal/service/route53domains/service_endpoints_gen_test.go +++ b/internal/service/route53domains/service_endpoints_gen_test.go @@ -77,8 +77,8 @@ const ( func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 - // Route 53 Domains has a single regional endpoint - // However, the AWS SDK's endpoint resolution returns one for whatever region you're using + // Route 53 Domains uses a regional endpoint but is only available in one region or a limited number of regions. + // The provider overrides the region for Route 53 Domains, but the AWS SDK's endpoint resolution returns one for the current region. const expectedEndpointRegion = "us-east-1" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ From c6ac504d30288cb090b2b81d09937bbf186eb379 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 11:17:06 -0700 Subject: [PATCH 11/15] `globalaccelerator` --- internal/generate/serviceendpointtests/main.go | 6 +++++- .../globalaccelerator/service_endpoints_gen_test.go | 6 ++++-- internal/service/globalaccelerator/service_package.go | 8 +++++--- names/data/names_data.csv | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/internal/generate/serviceendpointtests/main.go b/internal/generate/serviceendpointtests/main.go index 79603a1f393..e8c566b9b89 100644 --- a/internal/generate/serviceendpointtests/main.go +++ b/internal/generate/serviceendpointtests/main.go @@ -92,9 +92,13 @@ func main() { } } + if td.OverrideRegion == "us-west-2" { + td.Region = "us-east-1" + } + switch packageName { // TODO: This case should be handled in service data - case "costoptimizationhub", "cur", "route53domains": + case "costoptimizationhub", "cur", "globalaccelerator", "route53domains": td.OverrideRegionRegionalEndpoint = true case "chatbot": diff --git a/internal/service/globalaccelerator/service_endpoints_gen_test.go b/internal/service/globalaccelerator/service_endpoints_gen_test.go index e1058d85ecc..8b379f3cbd5 100644 --- a/internal/service/globalaccelerator/service_endpoints_gen_test.go +++ b/internal/service/globalaccelerator/service_endpoints_gen_test.go @@ -76,8 +76,10 @@ const ( ) func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv - const providerRegion = "us-west-2" //lintignore:AWSAT003 - const expectedEndpointRegion = providerRegion + const providerRegion = "us-east-1" //lintignore:AWSAT003 + // Global Accelerator uses a regional endpoint but is only available in one region or a limited number of regions. + // The provider overrides the region for Global Accelerator, but the AWS SDK's endpoint resolution returns one for the current region. + const expectedEndpointRegion = "us-west-2" //lintignore:AWSAT003 testcases := map[string]endpointTestCase{ "no config": { diff --git a/internal/service/globalaccelerator/service_package.go b/internal/service/globalaccelerator/service_package.go index 3c2a07e6fe5..2f4a49d2f38 100644 --- a/internal/service/globalaccelerator/service_package.go +++ b/internal/service/globalaccelerator/service_package.go @@ -17,6 +17,11 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( cfg := *(config["aws_sdkv2_config"].(*aws.Config)) return globalaccelerator.NewFromConfig(cfg, func(o *globalaccelerator.Options) { + if config["partition"].(string) == names.StandardPartitionID { + // Global Accelerator endpoint is only available in AWS Commercial us-west-2 Region. + o.Region = names.USWest2RegionID + } + if endpoint := config[names.AttrEndpoint].(string); endpoint != "" { tflog.Debug(ctx, "setting endpoint", map[string]any{ "tf_aws.endpoint": endpoint, @@ -27,9 +32,6 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) ( tflog.Debug(ctx, "endpoint set, ignoring UseFIPSEndpoint setting") o.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateDisabled } - } else if config["partition"].(string) == names.StandardPartitionID { - // Global Accelerator endpoint is only available in AWS Commercial us-west-2 Region. - o.Region = names.USWest2RegionID } }), nil } diff --git a/names/data/names_data.csv b/names/data/names_data.csv index 6563e124f8d..da7ff7f9837 100644 --- a/names/data/names_data.csv +++ b/names/data/names_data.csv @@ -171,7 +171,7 @@ frauddetector,frauddetector,frauddetector,frauddetector,,frauddetector,,,FraudDe ,,,,,,,,,,,,,,,,,FreeRTOS,,x,,,,,,,,,,No SDK support fsx,fsx,fsx,fsx,,fsx,,,FSx,FSx,,1,,,aws_fsx_,,fsx_,FSx,Amazon,,,,,,,FSx,DescribeFileSystems,,, gamelift,gamelift,gamelift,gamelift,,gamelift,,,GameLift,GameLift,,1,,,aws_gamelift_,,gamelift_,GameLift,Amazon,,,,,,,GameLift,ListGameServerGroups,,, -globalaccelerator,globalaccelerator,globalaccelerator,globalaccelerator,,globalaccelerator,,,GlobalAccelerator,GlobalAccelerator,x,,2,,aws_globalaccelerator_,,globalaccelerator_,Global Accelerator,AWS,,,,,,,Global Accelerator,ListAccelerators,,, +globalaccelerator,globalaccelerator,globalaccelerator,globalaccelerator,,globalaccelerator,,,GlobalAccelerator,GlobalAccelerator,x,,2,,aws_globalaccelerator_,,globalaccelerator_,Global Accelerator,AWS,,,,,,,Global Accelerator,ListAccelerators,,us-west-2, glue,glue,glue,glue,,glue,,,Glue,Glue,,1,,,aws_glue_,,glue_,Glue,AWS,,,,,,,Glue,ListRegistries,,, databrew,databrew,gluedatabrew,databrew,,databrew,,gluedatabrew,DataBrew,GlueDataBrew,,1,,,aws_databrew_,,databrew_,Glue DataBrew,AWS,,x,,,,,DataBrew,,,, groundstation,groundstation,groundstation,groundstation,,groundstation,,,GroundStation,GroundStation,,,2,,aws_groundstation_,,groundstation_,Ground Station,AWS,,,,,,,GroundStation,ListConfigs,,, From c2a5847b78c7d0d8c1d177413f50af81cfac2163 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 11:31:31 -0700 Subject: [PATCH 12/15] Adds CHANGELOG entry --- .changelog/37851.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .changelog/37851.txt diff --git a/.changelog/37851.txt b/.changelog/37851.txt new file mode 100644 index 00000000000..3d7687ce3ef --- /dev/null +++ b/.changelog/37851.txt @@ -0,0 +1,27 @@ +```release-note:bug +service/chatbot: Correctly overrides region when using custom endpoint. +``` + +```release-note:bug +service/costoptimizationhub: Correctly overrides region when using custom endpoint. +``` + +```release-note:bug +service/cur: Correctly overrides region when using custom endpoint. +``` + +```release-note:bug +service/globalaccelerator: Correctly overrides region when using custom endpoint. +``` + +```release-note:bug +service/route53: Correctly overrides region when using custom endpoint. +``` + +```release-note:bug +service/route53domains: Correctly overrides region when using custom endpoint. +``` + +```release-note:bug +service/shield: Correctly overrides region when using custom endpoint. +``` From c453e7562403149ae4b1c37d841d9db5fde66853 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 22:04:40 -0700 Subject: [PATCH 13/15] Moves literal regions to constant --- .../generate/serviceendpointtests/file.gtpl | 24 ++++++++++--------- .../service_endpoints_gen_test.go | 16 ++++++++----- .../account/service_endpoints_gen_test.go | 16 ++++++++----- .../service/acm/service_endpoints_gen_test.go | 16 ++++++++----- .../acmpca/service_endpoints_gen_test.go | 16 ++++++++----- .../service/amp/service_endpoints_gen_test.go | 20 +++++++++------- .../amplify/service_endpoints_gen_test.go | 16 ++++++++----- .../apigateway/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 18 ++++++++------ .../appconfig/service_endpoints_gen_test.go | 16 ++++++++----- .../appfabric/service_endpoints_gen_test.go | 16 ++++++++----- .../appflow/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 16 ++++++++----- .../appmesh/service_endpoints_gen_test.go | 16 ++++++++----- .../apprunner/service_endpoints_gen_test.go | 16 ++++++++----- .../appstream/service_endpoints_gen_test.go | 16 ++++++++----- .../appsync/service_endpoints_gen_test.go | 16 ++++++++----- .../athena/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../autoscaling/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../backup/service_endpoints_gen_test.go | 16 ++++++++----- .../batch/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../bedrock/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../budgets/service_endpoints_gen_test.go | 16 ++++++++----- .../service/ce/service_endpoints_gen_test.go | 18 ++++++++------ .../chatbot/service_endpoints_gen_test.go | 16 ++++++++----- .../chime/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../cleanrooms/service_endpoints_gen_test.go | 16 ++++++++----- .../cloud9/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 16 ++++++++----- .../cloudfront/service_endpoints_gen_test.go | 16 ++++++++----- .../cloudhsmv2/service_endpoints_gen_test.go | 18 ++++++++------ .../cloudsearch/service_endpoints_gen_test.go | 16 ++++++++----- .../cloudtrail/service_endpoints_gen_test.go | 16 ++++++++----- .../cloudwatch/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../codebuild/service_endpoints_gen_test.go | 16 ++++++++----- .../codecommit/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../cognitoidp/service_endpoints_gen_test.go | 18 ++++++++------ .../comprehend/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 18 ++++++++------ .../connect/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/cur/service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../datasync/service_endpoints_gen_test.go | 16 ++++++++----- .../datazone/service_endpoints_gen_test.go | 16 ++++++++----- .../service/dax/service_endpoints_gen_test.go | 16 ++++++++----- .../deploy/service_endpoints_gen_test.go | 18 ++++++++------ .../detective/service_endpoints_gen_test.go | 16 ++++++++----- .../devicefarm/service_endpoints_gen_test.go | 16 ++++++++----- .../devopsguru/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/dlm/service_endpoints_gen_test.go | 16 ++++++++----- .../service/dms/service_endpoints_gen_test.go | 20 +++++++++------- .../docdb/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/drs/service_endpoints_gen_test.go | 16 ++++++++----- .../service/ds/service_endpoints_gen_test.go | 18 ++++++++------ .../dynamodb/service_endpoints_gen_test.go | 20 +++++++++------- .../service/ec2/service_endpoints_gen_test.go | 16 ++++++++----- .../service/ecr/service_endpoints_gen_test.go | 16 ++++++++----- .../ecrpublic/service_endpoints_gen_test.go | 16 ++++++++----- .../service/ecs/service_endpoints_gen_test.go | 16 ++++++++----- .../service/efs/service_endpoints_gen_test.go | 16 ++++++++----- .../service/eks/service_endpoints_gen_test.go | 16 ++++++++----- .../elasticache/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 20 +++++++++------- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/elb/service_endpoints_gen_test.go | 18 ++++++++------ .../elbv2/service_endpoints_gen_test.go | 18 ++++++++------ .../service/emr/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../events/service_endpoints_gen_test.go | 20 +++++++++------- .../evidently/service_endpoints_gen_test.go | 18 ++++++++------ .../finspace/service_endpoints_gen_test.go | 16 ++++++++----- .../firehose/service_endpoints_gen_test.go | 16 ++++++++----- .../service/fis/service_endpoints_gen_test.go | 16 ++++++++----- .../service/fms/service_endpoints_gen_test.go | 16 ++++++++----- .../service/fsx/service_endpoints_gen_test.go | 16 ++++++++----- .../gamelift/service_endpoints_gen_test.go | 16 ++++++++----- .../glacier/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../glue/service_endpoints_gen_test.go | 16 ++++++++----- .../grafana/service_endpoints_gen_test.go | 20 +++++++++------- .../greengrass/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../guardduty/service_endpoints_gen_test.go | 16 ++++++++----- .../healthlake/service_endpoints_gen_test.go | 16 ++++++++----- .../service/iam/service_endpoints_gen_test.go | 20 +++++++++------- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../inspector/service_endpoints_gen_test.go | 16 ++++++++----- .../inspector2/service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/iot/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../iotevents/service_endpoints_gen_test.go | 16 ++++++++----- .../service/ivs/service_endpoints_gen_test.go | 16 ++++++++----- .../ivschat/service_endpoints_gen_test.go | 16 ++++++++----- .../kafka/service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 16 ++++++++----- .../kendra/service_endpoints_gen_test.go | 16 ++++++++----- .../keyspaces/service_endpoints_gen_test.go | 16 ++++++++----- .../kinesis/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/kms/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../lambda/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../lexmodels/service_endpoints_gen_test.go | 22 ++++++++++------- .../lexv2models/service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 16 ++++++++----- .../lightsail/service_endpoints_gen_test.go | 16 ++++++++----- .../location/service_endpoints_gen_test.go | 18 ++++++++------ .../logs/service_endpoints_gen_test.go | 20 +++++++++------- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/m2/service_endpoints_gen_test.go | 16 ++++++++----- .../macie2/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../medialive/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../mediastore/service_endpoints_gen_test.go | 16 ++++++++----- .../memorydb/service_endpoints_gen_test.go | 16 ++++++++----- .../service/mq/service_endpoints_gen_test.go | 16 ++++++++----- .../neptune/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/oam/service_endpoints_gen_test.go | 18 ++++++++------ .../opensearch/service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 16 ++++++++----- .../opsworks/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../osis/service_endpoints_gen_test.go | 18 ++++++++------ .../outposts/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../pinpoint/service_endpoints_gen_test.go | 16 ++++++++----- .../pipes/service_endpoints_gen_test.go | 16 ++++++++----- .../polly/service_endpoints_gen_test.go | 16 ++++++++----- .../pricing/service_endpoints_gen_test.go | 16 ++++++++----- .../qbusiness/service_endpoints_gen_test.go | 16 ++++++++----- .../qldb/service_endpoints_gen_test.go | 16 ++++++++----- .../quicksight/service_endpoints_gen_test.go | 16 ++++++++----- .../service/ram/service_endpoints_gen_test.go | 16 ++++++++----- .../rbin/service_endpoints_gen_test.go | 18 ++++++++------ .../service/rds/service_endpoints_gen_test.go | 16 ++++++++----- .../redshift/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 16 ++++++++----- .../rekognition/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 16 ++++++++----- .../route53/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/rum/service_endpoints_gen_test.go | 18 ++++++++------ .../service/s3/service_endpoints_gen_test.go | 22 ++++++++++------- .../s3outposts/service_endpoints_gen_test.go | 16 ++++++++----- .../sagemaker/service_endpoints_gen_test.go | 16 ++++++++----- .../scheduler/service_endpoints_gen_test.go | 16 ++++++++----- .../schemas/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../securityhub/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 20 +++++++++------- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 18 ++++++++------ .../service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/ses/service_endpoints_gen_test.go | 16 ++++++++----- .../sesv2/service_endpoints_gen_test.go | 16 ++++++++----- .../service/sfn/service_endpoints_gen_test.go | 18 ++++++++------ .../shield/service_endpoints_gen_test.go | 16 ++++++++----- .../signer/service_endpoints_gen_test.go | 16 ++++++++----- .../simpledb/service_endpoints_gen_test.go | 18 ++++++++------ .../service/sns/service_endpoints_gen_test.go | 16 ++++++++----- .../service/sqs/service_endpoints_gen_test.go | 16 ++++++++----- .../service/ssm/service_endpoints_gen_test.go | 16 ++++++++----- .../ssmcontacts/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../ssmsap/service_endpoints_gen_test.go | 16 ++++++++----- .../service/sso/service_endpoints_gen_test.go | 16 ++++++++----- .../ssoadmin/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../service/sts/service_endpoints_gen_test.go | 20 +++++++++------- .../service/swf/service_endpoints_gen_test.go | 16 ++++++++----- .../synthetics/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../transcribe/service_endpoints_gen_test.go | 18 ++++++++------ .../transfer/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../vpclattice/service_endpoints_gen_test.go | 16 ++++++++----- .../service/waf/service_endpoints_gen_test.go | 16 ++++++++----- .../wafregional/service_endpoints_gen_test.go | 16 ++++++++----- .../wafv2/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../worklink/service_endpoints_gen_test.go | 16 ++++++++----- .../workspaces/service_endpoints_gen_test.go | 16 ++++++++----- .../service_endpoints_gen_test.go | 16 ++++++++----- .../xray/service_endpoints_gen_test.go | 16 ++++++++----- 229 files changed, 2348 insertions(+), 1434 deletions(-) diff --git a/internal/generate/serviceendpointtests/file.gtpl b/internal/generate/serviceendpointtests/file.gtpl index 6ca4769702e..953bb428eb4 100644 --- a/internal/generate/serviceendpointtests/file.gtpl +++ b/internal/generate/serviceendpointtests/file.gtpl @@ -114,6 +114,10 @@ const ( {{ end }} ) +const ( + expectedCallRegion = {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }} //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "{{ .Region }}" //lintignore:AWSAT003 {{ if .OverrideRegionRegionalEndpoint -}} @@ -713,7 +717,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, + region: expectedCallRegion, } } @@ -727,17 +731,15 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, + region: expectedCallRegion, } } -{{ $region := .Region }} -{{ if .OverrideRegion }}{{ $region = .OverrideRegion }}{{ end }} {{ range $i, $alias := .Aliases }} func expectAliasName{{ $i }}ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName{{ $i }}ConfigEndpoint, - region: "{{ $region }}", + region: expectedCallRegion, } } {{ end }} @@ -745,14 +747,14 @@ func expectAliasName{{ $i }}ConfigEndpoint() caseExpectations { func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, + region: expectedCallRegion, } } @@ -763,7 +765,7 @@ func expectTfAwsEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(tfAwsEnvVar, awsEnvVar), }, - region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, + region: expectedCallRegion, } } {{ end }} @@ -775,7 +777,7 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(deprecatedEnvVar, awsEnvVar), }, - region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, + region: expectedCallRegion, } } {{ end }} @@ -783,14 +785,14 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, + region: expectedCallRegion, } } diff --git a/internal/service/accessanalyzer/service_endpoints_gen_test.go b/internal/service/accessanalyzer/service_endpoints_gen_test.go index a43efcc2b67..3ad41692f6a 100644 --- a/internal/service/accessanalyzer/service_endpoints_gen_test.go +++ b/internal/service/accessanalyzer/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "accessanalyzer" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/account/service_endpoints_gen_test.go b/internal/service/account/service_endpoints_gen_test.go index f97813968c4..4471b808eb6 100644 --- a/internal/service/account/service_endpoints_gen_test.go +++ b/internal/service/account/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "account" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/acm/service_endpoints_gen_test.go b/internal/service/acm/service_endpoints_gen_test.go index fc35503cf5f..1ea1dd04905 100644 --- a/internal/service/acm/service_endpoints_gen_test.go +++ b/internal/service/acm/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "acm" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/acmpca/service_endpoints_gen_test.go b/internal/service/acmpca/service_endpoints_gen_test.go index f18eda8c88e..a8927b994c4 100644 --- a/internal/service/acmpca/service_endpoints_gen_test.go +++ b/internal/service/acmpca/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "acm_pca" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/amp/service_endpoints_gen_test.go b/internal/service/amp/service_endpoints_gen_test.go index 0b532cf6af6..0a67cbfd0ba 100644 --- a/internal/service/amp/service_endpoints_gen_test.go +++ b/internal/service/amp/service_endpoints_gen_test.go @@ -82,6 +82,10 @@ const ( aliasName1 = "prometheusservice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -477,7 +481,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -491,49 +495,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/amplify/service_endpoints_gen_test.go b/internal/service/amplify/service_endpoints_gen_test.go index 048f653d244..bcb165ef75c 100644 --- a/internal/service/amplify/service_endpoints_gen_test.go +++ b/internal/service/amplify/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "amplify" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/apigateway/service_endpoints_gen_test.go b/internal/service/apigateway/service_endpoints_gen_test.go index c15570dba93..ca6d14ea92e 100644 --- a/internal/service/apigateway/service_endpoints_gen_test.go +++ b/internal/service/apigateway/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "api_gateway" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/apigatewayv2/service_endpoints_gen_test.go b/internal/service/apigatewayv2/service_endpoints_gen_test.go index 38dc9073999..16f7a4d7b3c 100644 --- a/internal/service/apigatewayv2/service_endpoints_gen_test.go +++ b/internal/service/apigatewayv2/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "apigatewayv2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appautoscaling/service_endpoints_gen_test.go b/internal/service/appautoscaling/service_endpoints_gen_test.go index e345c3e4590..f2a3e2fd40d 100644 --- a/internal/service/appautoscaling/service_endpoints_gen_test.go +++ b/internal/service/appautoscaling/service_endpoints_gen_test.go @@ -81,6 +81,10 @@ const ( aliasName0 = "applicationautoscaling" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -410,7 +414,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -424,42 +428,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appconfig/service_endpoints_gen_test.go b/internal/service/appconfig/service_endpoints_gen_test.go index 34156e1171e..86286f62d45 100644 --- a/internal/service/appconfig/service_endpoints_gen_test.go +++ b/internal/service/appconfig/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "appconfig" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appfabric/service_endpoints_gen_test.go b/internal/service/appfabric/service_endpoints_gen_test.go index 6dd0a7777fc..8eaa67005e4 100644 --- a/internal/service/appfabric/service_endpoints_gen_test.go +++ b/internal/service/appfabric/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "appfabric" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appflow/service_endpoints_gen_test.go b/internal/service/appflow/service_endpoints_gen_test.go index 9e713f73151..959ba9e1705 100644 --- a/internal/service/appflow/service_endpoints_gen_test.go +++ b/internal/service/appflow/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "appflow" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appintegrations/service_endpoints_gen_test.go b/internal/service/appintegrations/service_endpoints_gen_test.go index 43fcb918212..489ad95bac6 100644 --- a/internal/service/appintegrations/service_endpoints_gen_test.go +++ b/internal/service/appintegrations/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "appintegrationsservice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/applicationinsights/service_endpoints_gen_test.go b/internal/service/applicationinsights/service_endpoints_gen_test.go index 443ee8fe2f5..53c30554d8d 100644 --- a/internal/service/applicationinsights/service_endpoints_gen_test.go +++ b/internal/service/applicationinsights/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "application_insights" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appmesh/service_endpoints_gen_test.go b/internal/service/appmesh/service_endpoints_gen_test.go index 2f3a6df4265..1dee5661c6e 100644 --- a/internal/service/appmesh/service_endpoints_gen_test.go +++ b/internal/service/appmesh/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "app_mesh" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/apprunner/service_endpoints_gen_test.go b/internal/service/apprunner/service_endpoints_gen_test.go index 6ff94561b82..871a4ffd7f5 100644 --- a/internal/service/apprunner/service_endpoints_gen_test.go +++ b/internal/service/apprunner/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "apprunner" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appstream/service_endpoints_gen_test.go b/internal/service/appstream/service_endpoints_gen_test.go index 2fe34fd3a13..e17e79f2a02 100644 --- a/internal/service/appstream/service_endpoints_gen_test.go +++ b/internal/service/appstream/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "appstream" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appsync/service_endpoints_gen_test.go b/internal/service/appsync/service_endpoints_gen_test.go index f44fe52e6e5..d2079108871 100644 --- a/internal/service/appsync/service_endpoints_gen_test.go +++ b/internal/service/appsync/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "appsync" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/athena/service_endpoints_gen_test.go b/internal/service/athena/service_endpoints_gen_test.go index 9b537454c7b..0e7dbe6f96d 100644 --- a/internal/service/athena/service_endpoints_gen_test.go +++ b/internal/service/athena/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "athena" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/auditmanager/service_endpoints_gen_test.go b/internal/service/auditmanager/service_endpoints_gen_test.go index fab37816c49..b8d5bfd2daa 100644 --- a/internal/service/auditmanager/service_endpoints_gen_test.go +++ b/internal/service/auditmanager/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "auditmanager" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/autoscaling/service_endpoints_gen_test.go b/internal/service/autoscaling/service_endpoints_gen_test.go index 06c3ab9f68d..d0145336301 100644 --- a/internal/service/autoscaling/service_endpoints_gen_test.go +++ b/internal/service/autoscaling/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "auto_scaling" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/autoscalingplans/service_endpoints_gen_test.go b/internal/service/autoscalingplans/service_endpoints_gen_test.go index bc9da45f5a6..bc9669d794c 100644 --- a/internal/service/autoscalingplans/service_endpoints_gen_test.go +++ b/internal/service/autoscalingplans/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "auto_scaling_plans" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/backup/service_endpoints_gen_test.go b/internal/service/backup/service_endpoints_gen_test.go index 7ec4905fc60..b7cf6359874 100644 --- a/internal/service/backup/service_endpoints_gen_test.go +++ b/internal/service/backup/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "backup" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/batch/service_endpoints_gen_test.go b/internal/service/batch/service_endpoints_gen_test.go index dad2a823917..39b82e0eb38 100644 --- a/internal/service/batch/service_endpoints_gen_test.go +++ b/internal/service/batch/service_endpoints_gen_test.go @@ -78,6 +78,10 @@ const ( configParam = "batch" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -364,7 +368,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -378,35 +382,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/bcmdataexports/service_endpoints_gen_test.go b/internal/service/bcmdataexports/service_endpoints_gen_test.go index 0de4b6638ed..b05a7c99e30 100644 --- a/internal/service/bcmdataexports/service_endpoints_gen_test.go +++ b/internal/service/bcmdataexports/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "bcm_data_exports" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/bedrock/service_endpoints_gen_test.go b/internal/service/bedrock/service_endpoints_gen_test.go index ecdcff96157..1257972487a 100644 --- a/internal/service/bedrock/service_endpoints_gen_test.go +++ b/internal/service/bedrock/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "bedrock" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/bedrockagent/service_endpoints_gen_test.go b/internal/service/bedrockagent/service_endpoints_gen_test.go index 2afa372c4b9..b9eec28db1e 100644 --- a/internal/service/bedrockagent/service_endpoints_gen_test.go +++ b/internal/service/bedrockagent/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "bedrock_agent" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/budgets/service_endpoints_gen_test.go b/internal/service/budgets/service_endpoints_gen_test.go index 577bb54f05e..6678d391347 100644 --- a/internal/service/budgets/service_endpoints_gen_test.go +++ b/internal/service/budgets/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "budgets" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ce/service_endpoints_gen_test.go b/internal/service/ce/service_endpoints_gen_test.go index 7e1eb4c2636..f834e967724 100644 --- a/internal/service/ce/service_endpoints_gen_test.go +++ b/internal/service/ce/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "costexplorer" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/chatbot/service_endpoints_gen_test.go b/internal/service/chatbot/service_endpoints_gen_test.go index d3f40a7f0a0..f92ac1fd3b6 100644 --- a/internal/service/chatbot/service_endpoints_gen_test.go +++ b/internal/service/chatbot/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "chatbot" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-east-1" //lintignore:AWSAT003 // Chatbot uses a regional endpoint but is only available in one region or a limited number of regions. @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/chime/service_endpoints_gen_test.go b/internal/service/chime/service_endpoints_gen_test.go index b9f58c587f3..a09b3f8d85e 100644 --- a/internal/service/chime/service_endpoints_gen_test.go +++ b/internal/service/chime/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "chime" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go index 001b7c63205..1c377724df3 100644 --- a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go +++ b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "chime_sdk_media_pipelines" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/chimesdkvoice/service_endpoints_gen_test.go b/internal/service/chimesdkvoice/service_endpoints_gen_test.go index ab338d1ad80..a68935af2d9 100644 --- a/internal/service/chimesdkvoice/service_endpoints_gen_test.go +++ b/internal/service/chimesdkvoice/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "chime_sdk_voice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cleanrooms/service_endpoints_gen_test.go b/internal/service/cleanrooms/service_endpoints_gen_test.go index 9aa22a8f1a7..95f549becea 100644 --- a/internal/service/cleanrooms/service_endpoints_gen_test.go +++ b/internal/service/cleanrooms/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "cleanrooms" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloud9/service_endpoints_gen_test.go b/internal/service/cloud9/service_endpoints_gen_test.go index a71c4d33511..ce977fd3abe 100644 --- a/internal/service/cloud9/service_endpoints_gen_test.go +++ b/internal/service/cloud9/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "cloud9" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudcontrol/service_endpoints_gen_test.go b/internal/service/cloudcontrol/service_endpoints_gen_test.go index 1692f142e74..5ea47585769 100644 --- a/internal/service/cloudcontrol/service_endpoints_gen_test.go +++ b/internal/service/cloudcontrol/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "cloudcontrolapi" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudformation/service_endpoints_gen_test.go b/internal/service/cloudformation/service_endpoints_gen_test.go index f43b47c9e64..d20eb0b5f98 100644 --- a/internal/service/cloudformation/service_endpoints_gen_test.go +++ b/internal/service/cloudformation/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "cloudformation" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudfront/service_endpoints_gen_test.go b/internal/service/cloudfront/service_endpoints_gen_test.go index 9d5e8085952..5f30fcc3aff 100644 --- a/internal/service/cloudfront/service_endpoints_gen_test.go +++ b/internal/service/cloudfront/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "cloudfront" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudhsmv2/service_endpoints_gen_test.go b/internal/service/cloudhsmv2/service_endpoints_gen_test.go index 5fe454d101e..eb90dde0c20 100644 --- a/internal/service/cloudhsmv2/service_endpoints_gen_test.go +++ b/internal/service/cloudhsmv2/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "cloudhsm" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudsearch/service_endpoints_gen_test.go b/internal/service/cloudsearch/service_endpoints_gen_test.go index 9a4b9913426..20e373587ff 100644 --- a/internal/service/cloudsearch/service_endpoints_gen_test.go +++ b/internal/service/cloudsearch/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "cloudsearch" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudtrail/service_endpoints_gen_test.go b/internal/service/cloudtrail/service_endpoints_gen_test.go index 22a8575dccb..c3b9814735c 100644 --- a/internal/service/cloudtrail/service_endpoints_gen_test.go +++ b/internal/service/cloudtrail/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "cloudtrail" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudwatch/service_endpoints_gen_test.go b/internal/service/cloudwatch/service_endpoints_gen_test.go index 9ccb32de420..fc6716990b2 100644 --- a/internal/service/cloudwatch/service_endpoints_gen_test.go +++ b/internal/service/cloudwatch/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "cloudwatch" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codeartifact/service_endpoints_gen_test.go b/internal/service/codeartifact/service_endpoints_gen_test.go index 654705532fb..ae7bbfd7403 100644 --- a/internal/service/codeartifact/service_endpoints_gen_test.go +++ b/internal/service/codeartifact/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "codeartifact" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codebuild/service_endpoints_gen_test.go b/internal/service/codebuild/service_endpoints_gen_test.go index e69c4734c9a..1fe8485cca7 100644 --- a/internal/service/codebuild/service_endpoints_gen_test.go +++ b/internal/service/codebuild/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "codebuild" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codecommit/service_endpoints_gen_test.go b/internal/service/codecommit/service_endpoints_gen_test.go index fb555e6b8ad..c33ebef5118 100644 --- a/internal/service/codecommit/service_endpoints_gen_test.go +++ b/internal/service/codecommit/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "codecommit" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codeguruprofiler/service_endpoints_gen_test.go b/internal/service/codeguruprofiler/service_endpoints_gen_test.go index 1ee72b8e10a..5ff7dbd90fd 100644 --- a/internal/service/codeguruprofiler/service_endpoints_gen_test.go +++ b/internal/service/codeguruprofiler/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "codeguruprofiler" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codegurureviewer/service_endpoints_gen_test.go b/internal/service/codegurureviewer/service_endpoints_gen_test.go index 2f83259e47c..f55f46ff0b1 100644 --- a/internal/service/codegurureviewer/service_endpoints_gen_test.go +++ b/internal/service/codegurureviewer/service_endpoints_gen_test.go @@ -76,6 +76,10 @@ const ( configParam = "codeguru_reviewer" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -337,7 +341,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -351,35 +355,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codepipeline/service_endpoints_gen_test.go b/internal/service/codepipeline/service_endpoints_gen_test.go index 49d4863fb47..e9775d4e612 100644 --- a/internal/service/codepipeline/service_endpoints_gen_test.go +++ b/internal/service/codepipeline/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "codepipeline" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codestarconnections/service_endpoints_gen_test.go b/internal/service/codestarconnections/service_endpoints_gen_test.go index 6a9ca491ef4..b07ff8125c3 100644 --- a/internal/service/codestarconnections/service_endpoints_gen_test.go +++ b/internal/service/codestarconnections/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "codestar_connections" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codestarnotifications/service_endpoints_gen_test.go b/internal/service/codestarnotifications/service_endpoints_gen_test.go index f0445e8fcec..0cb836ef093 100644 --- a/internal/service/codestarnotifications/service_endpoints_gen_test.go +++ b/internal/service/codestarnotifications/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "codestar_notifications" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cognitoidentity/service_endpoints_gen_test.go b/internal/service/cognitoidentity/service_endpoints_gen_test.go index 7962ad305df..abe75a4405f 100644 --- a/internal/service/cognitoidentity/service_endpoints_gen_test.go +++ b/internal/service/cognitoidentity/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "cognito_identity" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cognitoidp/service_endpoints_gen_test.go b/internal/service/cognitoidp/service_endpoints_gen_test.go index e1185f511cd..1fd8a1321c8 100644 --- a/internal/service/cognitoidp/service_endpoints_gen_test.go +++ b/internal/service/cognitoidp/service_endpoints_gen_test.go @@ -77,6 +77,10 @@ const ( aliasName0 = "cognitoidentityprovider" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -395,7 +399,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -409,42 +413,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/comprehend/service_endpoints_gen_test.go b/internal/service/comprehend/service_endpoints_gen_test.go index 59d33d00417..f86ca44692d 100644 --- a/internal/service/comprehend/service_endpoints_gen_test.go +++ b/internal/service/comprehend/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "comprehend" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/computeoptimizer/service_endpoints_gen_test.go b/internal/service/computeoptimizer/service_endpoints_gen_test.go index d3d4b02bf40..82c67e51a9a 100644 --- a/internal/service/computeoptimizer/service_endpoints_gen_test.go +++ b/internal/service/computeoptimizer/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "compute_optimizer" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/configservice/service_endpoints_gen_test.go b/internal/service/configservice/service_endpoints_gen_test.go index 13cc7526cd9..d65076bcaf9 100644 --- a/internal/service/configservice/service_endpoints_gen_test.go +++ b/internal/service/configservice/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "config" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/connect/service_endpoints_gen_test.go b/internal/service/connect/service_endpoints_gen_test.go index 16bc1fc07d1..5e426d518f6 100644 --- a/internal/service/connect/service_endpoints_gen_test.go +++ b/internal/service/connect/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "connect" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/connectcases/service_endpoints_gen_test.go b/internal/service/connectcases/service_endpoints_gen_test.go index 1fb87b8888f..2f610ddd0bf 100644 --- a/internal/service/connectcases/service_endpoints_gen_test.go +++ b/internal/service/connectcases/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "connectcases" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/controltower/service_endpoints_gen_test.go b/internal/service/controltower/service_endpoints_gen_test.go index 62b58f4657b..17a94679d72 100644 --- a/internal/service/controltower/service_endpoints_gen_test.go +++ b/internal/service/controltower/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "controltower" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/costoptimizationhub/service_endpoints_gen_test.go b/internal/service/costoptimizationhub/service_endpoints_gen_test.go index de764636515..4c04d7fc194 100644 --- a/internal/service/costoptimizationhub/service_endpoints_gen_test.go +++ b/internal/service/costoptimizationhub/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "cost_optimization_hub" ) +const ( + expectedCallRegion = "us-east-1" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 // Cost Optimization Hub uses a regional endpoint but is only available in one region or a limited number of regions. @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-east-1", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } diff --git a/internal/service/cur/service_endpoints_gen_test.go b/internal/service/cur/service_endpoints_gen_test.go index 03291ecdcd0..acb7078e69b 100644 --- a/internal/service/cur/service_endpoints_gen_test.go +++ b/internal/service/cur/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "costandusagereportservice" ) +const ( + expectedCallRegion = "us-east-1" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 // Cost and Usage Report uses a regional endpoint but is only available in one region or a limited number of regions. @@ -409,7 +413,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-east-1", + region: expectedCallRegion, } } @@ -423,42 +427,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } diff --git a/internal/service/customerprofiles/service_endpoints_gen_test.go b/internal/service/customerprofiles/service_endpoints_gen_test.go index 00ff71d2df9..71e33fb88a4 100644 --- a/internal/service/customerprofiles/service_endpoints_gen_test.go +++ b/internal/service/customerprofiles/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "customer_profiles" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/dataexchange/service_endpoints_gen_test.go b/internal/service/dataexchange/service_endpoints_gen_test.go index 838d252fbda..77876a369ea 100644 --- a/internal/service/dataexchange/service_endpoints_gen_test.go +++ b/internal/service/dataexchange/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "dataexchange" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/datapipeline/service_endpoints_gen_test.go b/internal/service/datapipeline/service_endpoints_gen_test.go index 5f11dec05fe..c727ce3d52e 100644 --- a/internal/service/datapipeline/service_endpoints_gen_test.go +++ b/internal/service/datapipeline/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "data_pipeline" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/datasync/service_endpoints_gen_test.go b/internal/service/datasync/service_endpoints_gen_test.go index 1f456e28c47..cb5c6b86bc8 100644 --- a/internal/service/datasync/service_endpoints_gen_test.go +++ b/internal/service/datasync/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "datasync" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/datazone/service_endpoints_gen_test.go b/internal/service/datazone/service_endpoints_gen_test.go index 050dbb715de..4b7d44267f3 100644 --- a/internal/service/datazone/service_endpoints_gen_test.go +++ b/internal/service/datazone/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "datazone" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/dax/service_endpoints_gen_test.go b/internal/service/dax/service_endpoints_gen_test.go index 63ccc07a6e3..8c7701c1ff2 100644 --- a/internal/service/dax/service_endpoints_gen_test.go +++ b/internal/service/dax/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "dax" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/deploy/service_endpoints_gen_test.go b/internal/service/deploy/service_endpoints_gen_test.go index 715ff17e2fc..86b3e818a78 100644 --- a/internal/service/deploy/service_endpoints_gen_test.go +++ b/internal/service/deploy/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "codedeploy" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/detective/service_endpoints_gen_test.go b/internal/service/detective/service_endpoints_gen_test.go index 8c31fef9387..df4a5f8b535 100644 --- a/internal/service/detective/service_endpoints_gen_test.go +++ b/internal/service/detective/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "detective" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/devicefarm/service_endpoints_gen_test.go b/internal/service/devicefarm/service_endpoints_gen_test.go index ee2d9996962..421d0034d1e 100644 --- a/internal/service/devicefarm/service_endpoints_gen_test.go +++ b/internal/service/devicefarm/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "device_farm" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/devopsguru/service_endpoints_gen_test.go b/internal/service/devopsguru/service_endpoints_gen_test.go index 24e05cc7112..5484cad4f74 100644 --- a/internal/service/devopsguru/service_endpoints_gen_test.go +++ b/internal/service/devopsguru/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "devops_guru" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/directconnect/service_endpoints_gen_test.go b/internal/service/directconnect/service_endpoints_gen_test.go index 261e5062ff0..b301069a7f1 100644 --- a/internal/service/directconnect/service_endpoints_gen_test.go +++ b/internal/service/directconnect/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "direct_connect" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/dlm/service_endpoints_gen_test.go b/internal/service/dlm/service_endpoints_gen_test.go index 7357ec27d1b..c7870743380 100644 --- a/internal/service/dlm/service_endpoints_gen_test.go +++ b/internal/service/dlm/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "dlm" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/dms/service_endpoints_gen_test.go b/internal/service/dms/service_endpoints_gen_test.go index 019f7701806..c7445b8c870 100644 --- a/internal/service/dms/service_endpoints_gen_test.go +++ b/internal/service/dms/service_endpoints_gen_test.go @@ -79,6 +79,10 @@ const ( aliasName1 = "databasemigrationservice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -465,7 +469,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -479,49 +483,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/docdb/service_endpoints_gen_test.go b/internal/service/docdb/service_endpoints_gen_test.go index 7ea095ce11b..d3c8fd8a9d3 100644 --- a/internal/service/docdb/service_endpoints_gen_test.go +++ b/internal/service/docdb/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "docdb" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/docdbelastic/service_endpoints_gen_test.go b/internal/service/docdbelastic/service_endpoints_gen_test.go index 59bfb2a445c..f4a12143aa9 100644 --- a/internal/service/docdbelastic/service_endpoints_gen_test.go +++ b/internal/service/docdbelastic/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "docdb_elastic" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/drs/service_endpoints_gen_test.go b/internal/service/drs/service_endpoints_gen_test.go index 57e23a53040..7a7f966a18e 100644 --- a/internal/service/drs/service_endpoints_gen_test.go +++ b/internal/service/drs/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "drs" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ds/service_endpoints_gen_test.go b/internal/service/ds/service_endpoints_gen_test.go index 209bcff0474..6d509f3e666 100644 --- a/internal/service/ds/service_endpoints_gen_test.go +++ b/internal/service/ds/service_endpoints_gen_test.go @@ -83,6 +83,10 @@ const ( aliasName0 = "directoryservice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -437,7 +441,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -451,42 +455,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/dynamodb/service_endpoints_gen_test.go b/internal/service/dynamodb/service_endpoints_gen_test.go index 84b6b7a6579..1f5565290c7 100644 --- a/internal/service/dynamodb/service_endpoints_gen_test.go +++ b/internal/service/dynamodb/service_endpoints_gen_test.go @@ -79,6 +79,10 @@ const ( deprecatedEnvVar = "AWS_DYNAMODB_ENDPOINT" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -452,7 +456,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -466,21 +470,21 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } @@ -490,7 +494,7 @@ func expectTfAwsEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(tfAwsEnvVar, awsEnvVar), }, - region: "us-west-2", + region: expectedCallRegion, } } @@ -500,21 +504,21 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(deprecatedEnvVar, awsEnvVar), }, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ec2/service_endpoints_gen_test.go b/internal/service/ec2/service_endpoints_gen_test.go index c13c883b5cc..a4c6c73764b 100644 --- a/internal/service/ec2/service_endpoints_gen_test.go +++ b/internal/service/ec2/service_endpoints_gen_test.go @@ -78,6 +78,10 @@ const ( configParam = "ec2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -364,7 +368,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -378,35 +382,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ecr/service_endpoints_gen_test.go b/internal/service/ecr/service_endpoints_gen_test.go index fda423a88dd..bee2919fd04 100644 --- a/internal/service/ecr/service_endpoints_gen_test.go +++ b/internal/service/ecr/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "ecr" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ecrpublic/service_endpoints_gen_test.go b/internal/service/ecrpublic/service_endpoints_gen_test.go index d3de88e3cff..3cc39743d84 100644 --- a/internal/service/ecrpublic/service_endpoints_gen_test.go +++ b/internal/service/ecrpublic/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "ecr_public" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ecs/service_endpoints_gen_test.go b/internal/service/ecs/service_endpoints_gen_test.go index 8d678703935..1127b2c2145 100644 --- a/internal/service/ecs/service_endpoints_gen_test.go +++ b/internal/service/ecs/service_endpoints_gen_test.go @@ -78,6 +78,10 @@ const ( configParam = "ecs" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -364,7 +368,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -378,35 +382,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/efs/service_endpoints_gen_test.go b/internal/service/efs/service_endpoints_gen_test.go index 8b1a46893fb..184ce620cd5 100644 --- a/internal/service/efs/service_endpoints_gen_test.go +++ b/internal/service/efs/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "efs" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/eks/service_endpoints_gen_test.go b/internal/service/eks/service_endpoints_gen_test.go index c77c09d7f6a..d7f8d21b00c 100644 --- a/internal/service/eks/service_endpoints_gen_test.go +++ b/internal/service/eks/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "eks" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elasticache/service_endpoints_gen_test.go b/internal/service/elasticache/service_endpoints_gen_test.go index b0ce9e0eb2c..40a44915496 100644 --- a/internal/service/elasticache/service_endpoints_gen_test.go +++ b/internal/service/elasticache/service_endpoints_gen_test.go @@ -78,6 +78,10 @@ const ( configParam = "elasticache" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -364,7 +368,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -378,35 +382,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go index d3697ef233d..096fd29cd08 100644 --- a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go +++ b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "beanstalk" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elasticsearch/service_endpoints_gen_test.go b/internal/service/elasticsearch/service_endpoints_gen_test.go index a0eef700e14..343d979c3f7 100644 --- a/internal/service/elasticsearch/service_endpoints_gen_test.go +++ b/internal/service/elasticsearch/service_endpoints_gen_test.go @@ -79,6 +79,10 @@ const ( aliasName1 = "elasticsearchservice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -465,7 +469,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -479,49 +483,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elastictranscoder/service_endpoints_gen_test.go b/internal/service/elastictranscoder/service_endpoints_gen_test.go index 0797c47abd4..17b0f8274f3 100644 --- a/internal/service/elastictranscoder/service_endpoints_gen_test.go +++ b/internal/service/elastictranscoder/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "elastic_transcoder" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elb/service_endpoints_gen_test.go b/internal/service/elb/service_endpoints_gen_test.go index 549fe139859..80d4a8c8c05 100644 --- a/internal/service/elb/service_endpoints_gen_test.go +++ b/internal/service/elb/service_endpoints_gen_test.go @@ -77,6 +77,10 @@ const ( aliasName0 = "elasticloadbalancing" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -395,7 +399,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -409,42 +413,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elbv2/service_endpoints_gen_test.go b/internal/service/elbv2/service_endpoints_gen_test.go index 7fd32ab374b..c2863705045 100644 --- a/internal/service/elbv2/service_endpoints_gen_test.go +++ b/internal/service/elbv2/service_endpoints_gen_test.go @@ -83,6 +83,10 @@ const ( aliasName0 = "elasticloadbalancingv2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -437,7 +441,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -451,42 +455,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/emr/service_endpoints_gen_test.go b/internal/service/emr/service_endpoints_gen_test.go index 72143df3a22..c681ab48531 100644 --- a/internal/service/emr/service_endpoints_gen_test.go +++ b/internal/service/emr/service_endpoints_gen_test.go @@ -78,6 +78,10 @@ const ( configParam = "emr" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -364,7 +368,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -378,35 +382,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/emrcontainers/service_endpoints_gen_test.go b/internal/service/emrcontainers/service_endpoints_gen_test.go index f88bc20e660..e648e4c8139 100644 --- a/internal/service/emrcontainers/service_endpoints_gen_test.go +++ b/internal/service/emrcontainers/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "emr_containers" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/emrserverless/service_endpoints_gen_test.go b/internal/service/emrserverless/service_endpoints_gen_test.go index 3dfd652ebaf..9893f177d14 100644 --- a/internal/service/emrserverless/service_endpoints_gen_test.go +++ b/internal/service/emrserverless/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "emr_serverless" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/events/service_endpoints_gen_test.go b/internal/service/events/service_endpoints_gen_test.go index f194deb0208..42e27a87a2f 100644 --- a/internal/service/events/service_endpoints_gen_test.go +++ b/internal/service/events/service_endpoints_gen_test.go @@ -82,6 +82,10 @@ const ( aliasName1 = "cloudwatchevents" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -477,7 +481,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -491,49 +495,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/evidently/service_endpoints_gen_test.go b/internal/service/evidently/service_endpoints_gen_test.go index 80244a0d4b9..aaea99d2a4c 100644 --- a/internal/service/evidently/service_endpoints_gen_test.go +++ b/internal/service/evidently/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "cloudwatchevidently" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/finspace/service_endpoints_gen_test.go b/internal/service/finspace/service_endpoints_gen_test.go index e673162ecaf..a6f559248f2 100644 --- a/internal/service/finspace/service_endpoints_gen_test.go +++ b/internal/service/finspace/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "finspace" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/firehose/service_endpoints_gen_test.go b/internal/service/firehose/service_endpoints_gen_test.go index da0bd752bef..3523dd51db5 100644 --- a/internal/service/firehose/service_endpoints_gen_test.go +++ b/internal/service/firehose/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "firehose" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/fis/service_endpoints_gen_test.go b/internal/service/fis/service_endpoints_gen_test.go index 08f5764d5b4..766575e7e0f 100644 --- a/internal/service/fis/service_endpoints_gen_test.go +++ b/internal/service/fis/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "fis" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/fms/service_endpoints_gen_test.go b/internal/service/fms/service_endpoints_gen_test.go index 43520a4b881..2f4522e825b 100644 --- a/internal/service/fms/service_endpoints_gen_test.go +++ b/internal/service/fms/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "fms" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/fsx/service_endpoints_gen_test.go b/internal/service/fsx/service_endpoints_gen_test.go index d42b7662596..2077b041b9a 100644 --- a/internal/service/fsx/service_endpoints_gen_test.go +++ b/internal/service/fsx/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "fsx" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/gamelift/service_endpoints_gen_test.go b/internal/service/gamelift/service_endpoints_gen_test.go index abb0af5d8f8..903973b2b4f 100644 --- a/internal/service/gamelift/service_endpoints_gen_test.go +++ b/internal/service/gamelift/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "gamelift" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/glacier/service_endpoints_gen_test.go b/internal/service/glacier/service_endpoints_gen_test.go index 3561731803f..289d3d93098 100644 --- a/internal/service/glacier/service_endpoints_gen_test.go +++ b/internal/service/glacier/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "glacier" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/globalaccelerator/service_endpoints_gen_test.go b/internal/service/globalaccelerator/service_endpoints_gen_test.go index 8b379f3cbd5..1a6a7727c3b 100644 --- a/internal/service/globalaccelerator/service_endpoints_gen_test.go +++ b/internal/service/globalaccelerator/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "global_accelerator" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-east-1" //lintignore:AWSAT003 // Global Accelerator uses a regional endpoint but is only available in one region or a limited number of regions. @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/glue/service_endpoints_gen_test.go b/internal/service/glue/service_endpoints_gen_test.go index 7b1a4daef11..4fde2ec81b0 100644 --- a/internal/service/glue/service_endpoints_gen_test.go +++ b/internal/service/glue/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "glue" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/grafana/service_endpoints_gen_test.go b/internal/service/grafana/service_endpoints_gen_test.go index 923e647d3a8..2aef99835dd 100644 --- a/internal/service/grafana/service_endpoints_gen_test.go +++ b/internal/service/grafana/service_endpoints_gen_test.go @@ -79,6 +79,10 @@ const ( aliasName1 = "amg" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -465,7 +469,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -479,49 +483,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/greengrass/service_endpoints_gen_test.go b/internal/service/greengrass/service_endpoints_gen_test.go index 581afb59123..8f2da877b6c 100644 --- a/internal/service/greengrass/service_endpoints_gen_test.go +++ b/internal/service/greengrass/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "greengrass" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/groundstation/service_endpoints_gen_test.go b/internal/service/groundstation/service_endpoints_gen_test.go index e556942ed58..f41c64c8ad8 100644 --- a/internal/service/groundstation/service_endpoints_gen_test.go +++ b/internal/service/groundstation/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "groundstation" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/guardduty/service_endpoints_gen_test.go b/internal/service/guardduty/service_endpoints_gen_test.go index 71935273cfa..73c45ce9247 100644 --- a/internal/service/guardduty/service_endpoints_gen_test.go +++ b/internal/service/guardduty/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "guardduty" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/healthlake/service_endpoints_gen_test.go b/internal/service/healthlake/service_endpoints_gen_test.go index 898baf1323d..b751cdbcdb0 100644 --- a/internal/service/healthlake/service_endpoints_gen_test.go +++ b/internal/service/healthlake/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "healthlake" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/iam/service_endpoints_gen_test.go b/internal/service/iam/service_endpoints_gen_test.go index 470ffc03dc6..452a6494437 100644 --- a/internal/service/iam/service_endpoints_gen_test.go +++ b/internal/service/iam/service_endpoints_gen_test.go @@ -79,6 +79,10 @@ const ( deprecatedEnvVar = "AWS_IAM_ENDPOINT" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -452,7 +456,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -466,21 +470,21 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } @@ -490,7 +494,7 @@ func expectTfAwsEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(tfAwsEnvVar, awsEnvVar), }, - region: "us-west-2", + region: expectedCallRegion, } } @@ -500,21 +504,21 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(deprecatedEnvVar, awsEnvVar), }, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/identitystore/service_endpoints_gen_test.go b/internal/service/identitystore/service_endpoints_gen_test.go index 6efa9d726cd..db0924fdbff 100644 --- a/internal/service/identitystore/service_endpoints_gen_test.go +++ b/internal/service/identitystore/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "identitystore" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/imagebuilder/service_endpoints_gen_test.go b/internal/service/imagebuilder/service_endpoints_gen_test.go index 9c69c25619a..aea45e58673 100644 --- a/internal/service/imagebuilder/service_endpoints_gen_test.go +++ b/internal/service/imagebuilder/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "imagebuilder" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -325,7 +329,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -339,35 +343,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/inspector/service_endpoints_gen_test.go b/internal/service/inspector/service_endpoints_gen_test.go index d03fa2e9acc..77d360ffaa9 100644 --- a/internal/service/inspector/service_endpoints_gen_test.go +++ b/internal/service/inspector/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "inspector" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/inspector2/service_endpoints_gen_test.go b/internal/service/inspector2/service_endpoints_gen_test.go index 1f317e757d5..c30fa08777f 100644 --- a/internal/service/inspector2/service_endpoints_gen_test.go +++ b/internal/service/inspector2/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "inspectorv2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/internetmonitor/service_endpoints_gen_test.go b/internal/service/internetmonitor/service_endpoints_gen_test.go index f38c4a32aaa..117fa1b2e42 100644 --- a/internal/service/internetmonitor/service_endpoints_gen_test.go +++ b/internal/service/internetmonitor/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "internetmonitor" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/iot/service_endpoints_gen_test.go b/internal/service/iot/service_endpoints_gen_test.go index 3a6698acad2..7dfd1ab6a4a 100644 --- a/internal/service/iot/service_endpoints_gen_test.go +++ b/internal/service/iot/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "iot" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/iotanalytics/service_endpoints_gen_test.go b/internal/service/iotanalytics/service_endpoints_gen_test.go index ac52ccc6379..dd6228b3e0b 100644 --- a/internal/service/iotanalytics/service_endpoints_gen_test.go +++ b/internal/service/iotanalytics/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "iotanalytics" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/iotevents/service_endpoints_gen_test.go b/internal/service/iotevents/service_endpoints_gen_test.go index 9b9cd7860d3..c013877c45d 100644 --- a/internal/service/iotevents/service_endpoints_gen_test.go +++ b/internal/service/iotevents/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "iot_events" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ivs/service_endpoints_gen_test.go b/internal/service/ivs/service_endpoints_gen_test.go index cc6063199d1..71d8fc140cc 100644 --- a/internal/service/ivs/service_endpoints_gen_test.go +++ b/internal/service/ivs/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "ivs" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ivschat/service_endpoints_gen_test.go b/internal/service/ivschat/service_endpoints_gen_test.go index c719bdb3fb9..0343a461c0f 100644 --- a/internal/service/ivschat/service_endpoints_gen_test.go +++ b/internal/service/ivschat/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "ivschat" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kafka/service_endpoints_gen_test.go b/internal/service/kafka/service_endpoints_gen_test.go index e6d5a215b39..ecdc950ccc0 100644 --- a/internal/service/kafka/service_endpoints_gen_test.go +++ b/internal/service/kafka/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "msk" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kafkaconnect/service_endpoints_gen_test.go b/internal/service/kafkaconnect/service_endpoints_gen_test.go index ed07d076f79..5e47bef4a3c 100644 --- a/internal/service/kafkaconnect/service_endpoints_gen_test.go +++ b/internal/service/kafkaconnect/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "kafkaconnect" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kendra/service_endpoints_gen_test.go b/internal/service/kendra/service_endpoints_gen_test.go index 018d4b06fe4..1b4a8433f53 100644 --- a/internal/service/kendra/service_endpoints_gen_test.go +++ b/internal/service/kendra/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "kendra" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/keyspaces/service_endpoints_gen_test.go b/internal/service/keyspaces/service_endpoints_gen_test.go index f0484ebff64..ac0ff29b683 100644 --- a/internal/service/keyspaces/service_endpoints_gen_test.go +++ b/internal/service/keyspaces/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "keyspaces" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kinesis/service_endpoints_gen_test.go b/internal/service/kinesis/service_endpoints_gen_test.go index 7c9aeeba128..374df876c44 100644 --- a/internal/service/kinesis/service_endpoints_gen_test.go +++ b/internal/service/kinesis/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "kinesis" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kinesisanalytics/service_endpoints_gen_test.go b/internal/service/kinesisanalytics/service_endpoints_gen_test.go index aaccc6a55f6..16b7f1e801a 100644 --- a/internal/service/kinesisanalytics/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalytics/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "kinesis_analytics" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go index 593f02a837d..ba29afe708b 100644 --- a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "kinesis_analytics_v2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kinesisvideo/service_endpoints_gen_test.go b/internal/service/kinesisvideo/service_endpoints_gen_test.go index 33697a16d41..ab20d576cd5 100644 --- a/internal/service/kinesisvideo/service_endpoints_gen_test.go +++ b/internal/service/kinesisvideo/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "kinesis_video" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kms/service_endpoints_gen_test.go b/internal/service/kms/service_endpoints_gen_test.go index 82b301eb763..a33e7c1f248 100644 --- a/internal/service/kms/service_endpoints_gen_test.go +++ b/internal/service/kms/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "kms" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lakeformation/service_endpoints_gen_test.go b/internal/service/lakeformation/service_endpoints_gen_test.go index 55c4b8da4c2..a56e9ce7f14 100644 --- a/internal/service/lakeformation/service_endpoints_gen_test.go +++ b/internal/service/lakeformation/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "lakeformation" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lambda/service_endpoints_gen_test.go b/internal/service/lambda/service_endpoints_gen_test.go index 43d0f62b39d..1e1c03d8633 100644 --- a/internal/service/lambda/service_endpoints_gen_test.go +++ b/internal/service/lambda/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "lambda" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/launchwizard/service_endpoints_gen_test.go b/internal/service/launchwizard/service_endpoints_gen_test.go index 6289506c29c..2286edd1eb4 100644 --- a/internal/service/launchwizard/service_endpoints_gen_test.go +++ b/internal/service/launchwizard/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "launch_wizard" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lexmodels/service_endpoints_gen_test.go b/internal/service/lexmodels/service_endpoints_gen_test.go index 3aa7523d0d1..378f98603cb 100644 --- a/internal/service/lexmodels/service_endpoints_gen_test.go +++ b/internal/service/lexmodels/service_endpoints_gen_test.go @@ -81,6 +81,10 @@ const ( aliasName2 = "lex" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -543,7 +547,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -557,56 +561,56 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName2ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName2ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lexv2models/service_endpoints_gen_test.go b/internal/service/lexv2models/service_endpoints_gen_test.go index 22b7508ce2f..505c5db9441 100644 --- a/internal/service/lexv2models/service_endpoints_gen_test.go +++ b/internal/service/lexv2models/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "lexmodelsv2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/licensemanager/service_endpoints_gen_test.go b/internal/service/licensemanager/service_endpoints_gen_test.go index 0bd6ca94100..6b262cc6355 100644 --- a/internal/service/licensemanager/service_endpoints_gen_test.go +++ b/internal/service/licensemanager/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "license_manager" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lightsail/service_endpoints_gen_test.go b/internal/service/lightsail/service_endpoints_gen_test.go index 05895388adc..0b0ea7bd461 100644 --- a/internal/service/lightsail/service_endpoints_gen_test.go +++ b/internal/service/lightsail/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "lightsail" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/location/service_endpoints_gen_test.go b/internal/service/location/service_endpoints_gen_test.go index d52bdd9ae2d..88afd6a4df1 100644 --- a/internal/service/location/service_endpoints_gen_test.go +++ b/internal/service/location/service_endpoints_gen_test.go @@ -77,6 +77,10 @@ const ( aliasName0 = "locationservice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -395,7 +399,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -409,42 +413,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/logs/service_endpoints_gen_test.go b/internal/service/logs/service_endpoints_gen_test.go index a4b4c83da6a..fb260143c72 100644 --- a/internal/service/logs/service_endpoints_gen_test.go +++ b/internal/service/logs/service_endpoints_gen_test.go @@ -82,6 +82,10 @@ const ( aliasName1 = "cloudwatchlogs" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -477,7 +481,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -491,49 +495,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lookoutmetrics/service_endpoints_gen_test.go b/internal/service/lookoutmetrics/service_endpoints_gen_test.go index 49462347af1..c83f0b94f02 100644 --- a/internal/service/lookoutmetrics/service_endpoints_gen_test.go +++ b/internal/service/lookoutmetrics/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "lookoutmetrics" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/m2/service_endpoints_gen_test.go b/internal/service/m2/service_endpoints_gen_test.go index c4efea5b153..bad0778aee1 100644 --- a/internal/service/m2/service_endpoints_gen_test.go +++ b/internal/service/m2/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "m2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/macie2/service_endpoints_gen_test.go b/internal/service/macie2/service_endpoints_gen_test.go index a3169123bb0..6ac94a7db8b 100644 --- a/internal/service/macie2/service_endpoints_gen_test.go +++ b/internal/service/macie2/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "macie2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mediaconnect/service_endpoints_gen_test.go b/internal/service/mediaconnect/service_endpoints_gen_test.go index 8d05148011a..41808c07864 100644 --- a/internal/service/mediaconnect/service_endpoints_gen_test.go +++ b/internal/service/mediaconnect/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "mediaconnect" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mediaconvert/service_endpoints_gen_test.go b/internal/service/mediaconvert/service_endpoints_gen_test.go index 279e79a4403..6f28d0805c5 100644 --- a/internal/service/mediaconvert/service_endpoints_gen_test.go +++ b/internal/service/mediaconvert/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "mediaconvert" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/medialive/service_endpoints_gen_test.go b/internal/service/medialive/service_endpoints_gen_test.go index bd1aaac0e17..48214632a45 100644 --- a/internal/service/medialive/service_endpoints_gen_test.go +++ b/internal/service/medialive/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "medialive" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mediapackage/service_endpoints_gen_test.go b/internal/service/mediapackage/service_endpoints_gen_test.go index 173b0fe859a..24a59cc2ea5 100644 --- a/internal/service/mediapackage/service_endpoints_gen_test.go +++ b/internal/service/mediapackage/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "mediapackage" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mediapackagev2/service_endpoints_gen_test.go b/internal/service/mediapackagev2/service_endpoints_gen_test.go index 3acfaff7fa5..2513d45b987 100644 --- a/internal/service/mediapackagev2/service_endpoints_gen_test.go +++ b/internal/service/mediapackagev2/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "mediapackagev2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mediastore/service_endpoints_gen_test.go b/internal/service/mediastore/service_endpoints_gen_test.go index 6e0aae00546..e9ed2b26013 100644 --- a/internal/service/mediastore/service_endpoints_gen_test.go +++ b/internal/service/mediastore/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "mediastore" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/memorydb/service_endpoints_gen_test.go b/internal/service/memorydb/service_endpoints_gen_test.go index c682aecd312..8d399219203 100644 --- a/internal/service/memorydb/service_endpoints_gen_test.go +++ b/internal/service/memorydb/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "memorydb" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mq/service_endpoints_gen_test.go b/internal/service/mq/service_endpoints_gen_test.go index a9005632141..f30474344e6 100644 --- a/internal/service/mq/service_endpoints_gen_test.go +++ b/internal/service/mq/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "mq" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/neptune/service_endpoints_gen_test.go b/internal/service/neptune/service_endpoints_gen_test.go index 981aa85f9a5..504f7b87d95 100644 --- a/internal/service/neptune/service_endpoints_gen_test.go +++ b/internal/service/neptune/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "neptune" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/networkfirewall/service_endpoints_gen_test.go b/internal/service/networkfirewall/service_endpoints_gen_test.go index 8daf1c4f059..69ad4a6893b 100644 --- a/internal/service/networkfirewall/service_endpoints_gen_test.go +++ b/internal/service/networkfirewall/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "network_firewall" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/networkmanager/service_endpoints_gen_test.go b/internal/service/networkmanager/service_endpoints_gen_test.go index 3031cdbb233..9f5731b9cf9 100644 --- a/internal/service/networkmanager/service_endpoints_gen_test.go +++ b/internal/service/networkmanager/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "networkmanager" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/oam/service_endpoints_gen_test.go b/internal/service/oam/service_endpoints_gen_test.go index 87204d19e9b..625925e7471 100644 --- a/internal/service/oam/service_endpoints_gen_test.go +++ b/internal/service/oam/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "cloudwatchobservabilityaccessmanager" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/opensearch/service_endpoints_gen_test.go b/internal/service/opensearch/service_endpoints_gen_test.go index eadf94c5aca..36696e21132 100644 --- a/internal/service/opensearch/service_endpoints_gen_test.go +++ b/internal/service/opensearch/service_endpoints_gen_test.go @@ -77,6 +77,10 @@ const ( aliasName0 = "opensearchservice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -395,7 +399,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -409,42 +413,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/opensearchserverless/service_endpoints_gen_test.go b/internal/service/opensearchserverless/service_endpoints_gen_test.go index b2a922b82a4..22bf55e711c 100644 --- a/internal/service/opensearchserverless/service_endpoints_gen_test.go +++ b/internal/service/opensearchserverless/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "opensearchserverless" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/opsworks/service_endpoints_gen_test.go b/internal/service/opsworks/service_endpoints_gen_test.go index 66a485eb2a3..130cbbbc289 100644 --- a/internal/service/opsworks/service_endpoints_gen_test.go +++ b/internal/service/opsworks/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "opsworks" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/organizations/service_endpoints_gen_test.go b/internal/service/organizations/service_endpoints_gen_test.go index cbf8b7a209e..f51dd75aea6 100644 --- a/internal/service/organizations/service_endpoints_gen_test.go +++ b/internal/service/organizations/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "organizations" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/osis/service_endpoints_gen_test.go b/internal/service/osis/service_endpoints_gen_test.go index 37fb9ee9c58..180245b00df 100644 --- a/internal/service/osis/service_endpoints_gen_test.go +++ b/internal/service/osis/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "opensearchingestion" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/outposts/service_endpoints_gen_test.go b/internal/service/outposts/service_endpoints_gen_test.go index e46b6e42240..eb556a34822 100644 --- a/internal/service/outposts/service_endpoints_gen_test.go +++ b/internal/service/outposts/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "outposts" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/pcaconnectorad/service_endpoints_gen_test.go b/internal/service/pcaconnectorad/service_endpoints_gen_test.go index 9d5c592f5b6..ac2dca1b9da 100644 --- a/internal/service/pcaconnectorad/service_endpoints_gen_test.go +++ b/internal/service/pcaconnectorad/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "pca_connector_ad" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/pinpoint/service_endpoints_gen_test.go b/internal/service/pinpoint/service_endpoints_gen_test.go index 18a9e2eff14..448f57192dd 100644 --- a/internal/service/pinpoint/service_endpoints_gen_test.go +++ b/internal/service/pinpoint/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "pinpoint" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/pipes/service_endpoints_gen_test.go b/internal/service/pipes/service_endpoints_gen_test.go index 97467aef927..af1015319b3 100644 --- a/internal/service/pipes/service_endpoints_gen_test.go +++ b/internal/service/pipes/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "pipes" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/polly/service_endpoints_gen_test.go b/internal/service/polly/service_endpoints_gen_test.go index 3a286eab79b..9390434a232 100644 --- a/internal/service/polly/service_endpoints_gen_test.go +++ b/internal/service/polly/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "polly" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/pricing/service_endpoints_gen_test.go b/internal/service/pricing/service_endpoints_gen_test.go index f2071c71664..2438449a7a7 100644 --- a/internal/service/pricing/service_endpoints_gen_test.go +++ b/internal/service/pricing/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "pricing" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/qbusiness/service_endpoints_gen_test.go b/internal/service/qbusiness/service_endpoints_gen_test.go index 65ac2e0416f..28853c42e90 100644 --- a/internal/service/qbusiness/service_endpoints_gen_test.go +++ b/internal/service/qbusiness/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "qbusiness" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/qldb/service_endpoints_gen_test.go b/internal/service/qldb/service_endpoints_gen_test.go index 509a91fe81d..fef3c7c1b46 100644 --- a/internal/service/qldb/service_endpoints_gen_test.go +++ b/internal/service/qldb/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "qldb" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/quicksight/service_endpoints_gen_test.go b/internal/service/quicksight/service_endpoints_gen_test.go index 0ffbbeddab5..0f2b1817995 100644 --- a/internal/service/quicksight/service_endpoints_gen_test.go +++ b/internal/service/quicksight/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "quicksight" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -324,7 +328,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -338,35 +342,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ram/service_endpoints_gen_test.go b/internal/service/ram/service_endpoints_gen_test.go index 7c78205ab63..c51411ed8e3 100644 --- a/internal/service/ram/service_endpoints_gen_test.go +++ b/internal/service/ram/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "ram" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/rbin/service_endpoints_gen_test.go b/internal/service/rbin/service_endpoints_gen_test.go index 2dba988a2f0..f95fc93a282 100644 --- a/internal/service/rbin/service_endpoints_gen_test.go +++ b/internal/service/rbin/service_endpoints_gen_test.go @@ -81,6 +81,10 @@ const ( aliasName0 = "recyclebin" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -410,7 +414,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -424,42 +428,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/rds/service_endpoints_gen_test.go b/internal/service/rds/service_endpoints_gen_test.go index b63e968e22b..329d369b50e 100644 --- a/internal/service/rds/service_endpoints_gen_test.go +++ b/internal/service/rds/service_endpoints_gen_test.go @@ -78,6 +78,10 @@ const ( configParam = "rds" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -364,7 +368,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -378,35 +382,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/redshift/service_endpoints_gen_test.go b/internal/service/redshift/service_endpoints_gen_test.go index 7c72dead57a..3e8d67e7ac8 100644 --- a/internal/service/redshift/service_endpoints_gen_test.go +++ b/internal/service/redshift/service_endpoints_gen_test.go @@ -78,6 +78,10 @@ const ( configParam = "redshift" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -364,7 +368,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -378,35 +382,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/redshiftdata/service_endpoints_gen_test.go b/internal/service/redshiftdata/service_endpoints_gen_test.go index 9e31e28f29c..a42c80b2fc7 100644 --- a/internal/service/redshiftdata/service_endpoints_gen_test.go +++ b/internal/service/redshiftdata/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "redshiftdataapiservice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -409,7 +413,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -423,42 +427,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/redshiftserverless/service_endpoints_gen_test.go b/internal/service/redshiftserverless/service_endpoints_gen_test.go index 6d9fe73d464..72cc0856b4a 100644 --- a/internal/service/redshiftserverless/service_endpoints_gen_test.go +++ b/internal/service/redshiftserverless/service_endpoints_gen_test.go @@ -78,6 +78,10 @@ const ( configParam = "redshift_serverless" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -364,7 +368,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -378,35 +382,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/rekognition/service_endpoints_gen_test.go b/internal/service/rekognition/service_endpoints_gen_test.go index c1ae2b5bb29..3ad9f9906b6 100644 --- a/internal/service/rekognition/service_endpoints_gen_test.go +++ b/internal/service/rekognition/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "rekognition" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/resourceexplorer2/service_endpoints_gen_test.go b/internal/service/resourceexplorer2/service_endpoints_gen_test.go index 80bd72471be..becea6d5621 100644 --- a/internal/service/resourceexplorer2/service_endpoints_gen_test.go +++ b/internal/service/resourceexplorer2/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "resource_explorer_2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/resourcegroups/service_endpoints_gen_test.go b/internal/service/resourcegroups/service_endpoints_gen_test.go index feb8cd9a909..5e0e362500c 100644 --- a/internal/service/resourcegroups/service_endpoints_gen_test.go +++ b/internal/service/resourcegroups/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "resource_groups" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go index 92dfe745c77..29614f9ff62 100644 --- a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go +++ b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "resourcegroupstagging" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/rolesanywhere/service_endpoints_gen_test.go b/internal/service/rolesanywhere/service_endpoints_gen_test.go index 8fb6c003c67..dc65e1f15cc 100644 --- a/internal/service/rolesanywhere/service_endpoints_gen_test.go +++ b/internal/service/rolesanywhere/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "rolesanywhere" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/route53/service_endpoints_gen_test.go b/internal/service/route53/service_endpoints_gen_test.go index 916152939d3..bd1abed6ead 100644 --- a/internal/service/route53/service_endpoints_gen_test.go +++ b/internal/service/route53/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "route_53" ) +const ( + expectedCallRegion = "us-east-1" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-east-1", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } diff --git a/internal/service/route53domains/service_endpoints_gen_test.go b/internal/service/route53domains/service_endpoints_gen_test.go index cfed69fe45a..d7bd5fd320b 100644 --- a/internal/service/route53domains/service_endpoints_gen_test.go +++ b/internal/service/route53domains/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "route_53_domains" ) +const ( + expectedCallRegion = "us-east-1" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 // Route 53 Domains uses a regional endpoint but is only available in one region or a limited number of regions. @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-east-1", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } diff --git a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go index 83a21f9a069..ff2f033ab1a 100644 --- a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go +++ b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "route53_recovery_control_config" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go index d608dbca691..075228b2f35 100644 --- a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go +++ b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "route53_recovery_readiness" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -325,7 +329,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -339,35 +343,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/route53resolver/service_endpoints_gen_test.go b/internal/service/route53resolver/service_endpoints_gen_test.go index 26c8559816c..b85f6748bfc 100644 --- a/internal/service/route53resolver/service_endpoints_gen_test.go +++ b/internal/service/route53resolver/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "route53resolver" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/rum/service_endpoints_gen_test.go b/internal/service/rum/service_endpoints_gen_test.go index 36479355d6e..60ac59e97cf 100644 --- a/internal/service/rum/service_endpoints_gen_test.go +++ b/internal/service/rum/service_endpoints_gen_test.go @@ -77,6 +77,10 @@ const ( aliasName0 = "cloudwatchrum" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -395,7 +399,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -409,42 +413,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/s3/service_endpoints_gen_test.go b/internal/service/s3/service_endpoints_gen_test.go index 84e006bbfa9..09642e40e1e 100644 --- a/internal/service/s3/service_endpoints_gen_test.go +++ b/internal/service/s3/service_endpoints_gen_test.go @@ -82,6 +82,10 @@ const ( aliasName0 = "s3api" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -539,7 +543,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -553,28 +557,28 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } @@ -584,7 +588,7 @@ func expectTfAwsEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(tfAwsEnvVar, awsEnvVar), }, - region: "us-west-2", + region: expectedCallRegion, } } @@ -594,21 +598,21 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(deprecatedEnvVar, awsEnvVar), }, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/s3outposts/service_endpoints_gen_test.go b/internal/service/s3outposts/service_endpoints_gen_test.go index 87ca2971152..a5c22f10333 100644 --- a/internal/service/s3outposts/service_endpoints_gen_test.go +++ b/internal/service/s3outposts/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "s3outposts" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sagemaker/service_endpoints_gen_test.go b/internal/service/sagemaker/service_endpoints_gen_test.go index 1b88316f72c..2e0406be361 100644 --- a/internal/service/sagemaker/service_endpoints_gen_test.go +++ b/internal/service/sagemaker/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "sagemaker" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/scheduler/service_endpoints_gen_test.go b/internal/service/scheduler/service_endpoints_gen_test.go index f3457019f19..3f22e05b246 100644 --- a/internal/service/scheduler/service_endpoints_gen_test.go +++ b/internal/service/scheduler/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "scheduler" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/schemas/service_endpoints_gen_test.go b/internal/service/schemas/service_endpoints_gen_test.go index d865e65f171..ca3d216a0fe 100644 --- a/internal/service/schemas/service_endpoints_gen_test.go +++ b/internal/service/schemas/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "schemas" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/secretsmanager/service_endpoints_gen_test.go b/internal/service/secretsmanager/service_endpoints_gen_test.go index a80c09bc23d..c653bbbd80a 100644 --- a/internal/service/secretsmanager/service_endpoints_gen_test.go +++ b/internal/service/secretsmanager/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "secrets_manager" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/securityhub/service_endpoints_gen_test.go b/internal/service/securityhub/service_endpoints_gen_test.go index 613072f5f02..769c73a223f 100644 --- a/internal/service/securityhub/service_endpoints_gen_test.go +++ b/internal/service/securityhub/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "securityhub" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/securitylake/service_endpoints_gen_test.go b/internal/service/securitylake/service_endpoints_gen_test.go index fef4cbfca31..e789327ceb3 100644 --- a/internal/service/securitylake/service_endpoints_gen_test.go +++ b/internal/service/securitylake/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "securitylake" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/serverlessrepo/service_endpoints_gen_test.go b/internal/service/serverlessrepo/service_endpoints_gen_test.go index c319282c73c..9b209888b29 100644 --- a/internal/service/serverlessrepo/service_endpoints_gen_test.go +++ b/internal/service/serverlessrepo/service_endpoints_gen_test.go @@ -79,6 +79,10 @@ const ( aliasName1 = "serverlessapplicationrepository" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -465,7 +469,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -479,49 +483,49 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName1ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName1ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/servicecatalog/service_endpoints_gen_test.go b/internal/service/servicecatalog/service_endpoints_gen_test.go index 0b1fd28eaa3..a984c99f380 100644 --- a/internal/service/servicecatalog/service_endpoints_gen_test.go +++ b/internal/service/servicecatalog/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "service_catalog" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go index 0639df20380..affce879770 100644 --- a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go +++ b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "appregistry" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/servicediscovery/service_endpoints_gen_test.go b/internal/service/servicediscovery/service_endpoints_gen_test.go index 364fabd4ce7..6f3ed38e67c 100644 --- a/internal/service/servicediscovery/service_endpoints_gen_test.go +++ b/internal/service/servicediscovery/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "servicediscovery" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/servicequotas/service_endpoints_gen_test.go b/internal/service/servicequotas/service_endpoints_gen_test.go index e0b974ad80a..37ac62d9901 100644 --- a/internal/service/servicequotas/service_endpoints_gen_test.go +++ b/internal/service/servicequotas/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "service_quotas" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ses/service_endpoints_gen_test.go b/internal/service/ses/service_endpoints_gen_test.go index f2bcbc57f7c..913be6f0e4e 100644 --- a/internal/service/ses/service_endpoints_gen_test.go +++ b/internal/service/ses/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "ses" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sesv2/service_endpoints_gen_test.go b/internal/service/sesv2/service_endpoints_gen_test.go index be29063e294..40b5c677248 100644 --- a/internal/service/sesv2/service_endpoints_gen_test.go +++ b/internal/service/sesv2/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "sesv2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sfn/service_endpoints_gen_test.go b/internal/service/sfn/service_endpoints_gen_test.go index c60eef49fa6..f8a4b83674f 100644 --- a/internal/service/sfn/service_endpoints_gen_test.go +++ b/internal/service/sfn/service_endpoints_gen_test.go @@ -77,6 +77,10 @@ const ( aliasName0 = "stepfunctions" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -395,7 +399,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -409,42 +413,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/shield/service_endpoints_gen_test.go b/internal/service/shield/service_endpoints_gen_test.go index 53ca531b463..3add06ca9ab 100644 --- a/internal/service/shield/service_endpoints_gen_test.go +++ b/internal/service/shield/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "shield" ) +const ( + expectedCallRegion = "us-east-1" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-east-1", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-east-1", + region: expectedCallRegion, } } diff --git a/internal/service/signer/service_endpoints_gen_test.go b/internal/service/signer/service_endpoints_gen_test.go index c8c938e1846..f402c0abe93 100644 --- a/internal/service/signer/service_endpoints_gen_test.go +++ b/internal/service/signer/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "signer" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/simpledb/service_endpoints_gen_test.go b/internal/service/simpledb/service_endpoints_gen_test.go index 4485cdda6ec..cfed7d04f6b 100644 --- a/internal/service/simpledb/service_endpoints_gen_test.go +++ b/internal/service/simpledb/service_endpoints_gen_test.go @@ -77,6 +77,10 @@ const ( aliasName0 = "sdb" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -395,7 +399,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -409,42 +413,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sns/service_endpoints_gen_test.go b/internal/service/sns/service_endpoints_gen_test.go index c4b7f1a0eb3..409d7e77870 100644 --- a/internal/service/sns/service_endpoints_gen_test.go +++ b/internal/service/sns/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "sns" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sqs/service_endpoints_gen_test.go b/internal/service/sqs/service_endpoints_gen_test.go index d16c0f1cded..761ab2a33bd 100644 --- a/internal/service/sqs/service_endpoints_gen_test.go +++ b/internal/service/sqs/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "sqs" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ssm/service_endpoints_gen_test.go b/internal/service/ssm/service_endpoints_gen_test.go index 2676b633166..fe7a3a2d661 100644 --- a/internal/service/ssm/service_endpoints_gen_test.go +++ b/internal/service/ssm/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "ssm" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ssmcontacts/service_endpoints_gen_test.go b/internal/service/ssmcontacts/service_endpoints_gen_test.go index 41263d24207..7a98f212df6 100644 --- a/internal/service/ssmcontacts/service_endpoints_gen_test.go +++ b/internal/service/ssmcontacts/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "ssm_contacts" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ssmincidents/service_endpoints_gen_test.go b/internal/service/ssmincidents/service_endpoints_gen_test.go index 3de1cab521f..4227b096222 100644 --- a/internal/service/ssmincidents/service_endpoints_gen_test.go +++ b/internal/service/ssmincidents/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "ssm_incidents" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ssmsap/service_endpoints_gen_test.go b/internal/service/ssmsap/service_endpoints_gen_test.go index 40fcccc3750..5a9bf0b2eeb 100644 --- a/internal/service/ssmsap/service_endpoints_gen_test.go +++ b/internal/service/ssmsap/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "ssm_sap" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sso/service_endpoints_gen_test.go b/internal/service/sso/service_endpoints_gen_test.go index 55a1e27cffa..6121671de83 100644 --- a/internal/service/sso/service_endpoints_gen_test.go +++ b/internal/service/sso/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "sso" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ssoadmin/service_endpoints_gen_test.go b/internal/service/ssoadmin/service_endpoints_gen_test.go index 325a38d7ec2..95a9b9c8632 100644 --- a/internal/service/ssoadmin/service_endpoints_gen_test.go +++ b/internal/service/ssoadmin/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "sso_admin" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/storagegateway/service_endpoints_gen_test.go b/internal/service/storagegateway/service_endpoints_gen_test.go index e6bba441a2a..3fabaec9185 100644 --- a/internal/service/storagegateway/service_endpoints_gen_test.go +++ b/internal/service/storagegateway/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "storage_gateway" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -322,7 +326,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -336,35 +340,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sts/service_endpoints_gen_test.go b/internal/service/sts/service_endpoints_gen_test.go index 039487231d9..c080ac7babe 100644 --- a/internal/service/sts/service_endpoints_gen_test.go +++ b/internal/service/sts/service_endpoints_gen_test.go @@ -79,6 +79,10 @@ const ( deprecatedEnvVar = "AWS_STS_ENDPOINT" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -452,7 +456,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -466,21 +470,21 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } @@ -490,7 +494,7 @@ func expectTfAwsEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(tfAwsEnvVar, awsEnvVar), }, - region: "us-west-2", + region: expectedCallRegion, } } @@ -500,21 +504,21 @@ func expectDeprecatedEnvVarEndpoint() caseExpectations { diags: diag.Diagnostics{ provider.DeprecatedEnvVarDiag(deprecatedEnvVar, awsEnvVar), }, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/swf/service_endpoints_gen_test.go b/internal/service/swf/service_endpoints_gen_test.go index 5004e15e17e..ba5cb1e2617 100644 --- a/internal/service/swf/service_endpoints_gen_test.go +++ b/internal/service/swf/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "swf" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -336,7 +340,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -350,35 +354,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/synthetics/service_endpoints_gen_test.go b/internal/service/synthetics/service_endpoints_gen_test.go index 4d2b58231cb..93bd09ebd87 100644 --- a/internal/service/synthetics/service_endpoints_gen_test.go +++ b/internal/service/synthetics/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "synthetics" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go index 3365150ba32..82198f35c0f 100644 --- a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go +++ b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "timestream_influxdb" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/transcribe/service_endpoints_gen_test.go b/internal/service/transcribe/service_endpoints_gen_test.go index 58b7c15affe..340f70f5c97 100644 --- a/internal/service/transcribe/service_endpoints_gen_test.go +++ b/internal/service/transcribe/service_endpoints_gen_test.go @@ -80,6 +80,10 @@ const ( aliasName0 = "transcribeservice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -407,7 +411,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -421,42 +425,42 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAliasName0ConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: aliasName0ConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/transfer/service_endpoints_gen_test.go b/internal/service/transfer/service_endpoints_gen_test.go index 8c13cac592e..aaa886d74db 100644 --- a/internal/service/transfer/service_endpoints_gen_test.go +++ b/internal/service/transfer/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "transfer" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/verifiedpermissions/service_endpoints_gen_test.go b/internal/service/verifiedpermissions/service_endpoints_gen_test.go index 2b00bf670b6..78ed1bf5a31 100644 --- a/internal/service/verifiedpermissions/service_endpoints_gen_test.go +++ b/internal/service/verifiedpermissions/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "verifiedpermissions" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/vpclattice/service_endpoints_gen_test.go b/internal/service/vpclattice/service_endpoints_gen_test.go index f611a7f6539..5d33382c5e7 100644 --- a/internal/service/vpclattice/service_endpoints_gen_test.go +++ b/internal/service/vpclattice/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "vpc_lattice" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/waf/service_endpoints_gen_test.go b/internal/service/waf/service_endpoints_gen_test.go index f0cd1057fe9..67cf341f970 100644 --- a/internal/service/waf/service_endpoints_gen_test.go +++ b/internal/service/waf/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "waf" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/wafregional/service_endpoints_gen_test.go b/internal/service/wafregional/service_endpoints_gen_test.go index d3b48a6e29a..69875dec601 100644 --- a/internal/service/wafregional/service_endpoints_gen_test.go +++ b/internal/service/wafregional/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "waf_regional" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/wafv2/service_endpoints_gen_test.go b/internal/service/wafv2/service_endpoints_gen_test.go index 8641d31337d..7434a5aed29 100644 --- a/internal/service/wafv2/service_endpoints_gen_test.go +++ b/internal/service/wafv2/service_endpoints_gen_test.go @@ -76,6 +76,10 @@ const ( configParam = "wafv2" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -337,7 +341,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -351,35 +355,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/wellarchitected/service_endpoints_gen_test.go b/internal/service/wellarchitected/service_endpoints_gen_test.go index dfe62d2a86a..d3eedd7dd5b 100644 --- a/internal/service/wellarchitected/service_endpoints_gen_test.go +++ b/internal/service/wellarchitected/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "wellarchitected" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/worklink/service_endpoints_gen_test.go b/internal/service/worklink/service_endpoints_gen_test.go index 031b96551a1..5fe28c22950 100644 --- a/internal/service/worklink/service_endpoints_gen_test.go +++ b/internal/service/worklink/service_endpoints_gen_test.go @@ -72,6 +72,10 @@ const ( configParam = "worklink" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -325,7 +329,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -339,35 +343,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/workspaces/service_endpoints_gen_test.go b/internal/service/workspaces/service_endpoints_gen_test.go index 1281478d2a6..e4559f0f126 100644 --- a/internal/service/workspaces/service_endpoints_gen_test.go +++ b/internal/service/workspaces/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "workspaces" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/workspacesweb/service_endpoints_gen_test.go b/internal/service/workspacesweb/service_endpoints_gen_test.go index e9aa975b7d3..a88e21beb23 100644 --- a/internal/service/workspacesweb/service_endpoints_gen_test.go +++ b/internal/service/workspacesweb/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "workspaces_web" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/xray/service_endpoints_gen_test.go b/internal/service/xray/service_endpoints_gen_test.go index 7825371e602..b2359b51fc8 100644 --- a/internal/service/xray/service_endpoints_gen_test.go +++ b/internal/service/xray/service_endpoints_gen_test.go @@ -75,6 +75,10 @@ const ( configParam = "xray" ) +const ( + expectedCallRegion = "us-west-2" //lintignore:AWSAT003 +) + func TestEndpointConfiguration(t *testing.T) { //nolint:paralleltest // uses t.Setenv const providerRegion = "us-west-2" //lintignore:AWSAT003 const expectedEndpointRegion = providerRegion @@ -334,7 +338,7 @@ func withUseFIPSInConfig(setup *caseSetup) { func expectDefaultEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } @@ -348,35 +352,35 @@ func expectDefaultFIPSEndpoint(region string) caseExpectations { func expectPackageNameConfigEndpoint() caseExpectations { return caseExpectations{ endpoint: packageNameConfigEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectAwsEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: awsServiceEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseEnvVarEndpoint() caseExpectations { return caseExpectations{ endpoint: baseEnvvarEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectServiceConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: serviceConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } func expectBaseConfigFileEndpoint() caseExpectations { return caseExpectations{ endpoint: baseConfigFileEndpoint, - region: "us-west-2", + region: expectedCallRegion, } } From 3dcb64304a73b9ab1577cc2754d7e080e866f5c7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 5 Jun 2024 23:16:44 -0700 Subject: [PATCH 14/15] `import-lint` --- internal/generate/serviceendpointtests/file.gtpl | 4 +++- internal/service/batch/service_endpoints_gen_test.go | 3 +-- internal/service/ds/service_endpoints_gen_test.go | 3 +-- internal/service/ec2/service_endpoints_gen_test.go | 3 +-- internal/service/ecs/service_endpoints_gen_test.go | 3 +-- internal/service/elasticache/service_endpoints_gen_test.go | 3 +-- internal/service/elbv2/service_endpoints_gen_test.go | 3 +-- internal/service/emr/service_endpoints_gen_test.go | 3 +-- internal/service/rds/service_endpoints_gen_test.go | 3 +-- internal/service/redshift/service_endpoints_gen_test.go | 3 +-- .../service/redshiftserverless/service_endpoints_gen_test.go | 3 +-- 11 files changed, 13 insertions(+), 21 deletions(-) diff --git a/internal/generate/serviceendpointtests/file.gtpl b/internal/generate/serviceendpointtests/file.gtpl index 953bb428eb4..06a0e09c0dc 100644 --- a/internal/generate/serviceendpointtests/file.gtpl +++ b/internal/generate/serviceendpointtests/file.gtpl @@ -20,7 +20,9 @@ import ( {{ if ne .GoV1Package "" }} aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - {{ if eq .GoV2Package "" }}"github.com/aws/aws-sdk-go/aws/endpoints"{{ end }} + {{- if eq .GoV2Package "" }} + "github.com/aws/aws-sdk-go/aws/endpoints" + {{- end }} {{ .GoV1Package }}_sdkv1 "github.com/aws/aws-sdk-go/service/{{ .GoV1Package }}" {{- end }} {{- if ne .V1AlternateInputPackage "" }} diff --git a/internal/service/batch/service_endpoints_gen_test.go b/internal/service/batch/service_endpoints_gen_test.go index 39b82e0eb38..27d3b087952 100644 --- a/internal/service/batch/service_endpoints_gen_test.go +++ b/internal/service/batch/service_endpoints_gen_test.go @@ -13,11 +13,10 @@ import ( "strings" "testing" - aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" batch_sdkv2 "github.com/aws/aws-sdk-go-v2/service/batch" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" batch_sdkv1 "github.com/aws/aws-sdk-go/service/batch" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" diff --git a/internal/service/ds/service_endpoints_gen_test.go b/internal/service/ds/service_endpoints_gen_test.go index 6d509f3e666..0bdaeb26bae 100644 --- a/internal/service/ds/service_endpoints_gen_test.go +++ b/internal/service/ds/service_endpoints_gen_test.go @@ -13,11 +13,10 @@ import ( "strings" "testing" - aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" directoryservice_sdkv2 "github.com/aws/aws-sdk-go-v2/service/directoryservice" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" directoryservice_sdkv1 "github.com/aws/aws-sdk-go/service/directoryservice" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" diff --git a/internal/service/ec2/service_endpoints_gen_test.go b/internal/service/ec2/service_endpoints_gen_test.go index a4c6c73764b..e2a34392a39 100644 --- a/internal/service/ec2/service_endpoints_gen_test.go +++ b/internal/service/ec2/service_endpoints_gen_test.go @@ -13,11 +13,10 @@ import ( "strings" "testing" - aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ec2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ec2" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" ec2_sdkv1 "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" diff --git a/internal/service/ecs/service_endpoints_gen_test.go b/internal/service/ecs/service_endpoints_gen_test.go index 1127b2c2145..5eb246f3dc7 100644 --- a/internal/service/ecs/service_endpoints_gen_test.go +++ b/internal/service/ecs/service_endpoints_gen_test.go @@ -13,11 +13,10 @@ import ( "strings" "testing" - aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" ecs_sdkv2 "github.com/aws/aws-sdk-go-v2/service/ecs" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" ecs_sdkv1 "github.com/aws/aws-sdk-go/service/ecs" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" diff --git a/internal/service/elasticache/service_endpoints_gen_test.go b/internal/service/elasticache/service_endpoints_gen_test.go index 40a44915496..050d489cca4 100644 --- a/internal/service/elasticache/service_endpoints_gen_test.go +++ b/internal/service/elasticache/service_endpoints_gen_test.go @@ -13,11 +13,10 @@ import ( "strings" "testing" - aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" elasticache_sdkv2 "github.com/aws/aws-sdk-go-v2/service/elasticache" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" elasticache_sdkv1 "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" diff --git a/internal/service/elbv2/service_endpoints_gen_test.go b/internal/service/elbv2/service_endpoints_gen_test.go index c2863705045..6faf0a19565 100644 --- a/internal/service/elbv2/service_endpoints_gen_test.go +++ b/internal/service/elbv2/service_endpoints_gen_test.go @@ -13,11 +13,10 @@ import ( "strings" "testing" - aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" elasticloadbalancingv2_sdkv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" elbv2_sdkv1 "github.com/aws/aws-sdk-go/service/elbv2" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" diff --git a/internal/service/emr/service_endpoints_gen_test.go b/internal/service/emr/service_endpoints_gen_test.go index c681ab48531..46b0bfcd8b4 100644 --- a/internal/service/emr/service_endpoints_gen_test.go +++ b/internal/service/emr/service_endpoints_gen_test.go @@ -13,11 +13,10 @@ import ( "strings" "testing" - aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" emr_sdkv2 "github.com/aws/aws-sdk-go-v2/service/emr" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" emr_sdkv1 "github.com/aws/aws-sdk-go/service/emr" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" diff --git a/internal/service/rds/service_endpoints_gen_test.go b/internal/service/rds/service_endpoints_gen_test.go index 329d369b50e..485532dd1c4 100644 --- a/internal/service/rds/service_endpoints_gen_test.go +++ b/internal/service/rds/service_endpoints_gen_test.go @@ -13,11 +13,10 @@ import ( "strings" "testing" - aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" rds_sdkv2 "github.com/aws/aws-sdk-go-v2/service/rds" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" rds_sdkv1 "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" diff --git a/internal/service/redshift/service_endpoints_gen_test.go b/internal/service/redshift/service_endpoints_gen_test.go index 3e8d67e7ac8..4dfa40e3131 100644 --- a/internal/service/redshift/service_endpoints_gen_test.go +++ b/internal/service/redshift/service_endpoints_gen_test.go @@ -13,11 +13,10 @@ import ( "strings" "testing" - aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" redshift_sdkv2 "github.com/aws/aws-sdk-go-v2/service/redshift" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" redshift_sdkv1 "github.com/aws/aws-sdk-go/service/redshift" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" diff --git a/internal/service/redshiftserverless/service_endpoints_gen_test.go b/internal/service/redshiftserverless/service_endpoints_gen_test.go index 72cc0856b4a..99c499f8cc4 100644 --- a/internal/service/redshiftserverless/service_endpoints_gen_test.go +++ b/internal/service/redshiftserverless/service_endpoints_gen_test.go @@ -13,11 +13,10 @@ import ( "strings" "testing" - aws_sdkv1 "github.com/aws/aws-sdk-go/aws" - aws_sdkv2 "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" redshiftserverless_sdkv2 "github.com/aws/aws-sdk-go-v2/service/redshiftserverless" + aws_sdkv1 "github.com/aws/aws-sdk-go/aws" redshiftserverless_sdkv1 "github.com/aws/aws-sdk-go/service/redshiftserverless" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" From 3b4a4fe652b5c35cb4d2c9a185782b33c9128b61 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 6 Jun 2024 19:54:42 -0700 Subject: [PATCH 15/15] Moves remaining region constants --- internal/generate/serviceendpointtests/file.gtpl | 2 +- internal/service/accessanalyzer/service_endpoints_gen_test.go | 2 +- internal/service/account/service_endpoints_gen_test.go | 2 +- internal/service/acm/service_endpoints_gen_test.go | 2 +- internal/service/acmpca/service_endpoints_gen_test.go | 2 +- internal/service/amp/service_endpoints_gen_test.go | 2 +- internal/service/amplify/service_endpoints_gen_test.go | 2 +- internal/service/apigateway/service_endpoints_gen_test.go | 2 +- internal/service/apigatewayv2/service_endpoints_gen_test.go | 2 +- internal/service/appautoscaling/service_endpoints_gen_test.go | 2 +- internal/service/appconfig/service_endpoints_gen_test.go | 2 +- internal/service/appfabric/service_endpoints_gen_test.go | 2 +- internal/service/appflow/service_endpoints_gen_test.go | 2 +- internal/service/appintegrations/service_endpoints_gen_test.go | 2 +- .../service/applicationinsights/service_endpoints_gen_test.go | 2 +- internal/service/appmesh/service_endpoints_gen_test.go | 2 +- internal/service/apprunner/service_endpoints_gen_test.go | 2 +- internal/service/appstream/service_endpoints_gen_test.go | 2 +- internal/service/appsync/service_endpoints_gen_test.go | 2 +- internal/service/athena/service_endpoints_gen_test.go | 2 +- internal/service/auditmanager/service_endpoints_gen_test.go | 2 +- internal/service/autoscaling/service_endpoints_gen_test.go | 2 +- internal/service/autoscalingplans/service_endpoints_gen_test.go | 2 +- internal/service/backup/service_endpoints_gen_test.go | 2 +- internal/service/batch/service_endpoints_gen_test.go | 2 +- internal/service/bcmdataexports/service_endpoints_gen_test.go | 2 +- internal/service/bedrock/service_endpoints_gen_test.go | 2 +- internal/service/bedrockagent/service_endpoints_gen_test.go | 2 +- internal/service/budgets/service_endpoints_gen_test.go | 2 +- internal/service/ce/service_endpoints_gen_test.go | 2 +- internal/service/chatbot/service_endpoints_gen_test.go | 2 +- internal/service/chime/service_endpoints_gen_test.go | 2 +- .../chimesdkmediapipelines/service_endpoints_gen_test.go | 2 +- internal/service/chimesdkvoice/service_endpoints_gen_test.go | 2 +- internal/service/cleanrooms/service_endpoints_gen_test.go | 2 +- internal/service/cloud9/service_endpoints_gen_test.go | 2 +- internal/service/cloudcontrol/service_endpoints_gen_test.go | 2 +- internal/service/cloudformation/service_endpoints_gen_test.go | 2 +- internal/service/cloudfront/service_endpoints_gen_test.go | 2 +- internal/service/cloudhsmv2/service_endpoints_gen_test.go | 2 +- internal/service/cloudsearch/service_endpoints_gen_test.go | 2 +- internal/service/cloudtrail/service_endpoints_gen_test.go | 2 +- internal/service/cloudwatch/service_endpoints_gen_test.go | 2 +- internal/service/codeartifact/service_endpoints_gen_test.go | 2 +- internal/service/codebuild/service_endpoints_gen_test.go | 2 +- internal/service/codecommit/service_endpoints_gen_test.go | 2 +- internal/service/codeguruprofiler/service_endpoints_gen_test.go | 2 +- internal/service/codegurureviewer/service_endpoints_gen_test.go | 2 +- internal/service/codepipeline/service_endpoints_gen_test.go | 2 +- .../service/codestarconnections/service_endpoints_gen_test.go | 2 +- .../service/codestarnotifications/service_endpoints_gen_test.go | 2 +- internal/service/cognitoidentity/service_endpoints_gen_test.go | 2 +- internal/service/cognitoidp/service_endpoints_gen_test.go | 2 +- internal/service/comprehend/service_endpoints_gen_test.go | 2 +- internal/service/computeoptimizer/service_endpoints_gen_test.go | 2 +- internal/service/configservice/service_endpoints_gen_test.go | 2 +- internal/service/connect/service_endpoints_gen_test.go | 2 +- internal/service/connectcases/service_endpoints_gen_test.go | 2 +- internal/service/controltower/service_endpoints_gen_test.go | 2 +- .../service/costoptimizationhub/service_endpoints_gen_test.go | 2 +- internal/service/cur/service_endpoints_gen_test.go | 2 +- internal/service/customerprofiles/service_endpoints_gen_test.go | 2 +- internal/service/dataexchange/service_endpoints_gen_test.go | 2 +- internal/service/datapipeline/service_endpoints_gen_test.go | 2 +- internal/service/datasync/service_endpoints_gen_test.go | 2 +- internal/service/datazone/service_endpoints_gen_test.go | 2 +- internal/service/dax/service_endpoints_gen_test.go | 2 +- internal/service/deploy/service_endpoints_gen_test.go | 2 +- internal/service/detective/service_endpoints_gen_test.go | 2 +- internal/service/devicefarm/service_endpoints_gen_test.go | 2 +- internal/service/devopsguru/service_endpoints_gen_test.go | 2 +- internal/service/directconnect/service_endpoints_gen_test.go | 2 +- internal/service/dlm/service_endpoints_gen_test.go | 2 +- internal/service/dms/service_endpoints_gen_test.go | 2 +- internal/service/docdb/service_endpoints_gen_test.go | 2 +- internal/service/docdbelastic/service_endpoints_gen_test.go | 2 +- internal/service/drs/service_endpoints_gen_test.go | 2 +- internal/service/ds/service_endpoints_gen_test.go | 2 +- internal/service/dynamodb/service_endpoints_gen_test.go | 2 +- internal/service/ec2/service_endpoints_gen_test.go | 2 +- internal/service/ecr/service_endpoints_gen_test.go | 2 +- internal/service/ecrpublic/service_endpoints_gen_test.go | 2 +- internal/service/ecs/service_endpoints_gen_test.go | 2 +- internal/service/efs/service_endpoints_gen_test.go | 2 +- internal/service/eks/service_endpoints_gen_test.go | 2 +- internal/service/elasticache/service_endpoints_gen_test.go | 2 +- internal/service/elasticbeanstalk/service_endpoints_gen_test.go | 2 +- internal/service/elasticsearch/service_endpoints_gen_test.go | 2 +- .../service/elastictranscoder/service_endpoints_gen_test.go | 2 +- internal/service/elb/service_endpoints_gen_test.go | 2 +- internal/service/elbv2/service_endpoints_gen_test.go | 2 +- internal/service/emr/service_endpoints_gen_test.go | 2 +- internal/service/emrcontainers/service_endpoints_gen_test.go | 2 +- internal/service/emrserverless/service_endpoints_gen_test.go | 2 +- internal/service/events/service_endpoints_gen_test.go | 2 +- internal/service/evidently/service_endpoints_gen_test.go | 2 +- internal/service/finspace/service_endpoints_gen_test.go | 2 +- internal/service/firehose/service_endpoints_gen_test.go | 2 +- internal/service/fis/service_endpoints_gen_test.go | 2 +- internal/service/fms/service_endpoints_gen_test.go | 2 +- internal/service/fsx/service_endpoints_gen_test.go | 2 +- internal/service/gamelift/service_endpoints_gen_test.go | 2 +- internal/service/glacier/service_endpoints_gen_test.go | 2 +- .../service/globalaccelerator/service_endpoints_gen_test.go | 2 +- internal/service/glue/service_endpoints_gen_test.go | 2 +- internal/service/grafana/service_endpoints_gen_test.go | 2 +- internal/service/greengrass/service_endpoints_gen_test.go | 2 +- internal/service/groundstation/service_endpoints_gen_test.go | 2 +- internal/service/guardduty/service_endpoints_gen_test.go | 2 +- internal/service/healthlake/service_endpoints_gen_test.go | 2 +- internal/service/iam/service_endpoints_gen_test.go | 2 +- internal/service/identitystore/service_endpoints_gen_test.go | 2 +- internal/service/imagebuilder/service_endpoints_gen_test.go | 2 +- internal/service/inspector/service_endpoints_gen_test.go | 2 +- internal/service/inspector2/service_endpoints_gen_test.go | 2 +- internal/service/internetmonitor/service_endpoints_gen_test.go | 2 +- internal/service/iot/service_endpoints_gen_test.go | 2 +- internal/service/iotanalytics/service_endpoints_gen_test.go | 2 +- internal/service/iotevents/service_endpoints_gen_test.go | 2 +- internal/service/ivs/service_endpoints_gen_test.go | 2 +- internal/service/ivschat/service_endpoints_gen_test.go | 2 +- internal/service/kafka/service_endpoints_gen_test.go | 2 +- internal/service/kafkaconnect/service_endpoints_gen_test.go | 2 +- internal/service/kendra/service_endpoints_gen_test.go | 2 +- internal/service/keyspaces/service_endpoints_gen_test.go | 2 +- internal/service/kinesis/service_endpoints_gen_test.go | 2 +- internal/service/kinesisanalytics/service_endpoints_gen_test.go | 2 +- .../service/kinesisanalyticsv2/service_endpoints_gen_test.go | 2 +- internal/service/kinesisvideo/service_endpoints_gen_test.go | 2 +- internal/service/kms/service_endpoints_gen_test.go | 2 +- internal/service/lakeformation/service_endpoints_gen_test.go | 2 +- internal/service/lambda/service_endpoints_gen_test.go | 2 +- internal/service/launchwizard/service_endpoints_gen_test.go | 2 +- internal/service/lexmodels/service_endpoints_gen_test.go | 2 +- internal/service/lexv2models/service_endpoints_gen_test.go | 2 +- internal/service/licensemanager/service_endpoints_gen_test.go | 2 +- internal/service/lightsail/service_endpoints_gen_test.go | 2 +- internal/service/location/service_endpoints_gen_test.go | 2 +- internal/service/logs/service_endpoints_gen_test.go | 2 +- internal/service/lookoutmetrics/service_endpoints_gen_test.go | 2 +- internal/service/m2/service_endpoints_gen_test.go | 2 +- internal/service/macie2/service_endpoints_gen_test.go | 2 +- internal/service/mediaconnect/service_endpoints_gen_test.go | 2 +- internal/service/mediaconvert/service_endpoints_gen_test.go | 2 +- internal/service/medialive/service_endpoints_gen_test.go | 2 +- internal/service/mediapackage/service_endpoints_gen_test.go | 2 +- internal/service/mediapackagev2/service_endpoints_gen_test.go | 2 +- internal/service/mediastore/service_endpoints_gen_test.go | 2 +- internal/service/memorydb/service_endpoints_gen_test.go | 2 +- internal/service/mq/service_endpoints_gen_test.go | 2 +- internal/service/neptune/service_endpoints_gen_test.go | 2 +- internal/service/networkfirewall/service_endpoints_gen_test.go | 2 +- internal/service/networkmanager/service_endpoints_gen_test.go | 2 +- internal/service/oam/service_endpoints_gen_test.go | 2 +- internal/service/opensearch/service_endpoints_gen_test.go | 2 +- .../service/opensearchserverless/service_endpoints_gen_test.go | 2 +- internal/service/opsworks/service_endpoints_gen_test.go | 2 +- internal/service/organizations/service_endpoints_gen_test.go | 2 +- internal/service/osis/service_endpoints_gen_test.go | 2 +- internal/service/outposts/service_endpoints_gen_test.go | 2 +- internal/service/pcaconnectorad/service_endpoints_gen_test.go | 2 +- internal/service/pinpoint/service_endpoints_gen_test.go | 2 +- internal/service/pipes/service_endpoints_gen_test.go | 2 +- internal/service/polly/service_endpoints_gen_test.go | 2 +- internal/service/pricing/service_endpoints_gen_test.go | 2 +- internal/service/qbusiness/service_endpoints_gen_test.go | 2 +- internal/service/qldb/service_endpoints_gen_test.go | 2 +- internal/service/quicksight/service_endpoints_gen_test.go | 2 +- internal/service/ram/service_endpoints_gen_test.go | 2 +- internal/service/rbin/service_endpoints_gen_test.go | 2 +- internal/service/rds/service_endpoints_gen_test.go | 2 +- internal/service/redshift/service_endpoints_gen_test.go | 2 +- internal/service/redshiftdata/service_endpoints_gen_test.go | 2 +- .../service/redshiftserverless/service_endpoints_gen_test.go | 2 +- internal/service/rekognition/service_endpoints_gen_test.go | 2 +- .../service/resourceexplorer2/service_endpoints_gen_test.go | 2 +- internal/service/resourcegroups/service_endpoints_gen_test.go | 2 +- .../resourcegroupstaggingapi/service_endpoints_gen_test.go | 2 +- internal/service/rolesanywhere/service_endpoints_gen_test.go | 2 +- internal/service/route53/service_endpoints_gen_test.go | 2 +- internal/service/route53domains/service_endpoints_gen_test.go | 2 +- .../route53recoverycontrolconfig/service_endpoints_gen_test.go | 2 +- .../route53recoveryreadiness/service_endpoints_gen_test.go | 2 +- internal/service/route53resolver/service_endpoints_gen_test.go | 2 +- internal/service/rum/service_endpoints_gen_test.go | 2 +- internal/service/s3/service_endpoints_gen_test.go | 2 +- internal/service/s3outposts/service_endpoints_gen_test.go | 2 +- internal/service/sagemaker/service_endpoints_gen_test.go | 2 +- internal/service/scheduler/service_endpoints_gen_test.go | 2 +- internal/service/schemas/service_endpoints_gen_test.go | 2 +- internal/service/secretsmanager/service_endpoints_gen_test.go | 2 +- internal/service/securityhub/service_endpoints_gen_test.go | 2 +- internal/service/securitylake/service_endpoints_gen_test.go | 2 +- internal/service/serverlessrepo/service_endpoints_gen_test.go | 2 +- internal/service/servicecatalog/service_endpoints_gen_test.go | 2 +- .../servicecatalogappregistry/service_endpoints_gen_test.go | 2 +- internal/service/servicediscovery/service_endpoints_gen_test.go | 2 +- internal/service/servicequotas/service_endpoints_gen_test.go | 2 +- internal/service/ses/service_endpoints_gen_test.go | 2 +- internal/service/sesv2/service_endpoints_gen_test.go | 2 +- internal/service/sfn/service_endpoints_gen_test.go | 2 +- internal/service/shield/service_endpoints_gen_test.go | 2 +- internal/service/signer/service_endpoints_gen_test.go | 2 +- internal/service/simpledb/service_endpoints_gen_test.go | 2 +- internal/service/sns/service_endpoints_gen_test.go | 2 +- internal/service/sqs/service_endpoints_gen_test.go | 2 +- internal/service/ssm/service_endpoints_gen_test.go | 2 +- internal/service/ssmcontacts/service_endpoints_gen_test.go | 2 +- internal/service/ssmincidents/service_endpoints_gen_test.go | 2 +- internal/service/ssmsap/service_endpoints_gen_test.go | 2 +- internal/service/sso/service_endpoints_gen_test.go | 2 +- internal/service/ssoadmin/service_endpoints_gen_test.go | 2 +- internal/service/storagegateway/service_endpoints_gen_test.go | 2 +- internal/service/sts/service_endpoints_gen_test.go | 2 +- internal/service/swf/service_endpoints_gen_test.go | 2 +- internal/service/synthetics/service_endpoints_gen_test.go | 2 +- .../service/timestreaminfluxdb/service_endpoints_gen_test.go | 2 +- internal/service/transcribe/service_endpoints_gen_test.go | 2 +- internal/service/transfer/service_endpoints_gen_test.go | 2 +- .../service/verifiedpermissions/service_endpoints_gen_test.go | 2 +- internal/service/vpclattice/service_endpoints_gen_test.go | 2 +- internal/service/waf/service_endpoints_gen_test.go | 2 +- internal/service/wafregional/service_endpoints_gen_test.go | 2 +- internal/service/wafv2/service_endpoints_gen_test.go | 2 +- internal/service/wellarchitected/service_endpoints_gen_test.go | 2 +- internal/service/worklink/service_endpoints_gen_test.go | 2 +- internal/service/workspaces/service_endpoints_gen_test.go | 2 +- internal/service/workspacesweb/service_endpoints_gen_test.go | 2 +- internal/service/xray/service_endpoints_gen_test.go | 2 +- 229 files changed, 229 insertions(+), 229 deletions(-) diff --git a/internal/generate/serviceendpointtests/file.gtpl b/internal/generate/serviceendpointtests/file.gtpl index 06a0e09c0dc..90138808b3a 100644 --- a/internal/generate/serviceendpointtests/file.gtpl +++ b/internal/generate/serviceendpointtests/file.gtpl @@ -726,7 +726,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: {{ if .OverrideRegion }}"{{ .OverrideRegion }}"{{ else }}"{{ .Region }}"{{ end }}, + region: expectedCallRegion, } } diff --git a/internal/service/accessanalyzer/service_endpoints_gen_test.go b/internal/service/accessanalyzer/service_endpoints_gen_test.go index 3ad41692f6a..25b71095dc1 100644 --- a/internal/service/accessanalyzer/service_endpoints_gen_test.go +++ b/internal/service/accessanalyzer/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/account/service_endpoints_gen_test.go b/internal/service/account/service_endpoints_gen_test.go index 4471b808eb6..538f2f1adde 100644 --- a/internal/service/account/service_endpoints_gen_test.go +++ b/internal/service/account/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/acm/service_endpoints_gen_test.go b/internal/service/acm/service_endpoints_gen_test.go index 1ea1dd04905..5e15d53a283 100644 --- a/internal/service/acm/service_endpoints_gen_test.go +++ b/internal/service/acm/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/acmpca/service_endpoints_gen_test.go b/internal/service/acmpca/service_endpoints_gen_test.go index a8927b994c4..0b342af1776 100644 --- a/internal/service/acmpca/service_endpoints_gen_test.go +++ b/internal/service/acmpca/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/amp/service_endpoints_gen_test.go b/internal/service/amp/service_endpoints_gen_test.go index 0a67cbfd0ba..abc1eec3005 100644 --- a/internal/service/amp/service_endpoints_gen_test.go +++ b/internal/service/amp/service_endpoints_gen_test.go @@ -488,7 +488,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/amplify/service_endpoints_gen_test.go b/internal/service/amplify/service_endpoints_gen_test.go index bcb165ef75c..e8987a44bd5 100644 --- a/internal/service/amplify/service_endpoints_gen_test.go +++ b/internal/service/amplify/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/apigateway/service_endpoints_gen_test.go b/internal/service/apigateway/service_endpoints_gen_test.go index ca6d14ea92e..9d22208db68 100644 --- a/internal/service/apigateway/service_endpoints_gen_test.go +++ b/internal/service/apigateway/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/apigatewayv2/service_endpoints_gen_test.go b/internal/service/apigatewayv2/service_endpoints_gen_test.go index 16f7a4d7b3c..92564f0fc33 100644 --- a/internal/service/apigatewayv2/service_endpoints_gen_test.go +++ b/internal/service/apigatewayv2/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appautoscaling/service_endpoints_gen_test.go b/internal/service/appautoscaling/service_endpoints_gen_test.go index f2a3e2fd40d..2f142fbba0a 100644 --- a/internal/service/appautoscaling/service_endpoints_gen_test.go +++ b/internal/service/appautoscaling/service_endpoints_gen_test.go @@ -421,7 +421,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appconfig/service_endpoints_gen_test.go b/internal/service/appconfig/service_endpoints_gen_test.go index 86286f62d45..92b91c136e5 100644 --- a/internal/service/appconfig/service_endpoints_gen_test.go +++ b/internal/service/appconfig/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appfabric/service_endpoints_gen_test.go b/internal/service/appfabric/service_endpoints_gen_test.go index 8eaa67005e4..dd9bd9f6a23 100644 --- a/internal/service/appfabric/service_endpoints_gen_test.go +++ b/internal/service/appfabric/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appflow/service_endpoints_gen_test.go b/internal/service/appflow/service_endpoints_gen_test.go index 959ba9e1705..2d833986dc1 100644 --- a/internal/service/appflow/service_endpoints_gen_test.go +++ b/internal/service/appflow/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appintegrations/service_endpoints_gen_test.go b/internal/service/appintegrations/service_endpoints_gen_test.go index 489ad95bac6..fd9f02dfbab 100644 --- a/internal/service/appintegrations/service_endpoints_gen_test.go +++ b/internal/service/appintegrations/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/applicationinsights/service_endpoints_gen_test.go b/internal/service/applicationinsights/service_endpoints_gen_test.go index 53c30554d8d..875e41c0808 100644 --- a/internal/service/applicationinsights/service_endpoints_gen_test.go +++ b/internal/service/applicationinsights/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appmesh/service_endpoints_gen_test.go b/internal/service/appmesh/service_endpoints_gen_test.go index 1dee5661c6e..55fa1ac31aa 100644 --- a/internal/service/appmesh/service_endpoints_gen_test.go +++ b/internal/service/appmesh/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/apprunner/service_endpoints_gen_test.go b/internal/service/apprunner/service_endpoints_gen_test.go index 871a4ffd7f5..a65c93e42e0 100644 --- a/internal/service/apprunner/service_endpoints_gen_test.go +++ b/internal/service/apprunner/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appstream/service_endpoints_gen_test.go b/internal/service/appstream/service_endpoints_gen_test.go index e17e79f2a02..82235597b5e 100644 --- a/internal/service/appstream/service_endpoints_gen_test.go +++ b/internal/service/appstream/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/appsync/service_endpoints_gen_test.go b/internal/service/appsync/service_endpoints_gen_test.go index d2079108871..406c5adcc19 100644 --- a/internal/service/appsync/service_endpoints_gen_test.go +++ b/internal/service/appsync/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/athena/service_endpoints_gen_test.go b/internal/service/athena/service_endpoints_gen_test.go index 0e7dbe6f96d..620d6674300 100644 --- a/internal/service/athena/service_endpoints_gen_test.go +++ b/internal/service/athena/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/auditmanager/service_endpoints_gen_test.go b/internal/service/auditmanager/service_endpoints_gen_test.go index b8d5bfd2daa..6d2d605dd65 100644 --- a/internal/service/auditmanager/service_endpoints_gen_test.go +++ b/internal/service/auditmanager/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/autoscaling/service_endpoints_gen_test.go b/internal/service/autoscaling/service_endpoints_gen_test.go index d0145336301..c6ebc02ddd1 100644 --- a/internal/service/autoscaling/service_endpoints_gen_test.go +++ b/internal/service/autoscaling/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/autoscalingplans/service_endpoints_gen_test.go b/internal/service/autoscalingplans/service_endpoints_gen_test.go index bc9669d794c..136e923b352 100644 --- a/internal/service/autoscalingplans/service_endpoints_gen_test.go +++ b/internal/service/autoscalingplans/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/backup/service_endpoints_gen_test.go b/internal/service/backup/service_endpoints_gen_test.go index b7cf6359874..fd84c0b5b77 100644 --- a/internal/service/backup/service_endpoints_gen_test.go +++ b/internal/service/backup/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/batch/service_endpoints_gen_test.go b/internal/service/batch/service_endpoints_gen_test.go index 27d3b087952..cea6fe288c9 100644 --- a/internal/service/batch/service_endpoints_gen_test.go +++ b/internal/service/batch/service_endpoints_gen_test.go @@ -374,7 +374,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/bcmdataexports/service_endpoints_gen_test.go b/internal/service/bcmdataexports/service_endpoints_gen_test.go index b05a7c99e30..c461a4ae456 100644 --- a/internal/service/bcmdataexports/service_endpoints_gen_test.go +++ b/internal/service/bcmdataexports/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/bedrock/service_endpoints_gen_test.go b/internal/service/bedrock/service_endpoints_gen_test.go index 1257972487a..f6f2d64678b 100644 --- a/internal/service/bedrock/service_endpoints_gen_test.go +++ b/internal/service/bedrock/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/bedrockagent/service_endpoints_gen_test.go b/internal/service/bedrockagent/service_endpoints_gen_test.go index b9eec28db1e..f2b48359c61 100644 --- a/internal/service/bedrockagent/service_endpoints_gen_test.go +++ b/internal/service/bedrockagent/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/budgets/service_endpoints_gen_test.go b/internal/service/budgets/service_endpoints_gen_test.go index 6678d391347..a3d094ead3b 100644 --- a/internal/service/budgets/service_endpoints_gen_test.go +++ b/internal/service/budgets/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ce/service_endpoints_gen_test.go b/internal/service/ce/service_endpoints_gen_test.go index f834e967724..de259309c25 100644 --- a/internal/service/ce/service_endpoints_gen_test.go +++ b/internal/service/ce/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/chatbot/service_endpoints_gen_test.go b/internal/service/chatbot/service_endpoints_gen_test.go index f92ac1fd3b6..6afc31fe91e 100644 --- a/internal/service/chatbot/service_endpoints_gen_test.go +++ b/internal/service/chatbot/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/chime/service_endpoints_gen_test.go b/internal/service/chime/service_endpoints_gen_test.go index a09b3f8d85e..bf9f932eca4 100644 --- a/internal/service/chime/service_endpoints_gen_test.go +++ b/internal/service/chime/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go index 1c377724df3..3a8886f8581 100644 --- a/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go +++ b/internal/service/chimesdkmediapipelines/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/chimesdkvoice/service_endpoints_gen_test.go b/internal/service/chimesdkvoice/service_endpoints_gen_test.go index a68935af2d9..220802de047 100644 --- a/internal/service/chimesdkvoice/service_endpoints_gen_test.go +++ b/internal/service/chimesdkvoice/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cleanrooms/service_endpoints_gen_test.go b/internal/service/cleanrooms/service_endpoints_gen_test.go index 95f549becea..029f60a7aca 100644 --- a/internal/service/cleanrooms/service_endpoints_gen_test.go +++ b/internal/service/cleanrooms/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloud9/service_endpoints_gen_test.go b/internal/service/cloud9/service_endpoints_gen_test.go index ce977fd3abe..4eaac93e86b 100644 --- a/internal/service/cloud9/service_endpoints_gen_test.go +++ b/internal/service/cloud9/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudcontrol/service_endpoints_gen_test.go b/internal/service/cloudcontrol/service_endpoints_gen_test.go index 5ea47585769..f9532d3f352 100644 --- a/internal/service/cloudcontrol/service_endpoints_gen_test.go +++ b/internal/service/cloudcontrol/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudformation/service_endpoints_gen_test.go b/internal/service/cloudformation/service_endpoints_gen_test.go index d20eb0b5f98..bb5fab7aaa6 100644 --- a/internal/service/cloudformation/service_endpoints_gen_test.go +++ b/internal/service/cloudformation/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudfront/service_endpoints_gen_test.go b/internal/service/cloudfront/service_endpoints_gen_test.go index 5f30fcc3aff..15e0d92aa1b 100644 --- a/internal/service/cloudfront/service_endpoints_gen_test.go +++ b/internal/service/cloudfront/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudhsmv2/service_endpoints_gen_test.go b/internal/service/cloudhsmv2/service_endpoints_gen_test.go index eb90dde0c20..c7868f9e1cd 100644 --- a/internal/service/cloudhsmv2/service_endpoints_gen_test.go +++ b/internal/service/cloudhsmv2/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudsearch/service_endpoints_gen_test.go b/internal/service/cloudsearch/service_endpoints_gen_test.go index 20e373587ff..28a814f5ab5 100644 --- a/internal/service/cloudsearch/service_endpoints_gen_test.go +++ b/internal/service/cloudsearch/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudtrail/service_endpoints_gen_test.go b/internal/service/cloudtrail/service_endpoints_gen_test.go index c3b9814735c..aaacfc1abf5 100644 --- a/internal/service/cloudtrail/service_endpoints_gen_test.go +++ b/internal/service/cloudtrail/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cloudwatch/service_endpoints_gen_test.go b/internal/service/cloudwatch/service_endpoints_gen_test.go index fc6716990b2..f487b873387 100644 --- a/internal/service/cloudwatch/service_endpoints_gen_test.go +++ b/internal/service/cloudwatch/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codeartifact/service_endpoints_gen_test.go b/internal/service/codeartifact/service_endpoints_gen_test.go index ae7bbfd7403..35469c2629e 100644 --- a/internal/service/codeartifact/service_endpoints_gen_test.go +++ b/internal/service/codeartifact/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codebuild/service_endpoints_gen_test.go b/internal/service/codebuild/service_endpoints_gen_test.go index 1fe8485cca7..2dbd2ac7a4e 100644 --- a/internal/service/codebuild/service_endpoints_gen_test.go +++ b/internal/service/codebuild/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codecommit/service_endpoints_gen_test.go b/internal/service/codecommit/service_endpoints_gen_test.go index c33ebef5118..a3eedd261a4 100644 --- a/internal/service/codecommit/service_endpoints_gen_test.go +++ b/internal/service/codecommit/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codeguruprofiler/service_endpoints_gen_test.go b/internal/service/codeguruprofiler/service_endpoints_gen_test.go index 5ff7dbd90fd..724f8442dc5 100644 --- a/internal/service/codeguruprofiler/service_endpoints_gen_test.go +++ b/internal/service/codeguruprofiler/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codegurureviewer/service_endpoints_gen_test.go b/internal/service/codegurureviewer/service_endpoints_gen_test.go index f55f46ff0b1..1c84c0b7a72 100644 --- a/internal/service/codegurureviewer/service_endpoints_gen_test.go +++ b/internal/service/codegurureviewer/service_endpoints_gen_test.go @@ -348,7 +348,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codepipeline/service_endpoints_gen_test.go b/internal/service/codepipeline/service_endpoints_gen_test.go index e9775d4e612..bd392b47c37 100644 --- a/internal/service/codepipeline/service_endpoints_gen_test.go +++ b/internal/service/codepipeline/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codestarconnections/service_endpoints_gen_test.go b/internal/service/codestarconnections/service_endpoints_gen_test.go index b07ff8125c3..fc2109ec1ab 100644 --- a/internal/service/codestarconnections/service_endpoints_gen_test.go +++ b/internal/service/codestarconnections/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/codestarnotifications/service_endpoints_gen_test.go b/internal/service/codestarnotifications/service_endpoints_gen_test.go index 0cb836ef093..47c99b6146f 100644 --- a/internal/service/codestarnotifications/service_endpoints_gen_test.go +++ b/internal/service/codestarnotifications/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cognitoidentity/service_endpoints_gen_test.go b/internal/service/cognitoidentity/service_endpoints_gen_test.go index abe75a4405f..516d1a8316b 100644 --- a/internal/service/cognitoidentity/service_endpoints_gen_test.go +++ b/internal/service/cognitoidentity/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/cognitoidp/service_endpoints_gen_test.go b/internal/service/cognitoidp/service_endpoints_gen_test.go index 1fd8a1321c8..a48fe5cbe9c 100644 --- a/internal/service/cognitoidp/service_endpoints_gen_test.go +++ b/internal/service/cognitoidp/service_endpoints_gen_test.go @@ -406,7 +406,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/comprehend/service_endpoints_gen_test.go b/internal/service/comprehend/service_endpoints_gen_test.go index f86ca44692d..fd36f64bbb8 100644 --- a/internal/service/comprehend/service_endpoints_gen_test.go +++ b/internal/service/comprehend/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/computeoptimizer/service_endpoints_gen_test.go b/internal/service/computeoptimizer/service_endpoints_gen_test.go index 82c67e51a9a..47ef905d6f1 100644 --- a/internal/service/computeoptimizer/service_endpoints_gen_test.go +++ b/internal/service/computeoptimizer/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/configservice/service_endpoints_gen_test.go b/internal/service/configservice/service_endpoints_gen_test.go index d65076bcaf9..04e52863855 100644 --- a/internal/service/configservice/service_endpoints_gen_test.go +++ b/internal/service/configservice/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/connect/service_endpoints_gen_test.go b/internal/service/connect/service_endpoints_gen_test.go index 5e426d518f6..88dfef7f6f5 100644 --- a/internal/service/connect/service_endpoints_gen_test.go +++ b/internal/service/connect/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/connectcases/service_endpoints_gen_test.go b/internal/service/connectcases/service_endpoints_gen_test.go index 2f610ddd0bf..b8c4b716412 100644 --- a/internal/service/connectcases/service_endpoints_gen_test.go +++ b/internal/service/connectcases/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/controltower/service_endpoints_gen_test.go b/internal/service/controltower/service_endpoints_gen_test.go index 17a94679d72..ade0d064297 100644 --- a/internal/service/controltower/service_endpoints_gen_test.go +++ b/internal/service/controltower/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/costoptimizationhub/service_endpoints_gen_test.go b/internal/service/costoptimizationhub/service_endpoints_gen_test.go index 4c04d7fc194..f0dadbbb35e 100644 --- a/internal/service/costoptimizationhub/service_endpoints_gen_test.go +++ b/internal/service/costoptimizationhub/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-east-1", + region: expectedCallRegion, } } diff --git a/internal/service/cur/service_endpoints_gen_test.go b/internal/service/cur/service_endpoints_gen_test.go index acb7078e69b..fbce07ffabb 100644 --- a/internal/service/cur/service_endpoints_gen_test.go +++ b/internal/service/cur/service_endpoints_gen_test.go @@ -420,7 +420,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-east-1", + region: expectedCallRegion, } } diff --git a/internal/service/customerprofiles/service_endpoints_gen_test.go b/internal/service/customerprofiles/service_endpoints_gen_test.go index 71e33fb88a4..3a22a4566a8 100644 --- a/internal/service/customerprofiles/service_endpoints_gen_test.go +++ b/internal/service/customerprofiles/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/dataexchange/service_endpoints_gen_test.go b/internal/service/dataexchange/service_endpoints_gen_test.go index 77876a369ea..aceaa5b70f0 100644 --- a/internal/service/dataexchange/service_endpoints_gen_test.go +++ b/internal/service/dataexchange/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/datapipeline/service_endpoints_gen_test.go b/internal/service/datapipeline/service_endpoints_gen_test.go index c727ce3d52e..f0237581313 100644 --- a/internal/service/datapipeline/service_endpoints_gen_test.go +++ b/internal/service/datapipeline/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/datasync/service_endpoints_gen_test.go b/internal/service/datasync/service_endpoints_gen_test.go index cb5c6b86bc8..945dfff355f 100644 --- a/internal/service/datasync/service_endpoints_gen_test.go +++ b/internal/service/datasync/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/datazone/service_endpoints_gen_test.go b/internal/service/datazone/service_endpoints_gen_test.go index 4b7d44267f3..e794e776047 100644 --- a/internal/service/datazone/service_endpoints_gen_test.go +++ b/internal/service/datazone/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/dax/service_endpoints_gen_test.go b/internal/service/dax/service_endpoints_gen_test.go index 8c7701c1ff2..2d117dcd24f 100644 --- a/internal/service/dax/service_endpoints_gen_test.go +++ b/internal/service/dax/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/deploy/service_endpoints_gen_test.go b/internal/service/deploy/service_endpoints_gen_test.go index 86b3e818a78..a8957a49874 100644 --- a/internal/service/deploy/service_endpoints_gen_test.go +++ b/internal/service/deploy/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/detective/service_endpoints_gen_test.go b/internal/service/detective/service_endpoints_gen_test.go index df4a5f8b535..9461bf9fdf9 100644 --- a/internal/service/detective/service_endpoints_gen_test.go +++ b/internal/service/detective/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/devicefarm/service_endpoints_gen_test.go b/internal/service/devicefarm/service_endpoints_gen_test.go index 421d0034d1e..99b15da2f63 100644 --- a/internal/service/devicefarm/service_endpoints_gen_test.go +++ b/internal/service/devicefarm/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/devopsguru/service_endpoints_gen_test.go b/internal/service/devopsguru/service_endpoints_gen_test.go index 5484cad4f74..d1d0eaeb12c 100644 --- a/internal/service/devopsguru/service_endpoints_gen_test.go +++ b/internal/service/devopsguru/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/directconnect/service_endpoints_gen_test.go b/internal/service/directconnect/service_endpoints_gen_test.go index b301069a7f1..054e9411b83 100644 --- a/internal/service/directconnect/service_endpoints_gen_test.go +++ b/internal/service/directconnect/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/dlm/service_endpoints_gen_test.go b/internal/service/dlm/service_endpoints_gen_test.go index c7870743380..ebd47c83bda 100644 --- a/internal/service/dlm/service_endpoints_gen_test.go +++ b/internal/service/dlm/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/dms/service_endpoints_gen_test.go b/internal/service/dms/service_endpoints_gen_test.go index c7445b8c870..04bedfc4c45 100644 --- a/internal/service/dms/service_endpoints_gen_test.go +++ b/internal/service/dms/service_endpoints_gen_test.go @@ -476,7 +476,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/docdb/service_endpoints_gen_test.go b/internal/service/docdb/service_endpoints_gen_test.go index d3c8fd8a9d3..c4d304a0349 100644 --- a/internal/service/docdb/service_endpoints_gen_test.go +++ b/internal/service/docdb/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/docdbelastic/service_endpoints_gen_test.go b/internal/service/docdbelastic/service_endpoints_gen_test.go index f4a12143aa9..a9ac7cf6b26 100644 --- a/internal/service/docdbelastic/service_endpoints_gen_test.go +++ b/internal/service/docdbelastic/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/drs/service_endpoints_gen_test.go b/internal/service/drs/service_endpoints_gen_test.go index 7a7f966a18e..4ee4b72c3f2 100644 --- a/internal/service/drs/service_endpoints_gen_test.go +++ b/internal/service/drs/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ds/service_endpoints_gen_test.go b/internal/service/ds/service_endpoints_gen_test.go index 0bdaeb26bae..38ab27caa91 100644 --- a/internal/service/ds/service_endpoints_gen_test.go +++ b/internal/service/ds/service_endpoints_gen_test.go @@ -447,7 +447,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/dynamodb/service_endpoints_gen_test.go b/internal/service/dynamodb/service_endpoints_gen_test.go index 1f5565290c7..00ed085b88b 100644 --- a/internal/service/dynamodb/service_endpoints_gen_test.go +++ b/internal/service/dynamodb/service_endpoints_gen_test.go @@ -463,7 +463,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ec2/service_endpoints_gen_test.go b/internal/service/ec2/service_endpoints_gen_test.go index e2a34392a39..b68337d9be6 100644 --- a/internal/service/ec2/service_endpoints_gen_test.go +++ b/internal/service/ec2/service_endpoints_gen_test.go @@ -374,7 +374,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ecr/service_endpoints_gen_test.go b/internal/service/ecr/service_endpoints_gen_test.go index bee2919fd04..a733dcbf304 100644 --- a/internal/service/ecr/service_endpoints_gen_test.go +++ b/internal/service/ecr/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ecrpublic/service_endpoints_gen_test.go b/internal/service/ecrpublic/service_endpoints_gen_test.go index 3cc39743d84..8517b3685ea 100644 --- a/internal/service/ecrpublic/service_endpoints_gen_test.go +++ b/internal/service/ecrpublic/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ecs/service_endpoints_gen_test.go b/internal/service/ecs/service_endpoints_gen_test.go index 5eb246f3dc7..2e7e6ba0262 100644 --- a/internal/service/ecs/service_endpoints_gen_test.go +++ b/internal/service/ecs/service_endpoints_gen_test.go @@ -374,7 +374,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/efs/service_endpoints_gen_test.go b/internal/service/efs/service_endpoints_gen_test.go index 184ce620cd5..d8ce6e2c590 100644 --- a/internal/service/efs/service_endpoints_gen_test.go +++ b/internal/service/efs/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/eks/service_endpoints_gen_test.go b/internal/service/eks/service_endpoints_gen_test.go index d7f8d21b00c..7df8770dbae 100644 --- a/internal/service/eks/service_endpoints_gen_test.go +++ b/internal/service/eks/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elasticache/service_endpoints_gen_test.go b/internal/service/elasticache/service_endpoints_gen_test.go index 050d489cca4..7577ac6846b 100644 --- a/internal/service/elasticache/service_endpoints_gen_test.go +++ b/internal/service/elasticache/service_endpoints_gen_test.go @@ -374,7 +374,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go index 096fd29cd08..88ee3a2a32b 100644 --- a/internal/service/elasticbeanstalk/service_endpoints_gen_test.go +++ b/internal/service/elasticbeanstalk/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elasticsearch/service_endpoints_gen_test.go b/internal/service/elasticsearch/service_endpoints_gen_test.go index 343d979c3f7..a732ab343f3 100644 --- a/internal/service/elasticsearch/service_endpoints_gen_test.go +++ b/internal/service/elasticsearch/service_endpoints_gen_test.go @@ -476,7 +476,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elastictranscoder/service_endpoints_gen_test.go b/internal/service/elastictranscoder/service_endpoints_gen_test.go index 17b0f8274f3..6ad3a92103e 100644 --- a/internal/service/elastictranscoder/service_endpoints_gen_test.go +++ b/internal/service/elastictranscoder/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elb/service_endpoints_gen_test.go b/internal/service/elb/service_endpoints_gen_test.go index 80d4a8c8c05..39f797de522 100644 --- a/internal/service/elb/service_endpoints_gen_test.go +++ b/internal/service/elb/service_endpoints_gen_test.go @@ -406,7 +406,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/elbv2/service_endpoints_gen_test.go b/internal/service/elbv2/service_endpoints_gen_test.go index 6faf0a19565..c51b45db7ce 100644 --- a/internal/service/elbv2/service_endpoints_gen_test.go +++ b/internal/service/elbv2/service_endpoints_gen_test.go @@ -447,7 +447,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/emr/service_endpoints_gen_test.go b/internal/service/emr/service_endpoints_gen_test.go index 46b0bfcd8b4..a0f3a025c5b 100644 --- a/internal/service/emr/service_endpoints_gen_test.go +++ b/internal/service/emr/service_endpoints_gen_test.go @@ -374,7 +374,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/emrcontainers/service_endpoints_gen_test.go b/internal/service/emrcontainers/service_endpoints_gen_test.go index e648e4c8139..4360c641ce0 100644 --- a/internal/service/emrcontainers/service_endpoints_gen_test.go +++ b/internal/service/emrcontainers/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/emrserverless/service_endpoints_gen_test.go b/internal/service/emrserverless/service_endpoints_gen_test.go index 9893f177d14..3248697ff8c 100644 --- a/internal/service/emrserverless/service_endpoints_gen_test.go +++ b/internal/service/emrserverless/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/events/service_endpoints_gen_test.go b/internal/service/events/service_endpoints_gen_test.go index 42e27a87a2f..938cab7f209 100644 --- a/internal/service/events/service_endpoints_gen_test.go +++ b/internal/service/events/service_endpoints_gen_test.go @@ -488,7 +488,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/evidently/service_endpoints_gen_test.go b/internal/service/evidently/service_endpoints_gen_test.go index aaea99d2a4c..f198cf0cf70 100644 --- a/internal/service/evidently/service_endpoints_gen_test.go +++ b/internal/service/evidently/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/finspace/service_endpoints_gen_test.go b/internal/service/finspace/service_endpoints_gen_test.go index a6f559248f2..1483c5ecfc0 100644 --- a/internal/service/finspace/service_endpoints_gen_test.go +++ b/internal/service/finspace/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/firehose/service_endpoints_gen_test.go b/internal/service/firehose/service_endpoints_gen_test.go index 3523dd51db5..ac99e42e4f4 100644 --- a/internal/service/firehose/service_endpoints_gen_test.go +++ b/internal/service/firehose/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/fis/service_endpoints_gen_test.go b/internal/service/fis/service_endpoints_gen_test.go index 766575e7e0f..26f93a45af9 100644 --- a/internal/service/fis/service_endpoints_gen_test.go +++ b/internal/service/fis/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/fms/service_endpoints_gen_test.go b/internal/service/fms/service_endpoints_gen_test.go index 2f4522e825b..50c2ba3233f 100644 --- a/internal/service/fms/service_endpoints_gen_test.go +++ b/internal/service/fms/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/fsx/service_endpoints_gen_test.go b/internal/service/fsx/service_endpoints_gen_test.go index 2077b041b9a..57de05fcec1 100644 --- a/internal/service/fsx/service_endpoints_gen_test.go +++ b/internal/service/fsx/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/gamelift/service_endpoints_gen_test.go b/internal/service/gamelift/service_endpoints_gen_test.go index 903973b2b4f..983de29fec6 100644 --- a/internal/service/gamelift/service_endpoints_gen_test.go +++ b/internal/service/gamelift/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/glacier/service_endpoints_gen_test.go b/internal/service/glacier/service_endpoints_gen_test.go index 289d3d93098..b4d2fe7b024 100644 --- a/internal/service/glacier/service_endpoints_gen_test.go +++ b/internal/service/glacier/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/globalaccelerator/service_endpoints_gen_test.go b/internal/service/globalaccelerator/service_endpoints_gen_test.go index 1a6a7727c3b..3d082d2d207 100644 --- a/internal/service/globalaccelerator/service_endpoints_gen_test.go +++ b/internal/service/globalaccelerator/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/glue/service_endpoints_gen_test.go b/internal/service/glue/service_endpoints_gen_test.go index 4fde2ec81b0..af9a2c56ba1 100644 --- a/internal/service/glue/service_endpoints_gen_test.go +++ b/internal/service/glue/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/grafana/service_endpoints_gen_test.go b/internal/service/grafana/service_endpoints_gen_test.go index 2aef99835dd..1a0b1b8a698 100644 --- a/internal/service/grafana/service_endpoints_gen_test.go +++ b/internal/service/grafana/service_endpoints_gen_test.go @@ -476,7 +476,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/greengrass/service_endpoints_gen_test.go b/internal/service/greengrass/service_endpoints_gen_test.go index 8f2da877b6c..bca8626fb03 100644 --- a/internal/service/greengrass/service_endpoints_gen_test.go +++ b/internal/service/greengrass/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/groundstation/service_endpoints_gen_test.go b/internal/service/groundstation/service_endpoints_gen_test.go index f41c64c8ad8..f78516cf4a0 100644 --- a/internal/service/groundstation/service_endpoints_gen_test.go +++ b/internal/service/groundstation/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/guardduty/service_endpoints_gen_test.go b/internal/service/guardduty/service_endpoints_gen_test.go index 73c45ce9247..8dfd48daf27 100644 --- a/internal/service/guardduty/service_endpoints_gen_test.go +++ b/internal/service/guardduty/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/healthlake/service_endpoints_gen_test.go b/internal/service/healthlake/service_endpoints_gen_test.go index b751cdbcdb0..4042125d703 100644 --- a/internal/service/healthlake/service_endpoints_gen_test.go +++ b/internal/service/healthlake/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/iam/service_endpoints_gen_test.go b/internal/service/iam/service_endpoints_gen_test.go index 452a6494437..92581c8d922 100644 --- a/internal/service/iam/service_endpoints_gen_test.go +++ b/internal/service/iam/service_endpoints_gen_test.go @@ -463,7 +463,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/identitystore/service_endpoints_gen_test.go b/internal/service/identitystore/service_endpoints_gen_test.go index db0924fdbff..dba9961ba82 100644 --- a/internal/service/identitystore/service_endpoints_gen_test.go +++ b/internal/service/identitystore/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/imagebuilder/service_endpoints_gen_test.go b/internal/service/imagebuilder/service_endpoints_gen_test.go index aea45e58673..703d471eeb7 100644 --- a/internal/service/imagebuilder/service_endpoints_gen_test.go +++ b/internal/service/imagebuilder/service_endpoints_gen_test.go @@ -336,7 +336,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/inspector/service_endpoints_gen_test.go b/internal/service/inspector/service_endpoints_gen_test.go index 77d360ffaa9..ed15776d1ac 100644 --- a/internal/service/inspector/service_endpoints_gen_test.go +++ b/internal/service/inspector/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/inspector2/service_endpoints_gen_test.go b/internal/service/inspector2/service_endpoints_gen_test.go index c30fa08777f..6cc4911c2ed 100644 --- a/internal/service/inspector2/service_endpoints_gen_test.go +++ b/internal/service/inspector2/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/internetmonitor/service_endpoints_gen_test.go b/internal/service/internetmonitor/service_endpoints_gen_test.go index 117fa1b2e42..bccb4c3a2c7 100644 --- a/internal/service/internetmonitor/service_endpoints_gen_test.go +++ b/internal/service/internetmonitor/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/iot/service_endpoints_gen_test.go b/internal/service/iot/service_endpoints_gen_test.go index 7dfd1ab6a4a..295d520f32c 100644 --- a/internal/service/iot/service_endpoints_gen_test.go +++ b/internal/service/iot/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/iotanalytics/service_endpoints_gen_test.go b/internal/service/iotanalytics/service_endpoints_gen_test.go index dd6228b3e0b..23a2618e356 100644 --- a/internal/service/iotanalytics/service_endpoints_gen_test.go +++ b/internal/service/iotanalytics/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/iotevents/service_endpoints_gen_test.go b/internal/service/iotevents/service_endpoints_gen_test.go index c013877c45d..ab177d881a6 100644 --- a/internal/service/iotevents/service_endpoints_gen_test.go +++ b/internal/service/iotevents/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ivs/service_endpoints_gen_test.go b/internal/service/ivs/service_endpoints_gen_test.go index 71d8fc140cc..6c3a50cb6e5 100644 --- a/internal/service/ivs/service_endpoints_gen_test.go +++ b/internal/service/ivs/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ivschat/service_endpoints_gen_test.go b/internal/service/ivschat/service_endpoints_gen_test.go index 0343a461c0f..f194bc35a51 100644 --- a/internal/service/ivschat/service_endpoints_gen_test.go +++ b/internal/service/ivschat/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kafka/service_endpoints_gen_test.go b/internal/service/kafka/service_endpoints_gen_test.go index ecdc950ccc0..f975264656d 100644 --- a/internal/service/kafka/service_endpoints_gen_test.go +++ b/internal/service/kafka/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kafkaconnect/service_endpoints_gen_test.go b/internal/service/kafkaconnect/service_endpoints_gen_test.go index 5e47bef4a3c..724ce8ef02b 100644 --- a/internal/service/kafkaconnect/service_endpoints_gen_test.go +++ b/internal/service/kafkaconnect/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kendra/service_endpoints_gen_test.go b/internal/service/kendra/service_endpoints_gen_test.go index 1b4a8433f53..b0215e83ee9 100644 --- a/internal/service/kendra/service_endpoints_gen_test.go +++ b/internal/service/kendra/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/keyspaces/service_endpoints_gen_test.go b/internal/service/keyspaces/service_endpoints_gen_test.go index ac0ff29b683..042ef58b3b7 100644 --- a/internal/service/keyspaces/service_endpoints_gen_test.go +++ b/internal/service/keyspaces/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kinesis/service_endpoints_gen_test.go b/internal/service/kinesis/service_endpoints_gen_test.go index 374df876c44..7ece10b9de7 100644 --- a/internal/service/kinesis/service_endpoints_gen_test.go +++ b/internal/service/kinesis/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kinesisanalytics/service_endpoints_gen_test.go b/internal/service/kinesisanalytics/service_endpoints_gen_test.go index 16b7f1e801a..86db9141a85 100644 --- a/internal/service/kinesisanalytics/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalytics/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go index ba29afe708b..c4f950700b0 100644 --- a/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go +++ b/internal/service/kinesisanalyticsv2/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kinesisvideo/service_endpoints_gen_test.go b/internal/service/kinesisvideo/service_endpoints_gen_test.go index ab20d576cd5..ad3f34d0152 100644 --- a/internal/service/kinesisvideo/service_endpoints_gen_test.go +++ b/internal/service/kinesisvideo/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/kms/service_endpoints_gen_test.go b/internal/service/kms/service_endpoints_gen_test.go index a33e7c1f248..eec0c8504f5 100644 --- a/internal/service/kms/service_endpoints_gen_test.go +++ b/internal/service/kms/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lakeformation/service_endpoints_gen_test.go b/internal/service/lakeformation/service_endpoints_gen_test.go index a56e9ce7f14..824ef9ca1e5 100644 --- a/internal/service/lakeformation/service_endpoints_gen_test.go +++ b/internal/service/lakeformation/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lambda/service_endpoints_gen_test.go b/internal/service/lambda/service_endpoints_gen_test.go index 1e1c03d8633..390b3dc2a6e 100644 --- a/internal/service/lambda/service_endpoints_gen_test.go +++ b/internal/service/lambda/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/launchwizard/service_endpoints_gen_test.go b/internal/service/launchwizard/service_endpoints_gen_test.go index 2286edd1eb4..2cd8acf5877 100644 --- a/internal/service/launchwizard/service_endpoints_gen_test.go +++ b/internal/service/launchwizard/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lexmodels/service_endpoints_gen_test.go b/internal/service/lexmodels/service_endpoints_gen_test.go index 378f98603cb..d97c9aa1d2d 100644 --- a/internal/service/lexmodels/service_endpoints_gen_test.go +++ b/internal/service/lexmodels/service_endpoints_gen_test.go @@ -554,7 +554,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lexv2models/service_endpoints_gen_test.go b/internal/service/lexv2models/service_endpoints_gen_test.go index 505c5db9441..9ca31a16198 100644 --- a/internal/service/lexv2models/service_endpoints_gen_test.go +++ b/internal/service/lexv2models/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/licensemanager/service_endpoints_gen_test.go b/internal/service/licensemanager/service_endpoints_gen_test.go index 6b262cc6355..4d4805ea78c 100644 --- a/internal/service/licensemanager/service_endpoints_gen_test.go +++ b/internal/service/licensemanager/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lightsail/service_endpoints_gen_test.go b/internal/service/lightsail/service_endpoints_gen_test.go index 0b0ea7bd461..b40e5c127f9 100644 --- a/internal/service/lightsail/service_endpoints_gen_test.go +++ b/internal/service/lightsail/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/location/service_endpoints_gen_test.go b/internal/service/location/service_endpoints_gen_test.go index 88afd6a4df1..8c28d7cd1fc 100644 --- a/internal/service/location/service_endpoints_gen_test.go +++ b/internal/service/location/service_endpoints_gen_test.go @@ -406,7 +406,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/logs/service_endpoints_gen_test.go b/internal/service/logs/service_endpoints_gen_test.go index fb260143c72..a8e19038888 100644 --- a/internal/service/logs/service_endpoints_gen_test.go +++ b/internal/service/logs/service_endpoints_gen_test.go @@ -488,7 +488,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/lookoutmetrics/service_endpoints_gen_test.go b/internal/service/lookoutmetrics/service_endpoints_gen_test.go index c83f0b94f02..c954b142066 100644 --- a/internal/service/lookoutmetrics/service_endpoints_gen_test.go +++ b/internal/service/lookoutmetrics/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/m2/service_endpoints_gen_test.go b/internal/service/m2/service_endpoints_gen_test.go index bad0778aee1..fc2224ae028 100644 --- a/internal/service/m2/service_endpoints_gen_test.go +++ b/internal/service/m2/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/macie2/service_endpoints_gen_test.go b/internal/service/macie2/service_endpoints_gen_test.go index 6ac94a7db8b..044f0d68313 100644 --- a/internal/service/macie2/service_endpoints_gen_test.go +++ b/internal/service/macie2/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mediaconnect/service_endpoints_gen_test.go b/internal/service/mediaconnect/service_endpoints_gen_test.go index 41808c07864..a1818cb2713 100644 --- a/internal/service/mediaconnect/service_endpoints_gen_test.go +++ b/internal/service/mediaconnect/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mediaconvert/service_endpoints_gen_test.go b/internal/service/mediaconvert/service_endpoints_gen_test.go index 6f28d0805c5..09f742a21f4 100644 --- a/internal/service/mediaconvert/service_endpoints_gen_test.go +++ b/internal/service/mediaconvert/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/medialive/service_endpoints_gen_test.go b/internal/service/medialive/service_endpoints_gen_test.go index 48214632a45..b39c210c172 100644 --- a/internal/service/medialive/service_endpoints_gen_test.go +++ b/internal/service/medialive/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mediapackage/service_endpoints_gen_test.go b/internal/service/mediapackage/service_endpoints_gen_test.go index 24a59cc2ea5..36055f4e405 100644 --- a/internal/service/mediapackage/service_endpoints_gen_test.go +++ b/internal/service/mediapackage/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mediapackagev2/service_endpoints_gen_test.go b/internal/service/mediapackagev2/service_endpoints_gen_test.go index 2513d45b987..f8290ca9eb0 100644 --- a/internal/service/mediapackagev2/service_endpoints_gen_test.go +++ b/internal/service/mediapackagev2/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mediastore/service_endpoints_gen_test.go b/internal/service/mediastore/service_endpoints_gen_test.go index e9ed2b26013..3d78e79d276 100644 --- a/internal/service/mediastore/service_endpoints_gen_test.go +++ b/internal/service/mediastore/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/memorydb/service_endpoints_gen_test.go b/internal/service/memorydb/service_endpoints_gen_test.go index 8d399219203..0f1ebc09422 100644 --- a/internal/service/memorydb/service_endpoints_gen_test.go +++ b/internal/service/memorydb/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/mq/service_endpoints_gen_test.go b/internal/service/mq/service_endpoints_gen_test.go index f30474344e6..641786b65cd 100644 --- a/internal/service/mq/service_endpoints_gen_test.go +++ b/internal/service/mq/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/neptune/service_endpoints_gen_test.go b/internal/service/neptune/service_endpoints_gen_test.go index 504f7b87d95..23149d67360 100644 --- a/internal/service/neptune/service_endpoints_gen_test.go +++ b/internal/service/neptune/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/networkfirewall/service_endpoints_gen_test.go b/internal/service/networkfirewall/service_endpoints_gen_test.go index 69ad4a6893b..f61943cd786 100644 --- a/internal/service/networkfirewall/service_endpoints_gen_test.go +++ b/internal/service/networkfirewall/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/networkmanager/service_endpoints_gen_test.go b/internal/service/networkmanager/service_endpoints_gen_test.go index 9f5731b9cf9..f309aa0f608 100644 --- a/internal/service/networkmanager/service_endpoints_gen_test.go +++ b/internal/service/networkmanager/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/oam/service_endpoints_gen_test.go b/internal/service/oam/service_endpoints_gen_test.go index 625925e7471..c34ed793937 100644 --- a/internal/service/oam/service_endpoints_gen_test.go +++ b/internal/service/oam/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/opensearch/service_endpoints_gen_test.go b/internal/service/opensearch/service_endpoints_gen_test.go index 36696e21132..1df5c4b1f01 100644 --- a/internal/service/opensearch/service_endpoints_gen_test.go +++ b/internal/service/opensearch/service_endpoints_gen_test.go @@ -406,7 +406,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/opensearchserverless/service_endpoints_gen_test.go b/internal/service/opensearchserverless/service_endpoints_gen_test.go index 22bf55e711c..23e72508d77 100644 --- a/internal/service/opensearchserverless/service_endpoints_gen_test.go +++ b/internal/service/opensearchserverless/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/opsworks/service_endpoints_gen_test.go b/internal/service/opsworks/service_endpoints_gen_test.go index 130cbbbc289..1eed4760957 100644 --- a/internal/service/opsworks/service_endpoints_gen_test.go +++ b/internal/service/opsworks/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/organizations/service_endpoints_gen_test.go b/internal/service/organizations/service_endpoints_gen_test.go index f51dd75aea6..f35ae8f69a1 100644 --- a/internal/service/organizations/service_endpoints_gen_test.go +++ b/internal/service/organizations/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/osis/service_endpoints_gen_test.go b/internal/service/osis/service_endpoints_gen_test.go index 180245b00df..548247185db 100644 --- a/internal/service/osis/service_endpoints_gen_test.go +++ b/internal/service/osis/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/outposts/service_endpoints_gen_test.go b/internal/service/outposts/service_endpoints_gen_test.go index eb556a34822..a5675a6f43a 100644 --- a/internal/service/outposts/service_endpoints_gen_test.go +++ b/internal/service/outposts/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/pcaconnectorad/service_endpoints_gen_test.go b/internal/service/pcaconnectorad/service_endpoints_gen_test.go index ac2dca1b9da..b767a7e618d 100644 --- a/internal/service/pcaconnectorad/service_endpoints_gen_test.go +++ b/internal/service/pcaconnectorad/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/pinpoint/service_endpoints_gen_test.go b/internal/service/pinpoint/service_endpoints_gen_test.go index 448f57192dd..d777caf603f 100644 --- a/internal/service/pinpoint/service_endpoints_gen_test.go +++ b/internal/service/pinpoint/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/pipes/service_endpoints_gen_test.go b/internal/service/pipes/service_endpoints_gen_test.go index af1015319b3..d8d4b91752f 100644 --- a/internal/service/pipes/service_endpoints_gen_test.go +++ b/internal/service/pipes/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/polly/service_endpoints_gen_test.go b/internal/service/polly/service_endpoints_gen_test.go index 9390434a232..366f5bb424e 100644 --- a/internal/service/polly/service_endpoints_gen_test.go +++ b/internal/service/polly/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/pricing/service_endpoints_gen_test.go b/internal/service/pricing/service_endpoints_gen_test.go index 2438449a7a7..24b6be6fb89 100644 --- a/internal/service/pricing/service_endpoints_gen_test.go +++ b/internal/service/pricing/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/qbusiness/service_endpoints_gen_test.go b/internal/service/qbusiness/service_endpoints_gen_test.go index 28853c42e90..e7d0fb408e7 100644 --- a/internal/service/qbusiness/service_endpoints_gen_test.go +++ b/internal/service/qbusiness/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/qldb/service_endpoints_gen_test.go b/internal/service/qldb/service_endpoints_gen_test.go index fef3c7c1b46..563115948c2 100644 --- a/internal/service/qldb/service_endpoints_gen_test.go +++ b/internal/service/qldb/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/quicksight/service_endpoints_gen_test.go b/internal/service/quicksight/service_endpoints_gen_test.go index 0f2b1817995..3f1e3a462ca 100644 --- a/internal/service/quicksight/service_endpoints_gen_test.go +++ b/internal/service/quicksight/service_endpoints_gen_test.go @@ -335,7 +335,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ram/service_endpoints_gen_test.go b/internal/service/ram/service_endpoints_gen_test.go index c51411ed8e3..c18e23add22 100644 --- a/internal/service/ram/service_endpoints_gen_test.go +++ b/internal/service/ram/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/rbin/service_endpoints_gen_test.go b/internal/service/rbin/service_endpoints_gen_test.go index f95fc93a282..28c5ca0b63d 100644 --- a/internal/service/rbin/service_endpoints_gen_test.go +++ b/internal/service/rbin/service_endpoints_gen_test.go @@ -421,7 +421,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/rds/service_endpoints_gen_test.go b/internal/service/rds/service_endpoints_gen_test.go index 485532dd1c4..7c1d9d5facf 100644 --- a/internal/service/rds/service_endpoints_gen_test.go +++ b/internal/service/rds/service_endpoints_gen_test.go @@ -374,7 +374,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/redshift/service_endpoints_gen_test.go b/internal/service/redshift/service_endpoints_gen_test.go index 4dfa40e3131..f7b82e45642 100644 --- a/internal/service/redshift/service_endpoints_gen_test.go +++ b/internal/service/redshift/service_endpoints_gen_test.go @@ -374,7 +374,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/redshiftdata/service_endpoints_gen_test.go b/internal/service/redshiftdata/service_endpoints_gen_test.go index a42c80b2fc7..e015f374ca0 100644 --- a/internal/service/redshiftdata/service_endpoints_gen_test.go +++ b/internal/service/redshiftdata/service_endpoints_gen_test.go @@ -420,7 +420,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/redshiftserverless/service_endpoints_gen_test.go b/internal/service/redshiftserverless/service_endpoints_gen_test.go index 99c499f8cc4..0f0671ff261 100644 --- a/internal/service/redshiftserverless/service_endpoints_gen_test.go +++ b/internal/service/redshiftserverless/service_endpoints_gen_test.go @@ -374,7 +374,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/rekognition/service_endpoints_gen_test.go b/internal/service/rekognition/service_endpoints_gen_test.go index 3ad9f9906b6..d4f0c9c1abb 100644 --- a/internal/service/rekognition/service_endpoints_gen_test.go +++ b/internal/service/rekognition/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/resourceexplorer2/service_endpoints_gen_test.go b/internal/service/resourceexplorer2/service_endpoints_gen_test.go index becea6d5621..a8a62f8c937 100644 --- a/internal/service/resourceexplorer2/service_endpoints_gen_test.go +++ b/internal/service/resourceexplorer2/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/resourcegroups/service_endpoints_gen_test.go b/internal/service/resourcegroups/service_endpoints_gen_test.go index 5e0e362500c..506daa7fbf1 100644 --- a/internal/service/resourcegroups/service_endpoints_gen_test.go +++ b/internal/service/resourcegroups/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go index 29614f9ff62..3c4003c92e9 100644 --- a/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go +++ b/internal/service/resourcegroupstaggingapi/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/rolesanywhere/service_endpoints_gen_test.go b/internal/service/rolesanywhere/service_endpoints_gen_test.go index dc65e1f15cc..65e9b3dd526 100644 --- a/internal/service/rolesanywhere/service_endpoints_gen_test.go +++ b/internal/service/rolesanywhere/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/route53/service_endpoints_gen_test.go b/internal/service/route53/service_endpoints_gen_test.go index bd1abed6ead..ac39336221c 100644 --- a/internal/service/route53/service_endpoints_gen_test.go +++ b/internal/service/route53/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-east-1", + region: expectedCallRegion, } } diff --git a/internal/service/route53domains/service_endpoints_gen_test.go b/internal/service/route53domains/service_endpoints_gen_test.go index d7bd5fd320b..a74f70ad80a 100644 --- a/internal/service/route53domains/service_endpoints_gen_test.go +++ b/internal/service/route53domains/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-east-1", + region: expectedCallRegion, } } diff --git a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go index ff2f033ab1a..d913d7d0e64 100644 --- a/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go +++ b/internal/service/route53recoverycontrolconfig/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go index 075228b2f35..863b25c3276 100644 --- a/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go +++ b/internal/service/route53recoveryreadiness/service_endpoints_gen_test.go @@ -336,7 +336,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/route53resolver/service_endpoints_gen_test.go b/internal/service/route53resolver/service_endpoints_gen_test.go index b85f6748bfc..d774666c5d6 100644 --- a/internal/service/route53resolver/service_endpoints_gen_test.go +++ b/internal/service/route53resolver/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/rum/service_endpoints_gen_test.go b/internal/service/rum/service_endpoints_gen_test.go index 60ac59e97cf..a7eb6cee8ef 100644 --- a/internal/service/rum/service_endpoints_gen_test.go +++ b/internal/service/rum/service_endpoints_gen_test.go @@ -406,7 +406,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/s3/service_endpoints_gen_test.go b/internal/service/s3/service_endpoints_gen_test.go index 09642e40e1e..b4deec6125a 100644 --- a/internal/service/s3/service_endpoints_gen_test.go +++ b/internal/service/s3/service_endpoints_gen_test.go @@ -550,7 +550,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/s3outposts/service_endpoints_gen_test.go b/internal/service/s3outposts/service_endpoints_gen_test.go index a5c22f10333..ae3e984c6da 100644 --- a/internal/service/s3outposts/service_endpoints_gen_test.go +++ b/internal/service/s3outposts/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sagemaker/service_endpoints_gen_test.go b/internal/service/sagemaker/service_endpoints_gen_test.go index 2e0406be361..225b319dfd1 100644 --- a/internal/service/sagemaker/service_endpoints_gen_test.go +++ b/internal/service/sagemaker/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/scheduler/service_endpoints_gen_test.go b/internal/service/scheduler/service_endpoints_gen_test.go index 3f22e05b246..1215f07b26b 100644 --- a/internal/service/scheduler/service_endpoints_gen_test.go +++ b/internal/service/scheduler/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/schemas/service_endpoints_gen_test.go b/internal/service/schemas/service_endpoints_gen_test.go index ca3d216a0fe..3cdc8cd1ef8 100644 --- a/internal/service/schemas/service_endpoints_gen_test.go +++ b/internal/service/schemas/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/secretsmanager/service_endpoints_gen_test.go b/internal/service/secretsmanager/service_endpoints_gen_test.go index c653bbbd80a..bec95418b18 100644 --- a/internal/service/secretsmanager/service_endpoints_gen_test.go +++ b/internal/service/secretsmanager/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/securityhub/service_endpoints_gen_test.go b/internal/service/securityhub/service_endpoints_gen_test.go index 769c73a223f..1a00849e38e 100644 --- a/internal/service/securityhub/service_endpoints_gen_test.go +++ b/internal/service/securityhub/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/securitylake/service_endpoints_gen_test.go b/internal/service/securitylake/service_endpoints_gen_test.go index e789327ceb3..c1c150dfff9 100644 --- a/internal/service/securitylake/service_endpoints_gen_test.go +++ b/internal/service/securitylake/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/serverlessrepo/service_endpoints_gen_test.go b/internal/service/serverlessrepo/service_endpoints_gen_test.go index 9b209888b29..7f6f71b8f95 100644 --- a/internal/service/serverlessrepo/service_endpoints_gen_test.go +++ b/internal/service/serverlessrepo/service_endpoints_gen_test.go @@ -476,7 +476,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/servicecatalog/service_endpoints_gen_test.go b/internal/service/servicecatalog/service_endpoints_gen_test.go index a984c99f380..0bdec1330e5 100644 --- a/internal/service/servicecatalog/service_endpoints_gen_test.go +++ b/internal/service/servicecatalog/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go index affce879770..07a988a5a4a 100644 --- a/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go +++ b/internal/service/servicecatalogappregistry/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/servicediscovery/service_endpoints_gen_test.go b/internal/service/servicediscovery/service_endpoints_gen_test.go index 6f3ed38e67c..b41c5084b59 100644 --- a/internal/service/servicediscovery/service_endpoints_gen_test.go +++ b/internal/service/servicediscovery/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/servicequotas/service_endpoints_gen_test.go b/internal/service/servicequotas/service_endpoints_gen_test.go index 37ac62d9901..8dce10beac3 100644 --- a/internal/service/servicequotas/service_endpoints_gen_test.go +++ b/internal/service/servicequotas/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ses/service_endpoints_gen_test.go b/internal/service/ses/service_endpoints_gen_test.go index 913be6f0e4e..1bd03cc4090 100644 --- a/internal/service/ses/service_endpoints_gen_test.go +++ b/internal/service/ses/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sesv2/service_endpoints_gen_test.go b/internal/service/sesv2/service_endpoints_gen_test.go index 40b5c677248..bebd1c41fcc 100644 --- a/internal/service/sesv2/service_endpoints_gen_test.go +++ b/internal/service/sesv2/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sfn/service_endpoints_gen_test.go b/internal/service/sfn/service_endpoints_gen_test.go index f8a4b83674f..146be236e96 100644 --- a/internal/service/sfn/service_endpoints_gen_test.go +++ b/internal/service/sfn/service_endpoints_gen_test.go @@ -406,7 +406,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/shield/service_endpoints_gen_test.go b/internal/service/shield/service_endpoints_gen_test.go index 3add06ca9ab..9a6a0d0937f 100644 --- a/internal/service/shield/service_endpoints_gen_test.go +++ b/internal/service/shield/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-east-1", + region: expectedCallRegion, } } diff --git a/internal/service/signer/service_endpoints_gen_test.go b/internal/service/signer/service_endpoints_gen_test.go index f402c0abe93..8877c145270 100644 --- a/internal/service/signer/service_endpoints_gen_test.go +++ b/internal/service/signer/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/simpledb/service_endpoints_gen_test.go b/internal/service/simpledb/service_endpoints_gen_test.go index cfed7d04f6b..65786f2819d 100644 --- a/internal/service/simpledb/service_endpoints_gen_test.go +++ b/internal/service/simpledb/service_endpoints_gen_test.go @@ -406,7 +406,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sns/service_endpoints_gen_test.go b/internal/service/sns/service_endpoints_gen_test.go index 409d7e77870..c0a08d95c41 100644 --- a/internal/service/sns/service_endpoints_gen_test.go +++ b/internal/service/sns/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sqs/service_endpoints_gen_test.go b/internal/service/sqs/service_endpoints_gen_test.go index 761ab2a33bd..540b319ec6f 100644 --- a/internal/service/sqs/service_endpoints_gen_test.go +++ b/internal/service/sqs/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ssm/service_endpoints_gen_test.go b/internal/service/ssm/service_endpoints_gen_test.go index fe7a3a2d661..dc8de4b23d1 100644 --- a/internal/service/ssm/service_endpoints_gen_test.go +++ b/internal/service/ssm/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ssmcontacts/service_endpoints_gen_test.go b/internal/service/ssmcontacts/service_endpoints_gen_test.go index 7a98f212df6..b6f42a04648 100644 --- a/internal/service/ssmcontacts/service_endpoints_gen_test.go +++ b/internal/service/ssmcontacts/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ssmincidents/service_endpoints_gen_test.go b/internal/service/ssmincidents/service_endpoints_gen_test.go index 4227b096222..7838c83f4f3 100644 --- a/internal/service/ssmincidents/service_endpoints_gen_test.go +++ b/internal/service/ssmincidents/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ssmsap/service_endpoints_gen_test.go b/internal/service/ssmsap/service_endpoints_gen_test.go index 5a9bf0b2eeb..4cf4aa2f168 100644 --- a/internal/service/ssmsap/service_endpoints_gen_test.go +++ b/internal/service/ssmsap/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sso/service_endpoints_gen_test.go b/internal/service/sso/service_endpoints_gen_test.go index 6121671de83..02c05f5a9f6 100644 --- a/internal/service/sso/service_endpoints_gen_test.go +++ b/internal/service/sso/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/ssoadmin/service_endpoints_gen_test.go b/internal/service/ssoadmin/service_endpoints_gen_test.go index 95a9b9c8632..38bc6ae7838 100644 --- a/internal/service/ssoadmin/service_endpoints_gen_test.go +++ b/internal/service/ssoadmin/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/storagegateway/service_endpoints_gen_test.go b/internal/service/storagegateway/service_endpoints_gen_test.go index 3fabaec9185..35af5385d53 100644 --- a/internal/service/storagegateway/service_endpoints_gen_test.go +++ b/internal/service/storagegateway/service_endpoints_gen_test.go @@ -333,7 +333,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/sts/service_endpoints_gen_test.go b/internal/service/sts/service_endpoints_gen_test.go index c080ac7babe..c8e93c286ea 100644 --- a/internal/service/sts/service_endpoints_gen_test.go +++ b/internal/service/sts/service_endpoints_gen_test.go @@ -463,7 +463,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/swf/service_endpoints_gen_test.go b/internal/service/swf/service_endpoints_gen_test.go index ba5cb1e2617..4461f401cc8 100644 --- a/internal/service/swf/service_endpoints_gen_test.go +++ b/internal/service/swf/service_endpoints_gen_test.go @@ -347,7 +347,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/synthetics/service_endpoints_gen_test.go b/internal/service/synthetics/service_endpoints_gen_test.go index 93bd09ebd87..cc19f54ca2b 100644 --- a/internal/service/synthetics/service_endpoints_gen_test.go +++ b/internal/service/synthetics/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go index 82198f35c0f..2c2dd1f5f57 100644 --- a/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go +++ b/internal/service/timestreaminfluxdb/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/transcribe/service_endpoints_gen_test.go b/internal/service/transcribe/service_endpoints_gen_test.go index 340f70f5c97..4d039648644 100644 --- a/internal/service/transcribe/service_endpoints_gen_test.go +++ b/internal/service/transcribe/service_endpoints_gen_test.go @@ -418,7 +418,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/transfer/service_endpoints_gen_test.go b/internal/service/transfer/service_endpoints_gen_test.go index aaa886d74db..a1b3edba86f 100644 --- a/internal/service/transfer/service_endpoints_gen_test.go +++ b/internal/service/transfer/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/verifiedpermissions/service_endpoints_gen_test.go b/internal/service/verifiedpermissions/service_endpoints_gen_test.go index 78ed1bf5a31..5c886acdc1e 100644 --- a/internal/service/verifiedpermissions/service_endpoints_gen_test.go +++ b/internal/service/verifiedpermissions/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/vpclattice/service_endpoints_gen_test.go b/internal/service/vpclattice/service_endpoints_gen_test.go index 5d33382c5e7..2697b713199 100644 --- a/internal/service/vpclattice/service_endpoints_gen_test.go +++ b/internal/service/vpclattice/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/waf/service_endpoints_gen_test.go b/internal/service/waf/service_endpoints_gen_test.go index 67cf341f970..b5cfcd1593e 100644 --- a/internal/service/waf/service_endpoints_gen_test.go +++ b/internal/service/waf/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/wafregional/service_endpoints_gen_test.go b/internal/service/wafregional/service_endpoints_gen_test.go index 69875dec601..42bb5b8e233 100644 --- a/internal/service/wafregional/service_endpoints_gen_test.go +++ b/internal/service/wafregional/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/wafv2/service_endpoints_gen_test.go b/internal/service/wafv2/service_endpoints_gen_test.go index 7434a5aed29..a4ee77b6f83 100644 --- a/internal/service/wafv2/service_endpoints_gen_test.go +++ b/internal/service/wafv2/service_endpoints_gen_test.go @@ -348,7 +348,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/wellarchitected/service_endpoints_gen_test.go b/internal/service/wellarchitected/service_endpoints_gen_test.go index d3eedd7dd5b..bf78c25d883 100644 --- a/internal/service/wellarchitected/service_endpoints_gen_test.go +++ b/internal/service/wellarchitected/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/worklink/service_endpoints_gen_test.go b/internal/service/worklink/service_endpoints_gen_test.go index 5fe28c22950..09f25598c1a 100644 --- a/internal/service/worklink/service_endpoints_gen_test.go +++ b/internal/service/worklink/service_endpoints_gen_test.go @@ -336,7 +336,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/workspaces/service_endpoints_gen_test.go b/internal/service/workspaces/service_endpoints_gen_test.go index e4559f0f126..dfbc1131a1e 100644 --- a/internal/service/workspaces/service_endpoints_gen_test.go +++ b/internal/service/workspaces/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/workspacesweb/service_endpoints_gen_test.go b/internal/service/workspacesweb/service_endpoints_gen_test.go index a88e21beb23..1a0770f1635 100644 --- a/internal/service/workspacesweb/service_endpoints_gen_test.go +++ b/internal/service/workspacesweb/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } } diff --git a/internal/service/xray/service_endpoints_gen_test.go b/internal/service/xray/service_endpoints_gen_test.go index b2359b51fc8..a7b9fd795e1 100644 --- a/internal/service/xray/service_endpoints_gen_test.go +++ b/internal/service/xray/service_endpoints_gen_test.go @@ -345,7 +345,7 @@ func expectDefaultEndpoint(region string) caseExpectations { func expectDefaultFIPSEndpoint(region string) caseExpectations { return caseExpectations{ endpoint: defaultFIPSEndpoint(region), - region: "us-west-2", + region: expectedCallRegion, } }