We keep bumping into quota limits for public AMIs in some of the newer EC2 regions. Let's update the quota for all regions of AWS to a minimum of 1000. Something like this should do it I think:
regions=$(aws ec2 describe-regions --all-regions --filters Name=opt-in-status,Values=opted-in,opt-in-not-required --output=json | jq -r .Regions[].RegionName) for region in $regions; do echo -n "######## $region" value=$(aws service-quotas get-service-quota --region=$region --service-code=ec2 --quota-code=L-0E3CBAB9 --output=json | jq .Quota.Value) value=${value%.*} # pull off ".0` so we can do integer math echo ": $value" if [ $value -lt 1000 ]; then echo "requesting quota increase to 1000" set -x aws service-quotas request-service-quota-increase --region=$region --service-code=ec2 --quota-code=L-0E3CBAB9 --desired-value 1000.00 set +x fi done
You can view the quota codes using:
aws service-quotas --service-code ec2 list-service-quotas
Done:
# ap-south-2: : 168 requesting quota increase to 1000 + aws service-quotas request-service-quota-increase --region=ap-south-2 --service-code=ec2 --quota-code=L-0E3CBAB9 --desired-value 1000.00 ---------------------------------------------------------------------------------------------------------------- | RequestServiceQuotaIncrease | +--------------------------------------------------------------------------------------------------------------+ || RequestedQuota || |+-----------------------+------------------------------------------------------------------------------------+| || Created | 2023-11-07T12:10:22.482000-08:00 || || DesiredValue | 1000.0 || || GlobalQuota | False || || Id | f8f31e7a7bb5414b8e51dabcc7523bb8Mdu7Hb5X || || QuotaArn | arn:aws:servicequotas:ap-south-2:125523088429:ec2/L-0E3CBAB9 || || QuotaCode | L-0E3CBAB9 || || QuotaName | Public AMIs || || QuotaRequestedAtLevel| ACCOUNT || || Requester | {"accountId":"125523088429","callerArn":"arn:aws:iam::125523088429:user/kevin"} || || ServiceCode | ec2 || || ServiceName | Amazon Elastic Compute Cloud (Amazon EC2) || || Status | PENDING || || Unit | None || |+-----------------------+------------------------------------------------------------------------------------+| + set +x # ap-south-1: : 3562 # eu-south-1: : 952 requesting quota increase to 1000 + aws service-quotas request-service-quota-increase --region=eu-south-1 --service-code=ec2 --quota-code=L-0E3CBAB9 --desired-value 1000.00 ---------------------------------------------------------------------------------------------------------------- | RequestServiceQuotaIncrease | +--------------------------------------------------------------------------------------------------------------+ || RequestedQuota || |+-----------------------+------------------------------------------------------------------------------------+| || Created | 2023-11-07T12:10:25.981000-08:00 || || DesiredValue | 1000.0 || || GlobalQuota | False || || Id | 870b2326a7ee46678dbd874ef73c448a7nNP9PSY || || QuotaArn | arn:aws:servicequotas:eu-south-1:125523088429:ec2/L-0E3CBAB9 || || QuotaCode | L-0E3CBAB9 || || QuotaName | Public AMIs || || QuotaRequestedAtLevel| ACCOUNT || || Requester | {"accountId":"125523088429","callerArn":"arn:aws:iam::125523088429:user/kevin"} || || ServiceCode | ec2 || || ServiceName | Amazon Elastic Compute Cloud (Amazon EC2) || || Status | PENDING || || Unit | None || |+-----------------------+------------------------------------------------------------------------------------+| + set +x # eu-south-2: : 168 requesting quota increase to 1000 + aws service-quotas request-service-quota-increase --region=eu-south-2 --service-code=ec2 --quota-code=L-0E3CBAB9 --desired-value 1000.00 ---------------------------------------------------------------------------------------------------------------- | RequestServiceQuotaIncrease | +--------------------------------------------------------------------------------------------------------------+ || RequestedQuota || |+-----------------------+------------------------------------------------------------------------------------+| || Created | 2023-11-07T12:10:28.143000-08:00 || || DesiredValue | 1000.0 || || GlobalQuota | False || || Id | 27cc8bca11c048e2a23dfb8eb4ad958bXIdQwxqw || || QuotaArn | arn:aws:servicequotas:eu-south-2:125523088429:ec2/L-0E3CBAB9 || || QuotaCode | L-0E3CBAB9 || || QuotaName | Public AMIs || || QuotaRequestedAtLevel| ACCOUNT || || Requester | {"accountId":"125523088429","callerArn":"arn:aws:iam::125523088429:user/kevin"} || || ServiceCode | ec2 || || ServiceName | Amazon Elastic Compute Cloud (Amazon EC2) || || Status | PENDING || || Unit | None || |+-----------------------+------------------------------------------------------------------------------------+| + set +x # me-central-1: : 240 requesting quota increase to 1000 + aws service-quotas request-service-quota-increase --region=me-central-1 --service-code=ec2 --quota-code=L-0E3CBAB9 --desired-value 1000.00 ---------------------------------------------------------------------------------------------------------------- | RequestServiceQuotaIncrease | +--------------------------------------------------------------------------------------------------------------+ || RequestedQuota || |+-----------------------+------------------------------------------------------------------------------------+| || Created | 2023-11-07T12:10:30.850000-08:00 || || DesiredValue | 1000.0 || || GlobalQuota | False || || Id | c0152387c38e4c70ac92ec3e6952edd93pVb1Y1h || || QuotaArn | arn:aws:servicequotas:me-central-1:125523088429:ec2/L-0E3CBAB9 || || QuotaCode | L-0E3CBAB9 || || QuotaName | Public AMIs || || QuotaRequestedAtLevel| ACCOUNT || || Requester | {"accountId":"125523088429","callerArn":"arn:aws:iam::125523088429:user/kevin"} || || ServiceCode | ec2 || || ServiceName | Amazon Elastic Compute Cloud (Amazon EC2) || || Status | PENDING || || Unit | None || |+-----------------------+------------------------------------------------------------------------------------+| + set +x # il-central-1: : 134 requesting quota increase to 1000 + aws service-quotas request-service-quota-increase --region=il-central-1 --service-code=ec2 --quota-code=L-0E3CBAB9 --desired-value 1000.00 ---------------------------------------------------------------------------------------------------------------- | RequestServiceQuotaIncrease | +--------------------------------------------------------------------------------------------------------------+ || RequestedQuota || |+-----------------------+------------------------------------------------------------------------------------+| || Created | 2023-11-07T12:10:33.267000-08:00 || || DesiredValue | 1000.0 || || GlobalQuota | False || || Id | 874032a049014185989f61e114661510XUK8InJG || || QuotaArn | arn:aws:servicequotas:il-central-1:125523088429:ec2/L-0E3CBAB9 || || QuotaCode | L-0E3CBAB9 || || QuotaName | Public AMIs || || QuotaRequestedAtLevel| ACCOUNT || || Requester | {"accountId":"125523088429","callerArn":"arn:aws:iam::125523088429:user/kevin"} || || ServiceCode | ec2 || || ServiceName | Amazon Elastic Compute Cloud (Amazon EC2) || || Status | PENDING || || Unit | None || |+-----------------------+------------------------------------------------------------------------------------+| + set +x # ca-central-1: : 3554 # eu-central-1: : 11554 # eu-central-2: : 168 requesting quota increase to 1000 + aws service-quotas request-service-quota-increase --region=eu-central-2 --service-code=ec2 --quota-code=L-0E3CBAB9 --desired-value 1000.00 ---------------------------------------------------------------------------------------------------------------- | RequestServiceQuotaIncrease | +--------------------------------------------------------------------------------------------------------------+ || RequestedQuota || |+-----------------------+------------------------------------------------------------------------------------+| || Created | 2023-11-07T12:10:37.262000-08:00 || || DesiredValue | 1000.0 || || GlobalQuota | False || || Id | 9514b34f2a844fadb00f85d56f081049K7p6K3Mz || || QuotaArn | arn:aws:servicequotas:eu-central-2:125523088429:ec2/L-0E3CBAB9 || || QuotaCode | L-0E3CBAB9 || || QuotaName | Public AMIs || || QuotaRequestedAtLevel| ACCOUNT || || Requester | {"accountId":"125523088429","callerArn":"arn:aws:iam::125523088429:user/kevin"} || || ServiceCode | ec2 || || ServiceName | Amazon Elastic Compute Cloud (Amazon EC2) || || Status | PENDING || || Unit | None || |+-----------------------+------------------------------------------------------------------------------------+| + set +x # us-west-1: : 11552 # us-west-2: : 11534 # af-south-1: : 980 requesting quota increase to 1000 + aws service-quotas request-service-quota-increase --region=af-south-1 --service-code=ec2 --quota-code=L-0E3CBAB9 --desired-value 1000.00 ---------------------------------------------------------------------------------------------------------------- | RequestServiceQuotaIncrease | +--------------------------------------------------------------------------------------------------------------+ || RequestedQuota || |+-----------------------+------------------------------------------------------------------------------------+| || Created | 2023-11-07T12:10:41.252000-08:00 || || DesiredValue | 1000.0 || || GlobalQuota | False || || Id | 0af989965d0e42c9a357daa195b10815Xhwwl57m || || QuotaArn | arn:aws:servicequotas:af-south-1:125523088429:ec2/L-0E3CBAB9 || || QuotaCode | L-0E3CBAB9 || || QuotaName | Public AMIs || || QuotaRequestedAtLevel| ACCOUNT || || Requester | {"accountId":"125523088429","callerArn":"arn:aws:iam::125523088429:user/kevin"} || || ServiceCode | ec2 || || ServiceName | Amazon Elastic Compute Cloud (Amazon EC2) || || Status | PENDING || || Unit | None || |+-----------------------+------------------------------------------------------------------------------------+| + set +x # eu-north-1: : 1020 # eu-west-3: : 1048 # eu-west-2: : 3548 # eu-west-1: : 11572 # ap-northeast-3: : 1000 # ap-northeast-2: : 3562 # me-south-1: : 1026 # ap-northeast-1: : 11654 # sa-east-1: : 11584 # ap-east-1: : 1012 # ap-southeast-1: : 11580 # ap-southeast-2: : 11612 # ap-southeast-3: : 208 requesting quota increase to 1000 + aws service-quotas request-service-quota-increase --region=ap-southeast-3 --service-code=ec2 --quota-code=L-0E3CBAB9 --desired-value 1000.00 ---------------------------------------------------------------------------------------------------------------- | RequestServiceQuotaIncrease | +--------------------------------------------------------------------------------------------------------------+ || RequestedQuota || |+-----------------------+------------------------------------------------------------------------------------+| || Created | 2023-11-07T12:10:56.108000-08:00 || || DesiredValue | 1000.0 || || GlobalQuota | False || || Id | 64baa71c0c2d4eb0a04b124e006a95e7OVZgLPfj || || QuotaArn | arn:aws:servicequotas:ap-southeast-3:125523088429:ec2/L-0E3CBAB9 || || QuotaCode | L-0E3CBAB9 || || QuotaName | Public AMIs || || QuotaRequestedAtLevel| ACCOUNT || || Requester | {"accountId":"125523088429","callerArn":"arn:aws:iam::125523088429:user/kevin"} || || ServiceCode | ec2 || || ServiceName | Amazon Elastic Compute Cloud (Amazon EC2) || || Status | PENDING || || Unit | None || |+-----------------------+------------------------------------------------------------------------------------+| + set +x # ap-southeast-4: : 1000 # us-east-1: : 15574 # us-east-2: : 1794
Metadata Update from @dustymabe: - Issue close_status updated to: Fixed - Issue status updated to: Closed (was: Open)
Log in to comment on this ticket.