fix(servicequotas): curate real AWS VPC quota codes (#4997)

ServiceQuotas only curated codebuild, lambda and organizations; every
other service code got three CRC-synthetic quotas, so real VPC codes
such as L-FE5A380F answered NoSuchResourceException from
GetServiceQuota and GetAWSDefaultServiceQuota. Terraform's
aws_servicequotas_service_quota reads exactly these codes before
requesting an increase.

Add a curated "vpc" entry, plus its service name:
- L-FE5A380F "NAT gateways per Availability Zone" = 5
- L-2AEEBF1A "Rules per network ACL" = 20

Values are the AWS defaults rather than the generous GENERIC_QUOTA_VALUE,
following the organizations entry (L-E619E033 = 50): callers compare a
desired value against these defaults to decide whether to request an
increase, so a realistic default keeps them on the path they take
against AWS. The emulator does not enforce either limit. The synthetic
quotas are still appended.
This commit is contained in:
Allen Sanborn authored and GitHub committed 2026-10-02 23:49:20 -04:00
1 parent 8e98c087fd
commit 0260a42549
4 files changed
+71 -2

No files matched your search

@@ -49,6 +49,7 @@ public class ServiceQuotasService {
Map.entry("sns", "Amazon Simple Notification Service (Amazon SNS)"),
Map.entry("sqs", "Amazon Simple Queue Service (Amazon SQS)"),
Map.entry("ec2", "Amazon Elastic Compute Cloud (Amazon EC2)"),
Map.entry("vpc", "Amazon Virtual Private Cloud (Amazon VPC)"),
Map.entry("dynamodb", "Amazon DynamoDB"),
Map.entry("logs", "Amazon CloudWatch Logs"),
Map.entry("events", "Amazon EventBridge (CloudWatch Events)"));
@@ -59,7 +60,12 @@ public class ServiceQuotasService {
"lambda", List.of(
new QuotaDefinition("L-B99A9384", "Concurrent executions", GENERIC_QUOTA_VALUE, false)),
"organizations", List.of(
new QuotaDefinition("L-E619E033", "Maximum number of accounts", 50.0, true)));
new QuotaDefinition("L-E619E033", "Maximum number of accounts", 50.0, true)),
// AWS default values: tooling such as Terraform's aws_servicequotas_service_quota
// compares its desired value against these before requesting an increase.
"vpc", List.of(
new QuotaDefinition("L-FE5A380F", "NAT gateways per Availability Zone", 5.0, false),
new QuotaDefinition("L-2AEEBF1A", "Rules per network ACL", 20.0, false)));
private static final List<String> GENERIC_QUOTA_NAMES = List.of(
"Resources per Region",