Skip to content

Commit

Permalink
extracting maxBatchSize number into a const with comment to explain i…
Browse files Browse the repository at this point in the history
…ts use
  • Loading branch information
ina-stoyanova committed Oct 8, 2020
1 parent 2616fe8 commit 36a39a9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions aws/ecs_cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import (
"github.com/gruntwork-io/gruntwork-cli/errors"
)

// The pattern we use for running the `cloud-nuke` tool is to split the AWS API calls
// into batches when the function `NukeAllResources` is executed.
// A batch max number has been chosen for most modules.
// However, for ECS clusters there is no explicit limiting described in the AWS CLI docs.
// Therefore this `maxBatchSize` here is set to 100 as a safe maximum.
const maxBatchSize = 100

// ECSClusters - Represents all ECS clusters found in a region
type ECSClusters struct {
ClusterArns []string
Expand All @@ -21,9 +28,8 @@ func (clusters ECSClusters) ResourceIdentifiers() []string {
return clusters.ClusterArns
}

// MaxBatchSize - the maximum number of ECS clusters for a single request
func (clusters ECSClusters) MaxBatchSize() int {
return 200
return maxBatchSize
}

// Nuke - nuke all ECS Cluster resources
Expand Down

0 comments on commit 36a39a9

Please sign in to comment.