Skip to content

Commit

Permalink
CORE-188 rate limits (gruntwork-io#382)
Browse files Browse the repository at this point in the history
* CORE-188 Reduce batch sizes for all resources with guessed rate limits

* CORE-188 remove temporary test
  • Loading branch information
Andrew Ellison authored Dec 12, 2022
1 parent 28121fd commit 1cc8ad9
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion aws/ami_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (image AMIs) ResourceIdentifiers() []string {

func (image AMIs) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/asg_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (group ASGroups) ResourceName() string {

func (group ASGroups) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// ResourceIdentifiers - The group names of the auto scaling groups
Expand Down
2 changes: 1 addition & 1 deletion aws/cloudwatch_dashboard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (cwdb CloudWatchDashboards) ResourceIdentifiers() []string {
}

func (cwdb CloudWatchDashboards) MaxBatchSize() int {
return 100
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/dynamodb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (tables DynamoDB) ResourceIdentifiers() []string {

func (tables DynamoDB) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 100
return 49
}

// Nuke - nuke all Dynamo DB Tables
Expand Down
2 changes: 1 addition & 1 deletion aws/ebs_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (volume EBSVolumes) ResourceIdentifiers() []string {

func (volume EBSVolumes) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
4 changes: 2 additions & 2 deletions aws/ec2_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (instance EC2Instances) ResourceIdentifiers() []string {

func (instance EC2Instances) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down Expand Up @@ -52,7 +52,7 @@ func (v EC2VPCs) ResourceIdentifiers() []string {

func (v EC2VPCs) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
4 changes: 2 additions & 2 deletions aws/ecs_cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
// 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
// Therefore this `maxBatchSize` here is set to 49 as a safe maximum.
const maxBatchSize = 49

// ECSClusters - Represents all ECS clusters found in a region
type ECSClusters struct {
Expand Down
2 changes: 1 addition & 1 deletion aws/ecs_service_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (services ECSServices) ResourceIdentifiers() []string {
}

func (services ECSServices) MaxBatchSize() int {
return 200
return 49
}

// Nuke - nuke all ECS service resources
Expand Down
2 changes: 1 addition & 1 deletion aws/eip_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (address EIPAddresses) ResourceIdentifiers() []string {

func (address EIPAddresses) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/elasticache_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (cache Elasticaches) ResourceIdentifiers() []string {

func (cache Elasticaches) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/elb_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (balancer LoadBalancers) ResourceIdentifiers() []string {

func (balancer LoadBalancers) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/elbv2_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (balancer LoadBalancersV2) ResourceName() string {

func (balancer LoadBalancersV2) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// ResourceIdentifiers - The arns of the load balancers
Expand Down
6 changes: 3 additions & 3 deletions aws/iam_group_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"github.com/gruntwork-io/go-commons/errors"
)

//IAMGroups - represents all IAMGroups on the AWS Account
// IAMGroups - represents all IAMGroups on the AWS Account
type IAMGroups struct {
GroupNames []string
}

//ResourceName - the simple name of the AWS resource
// ResourceName - the simple name of the AWS resource
func (u IAMGroups) ResourceName() string {
return "iam-group"
}
Expand All @@ -24,7 +24,7 @@ func (g IAMGroups) ResourceIdentifiers() []string {
// Tentative batch size to ensure AWS doesn't throttle
// There's a global max of 500 groups so it shouldn't take long either way
func (g IAMGroups) MaxBatchSize() int {
return 80
return 49
}

// Nuke - Destroy every group in this collection
Expand Down
2 changes: 1 addition & 1 deletion aws/iam_policy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (p IAMPolicies) ResourceIdentifiers() []string {

// MaxBatchSize Tentative batch size to ensure AWS doesn't throttle
func (p IAMPolicies) MaxBatchSize() int {
return 80
return 49
}

// Nuke - Destroy every group in this collection
Expand Down
2 changes: 1 addition & 1 deletion aws/iam_role_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (r IAMRoles) ResourceIdentifiers() []string {

// Tentative batch size to ensure AWS doesn't throttle
func (r IAMRoles) MaxBatchSize() int {
return 80
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/iam_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (u IAMUsers) ResourceIdentifiers() []string {

// Tentative batch size to ensure AWS doesn't throttle
func (u IAMUsers) MaxBatchSize() int {
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/kms_customer_key_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (c KmsCustomerKeys) ResourceIdentifiers() []string {

// MaxBatchSize - Requests batch size
func (r KmsCustomerKeys) MaxBatchSize() int {
return 100
return 49
}

// Nuke - remove all customer managed keys
Expand Down
2 changes: 1 addition & 1 deletion aws/lambda_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (lambda LambdaFunctions) ResourceIdentifiers() []string {

func (lambda LambdaFunctions) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/launch_config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (config LaunchConfigs) ResourceName() string {

func (config LaunchConfigs) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// ResourceIdentifiers - The names of the launch configurations
Expand Down
2 changes: 1 addition & 1 deletion aws/rds_cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (instance DBClusters) ResourceIdentifiers() []string {

func (instance DBClusters) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/rds_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (instance DBInstances) ResourceIdentifiers() []string {

func (instance DBInstances) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/sagemaker_notebook_instance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (instance SageMakerNotebookInstances) ResourceIdentifiers() []string {

func (instance SageMakerNotebookInstances) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/snapshot_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (snapshot Snapshots) ResourceIdentifiers() []string {

func (snapshot Snapshots) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// Nuke - nuke 'em all!!!
Expand Down
2 changes: 1 addition & 1 deletion aws/sqs_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (queue SqsQueue) ResourceName() string {

func (queue SqsQueue) MaxBatchSize() int {
// Tentative batch size to ensure AWS doesn't throttle
return 200
return 49
}

// ResourceIdentifiers - The arns of the sqs queues
Expand Down

0 comments on commit 1cc8ad9

Please sign in to comment.