Skip to content
This repository has been archived by the owner on Mar 6, 2022. It is now read-only.

The maximum number of rules per security group has been reached #25

Closed
peavers opened this issue Jul 20, 2021 · 1 comment
Closed

The maximum number of rules per security group has been reached #25

peavers opened this issue Jul 20, 2021 · 1 comment

Comments

@peavers
Copy link

peavers commented Jul 20, 2021

Hello, trying to install via Terraform but hitting The maximum number of rules per security group has been reached. I've increased my Inbound or outbound rules per security group rules from 60 to 120 but still hitting the limit, is this the correct quota to be adjusting here?

╷
│ Error: error updating Security Group (sg-059c85e095c49e44a): error authorizing Security Group (ingress) rules: RulesPerSecurityGroupLimitExceeded: The maximum number of rules per security group has been reached.
│ 	status code: 400, request id: a6c1c40f-23ae-423f-a67b-f0a90161b43e
│
│   with aws_security_group.this["us-east-1"],
│   on main.tf line 157, in resource "aws_security_group" "this":
│  157: resource "aws_security_group" "this" {
│
╵
╷
│ Error: error updating Security Group (sg-0d8c094457070a035): error authorizing Security Group (ingress) rules: RulesPerSecurityGroupLimitExceeded: The maximum number of rules per security group has been reached.
│ 	status code: 400, request id: 1b7ed22a-9d3e-48cb-95a2-437242a4cdcd
│
│   with aws_security_group.this["us-west-2"],
│   on main.tf line 157, in resource "aws_security_group" "this":
│  157: resource "aws_security_group" "this" {
│
╵
@dan-v
Copy link
Owner

dan-v commented Jul 28, 2021

@peavers - the number of AWS CIDR blocks can be quite large depending on the region. I added an additional output as a quick hack to get a count as shown below. us-east-1 is over 120 and also be aware that these limits are per AWS region as well.

output "data" {
  value = [for x in data.aws_ip_ranges.lambda: {sort(x.regions)[0]: length(x.cidr_blocks)}]
}
terraform plan
...
  + data = [
      + {
          + ap-northeast-1 = 43
        },
      + {
          + ap-northeast-2 = 18
        },
      + {
          + ap-south-1 = 20
        },
      + {
          + ap-southeast-1 = 39
        },
      + {
          + ap-southeast-2 = 28
        },
      + {
          + ca-central-1 = 14
        },
      + {
          + eu-central-1 = 32
        },
      + {
          + eu-north-1 = 12
        },
      + {
          + eu-west-1 = 58
        },
      + {
          + eu-west-2 = 21
        },
      + {
          + eu-west-3 = 13
        },
      + {
          + sa-east-1 = 25
        },
      + {
          + us-east-1 = 125
        },
      + {
          + us-east-2 = 35
        },
      + {
          + us-west-1 = 37
        },
      + {
          + us-west-2 = 71
        },
    ]

@dan-v dan-v closed this as completed Mar 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants