Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sweeper: Removes redundant SharedRegionalSweepClientWithContext #32145

Merged
merged 1 commit into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/service/accessanalyzer/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func init() {

func sweepAnalyzers(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("getting client: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/acm/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func init() {

func sweepCertificates(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/acmpca/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func init() {

func sweepCertificateAuthorities(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/amplify/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func init() {

func sweepApps(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %s", err)
}
Expand Down
12 changes: 6 additions & 6 deletions internal/service/apigateway/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func init() {

func sweepRestAPIs(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("getting client: %s", err)
}
Expand Down Expand Up @@ -97,7 +97,7 @@ func sweepRestAPIs(region string) error {

func sweepVPCLinks(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("getting client: %w", err)
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func sweepVPCLinks(region string) error {

func sweepClientCertificates(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("getting client: %s", err)
}
Expand Down Expand Up @@ -178,7 +178,7 @@ func sweepClientCertificates(region string) error {

func sweepUsagePlans(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("getting client: %s", err)
}
Expand Down Expand Up @@ -226,7 +226,7 @@ func sweepUsagePlans(region string) error {

func sweepAPIKeys(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("getting client: %s", err)
}
Expand Down Expand Up @@ -273,7 +273,7 @@ func sweepAPIKeys(region string) error {

func sweepDomainNames(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("getting client: %s", err)
}
Expand Down
8 changes: 4 additions & 4 deletions internal/service/apigatewayv2/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func init() {

func sweepAPIs(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %s", err)
}
Expand Down Expand Up @@ -88,7 +88,7 @@ func sweepAPIs(region string) error {

func sweepAPIMappings(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %w", err)
}
Expand Down Expand Up @@ -157,7 +157,7 @@ func sweepAPIMappings(region string) error {

func sweepDomainNames(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %w", err)
}
Expand Down Expand Up @@ -201,7 +201,7 @@ func sweepDomainNames(region string) error {

func sweepVPCLinks(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %s", err)
}
Expand Down
10 changes: 5 additions & 5 deletions internal/service/appconfig/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func init() {

func sweepApplications(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)

if err != nil {
return fmt.Errorf("error getting client: %w", err)
Expand Down Expand Up @@ -105,7 +105,7 @@ func sweepApplications(region string) error {

func sweepConfigurationProfiles(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)

if err != nil {
return fmt.Errorf("error getting client: %w", err)
Expand Down Expand Up @@ -182,7 +182,7 @@ func sweepConfigurationProfiles(region string) error {

func sweepDeploymentStrategies(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)

if err != nil {
return fmt.Errorf("error getting client: %w", err)
Expand Down Expand Up @@ -241,7 +241,7 @@ func sweepDeploymentStrategies(region string) error {

func sweepEnvironments(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)

if err != nil {
return fmt.Errorf("error getting client: %w", err)
Expand Down Expand Up @@ -314,7 +314,7 @@ func sweepEnvironments(region string) error {

func sweepHostedConfigurationVersions(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)

if err != nil {
return fmt.Errorf("error getting client: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/service/applicationinsights/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func init() {

func sweepApplications(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)

if err != nil {
return fmt.Errorf("error getting client: %s", err)
Expand Down
14 changes: 7 additions & 7 deletions internal/service/appmesh/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func init() {

func sweepMeshes(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %s", err)
}
Expand Down Expand Up @@ -109,7 +109,7 @@ func sweepMeshes(region string) error {

func sweepVirtualGateways(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %w", err)
}
Expand Down Expand Up @@ -180,7 +180,7 @@ func sweepVirtualGateways(region string) error {

func sweepVirtualNodes(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %w", err)
}
Expand Down Expand Up @@ -251,7 +251,7 @@ func sweepVirtualNodes(region string) error {

func sweepVirtualRouters(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %s", err)
}
Expand Down Expand Up @@ -322,7 +322,7 @@ func sweepVirtualRouters(region string) error {

func sweepVirtualServices(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %s", err)
}
Expand Down Expand Up @@ -393,7 +393,7 @@ func sweepVirtualServices(region string) error {

func sweepGatewayRoutes(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %w", err)
}
Expand Down Expand Up @@ -489,7 +489,7 @@ func sweepGatewayRoutes(region string) error {

func sweepRoutes(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %s", err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/service/apprunner/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func init() {

func sweepAutoScalingConfigurationVersions(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)

if err != nil {
return fmt.Errorf("error getting client: %w", err)
Expand Down Expand Up @@ -101,7 +101,7 @@ func sweepAutoScalingConfigurationVersions(region string) error {

func sweepConnections(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)

if err != nil {
return fmt.Errorf("error getting client: %s", err)
Expand Down Expand Up @@ -162,7 +162,7 @@ func sweepConnections(region string) error {

func sweepServices(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)

if err != nil {
return fmt.Errorf("error getting client: %s", err)
Expand Down
8 changes: 4 additions & 4 deletions internal/service/appstream/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func init() {

func sweepDirectoryConfigs(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %w", err)
}
Expand Down Expand Up @@ -81,7 +81,7 @@ func sweepDirectoryConfigs(region string) error {

func sweepFleets(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %w", err)
}
Expand Down Expand Up @@ -125,7 +125,7 @@ func sweepFleets(region string) error {

func sweepImageBuilders(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %w", err)
}
Expand Down Expand Up @@ -169,7 +169,7 @@ func sweepImageBuilders(region string) error {

func sweepStacks(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/service/appsync/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func init() {

func sweepGraphQLAPIs(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("Error getting client: %s", err)
}
Expand Down Expand Up @@ -92,7 +92,7 @@ func sweepGraphQLAPIs(region string) error {

func sweepDomainNames(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("Error getting client: %s", err)
}
Expand Down Expand Up @@ -148,7 +148,7 @@ func sweepDomainNames(region string) error {

func sweepDomainNameAssociations(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("Error getting client: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/athena/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func init() {

func sweepDatabases(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
return fmt.Errorf("error getting client: %s", err)
}
Expand Down
12 changes: 6 additions & 6 deletions internal/service/auditmanager/sweep.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func isCompleteSetupError(err error) bool {

func sweepAssessments(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
fmt.Errorf("error getting client: %s", err)
}
Expand Down Expand Up @@ -110,7 +110,7 @@ func sweepAssessments(region string) error {

func sweepAssessmentDelegations(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
fmt.Errorf("error getting client: %s", err)
}
Expand Down Expand Up @@ -154,7 +154,7 @@ func sweepAssessmentDelegations(region string) error {

func sweepAssessmentReports(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
fmt.Errorf("error getting client: %s", err)
}
Expand Down Expand Up @@ -200,7 +200,7 @@ func sweepAssessmentReports(region string) error {

func sweepControls(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
fmt.Errorf("error getting client: %s", err)
}
Expand Down Expand Up @@ -245,7 +245,7 @@ func sweepControls(region string) error {

func sweepFrameworks(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
fmt.Errorf("error getting client: %s", err)
}
Expand Down Expand Up @@ -290,7 +290,7 @@ func sweepFrameworks(region string) error {

func sweepFrameworkShares(region string) error {
ctx := sweep.Context(region)
client, err := sweep.SharedRegionalSweepClient(region)
client, err := sweep.SharedRegionalSweepClient(ctx, region)
if err != nil {
fmt.Errorf("error getting client: %s", err)
}
Expand Down
Loading