Getting S3 buckets quota limit via GO API

1

How do I get the s3 buckets quota limit by calling the GO API? (default is 100 per account) I have tried serviceQuotas.GetServiceQuota(ctx, &servicequotas.GetServiceQuotaInput{ QuotaCode: "L-DC2B2D3D", ServiceCode: "s3"}) but the return value (serviceQuotaOutput) is nil. What am I missing here? Thanks!

asked 2 years ago1709 views
2 Answers
0

Hi,

GetServiceQuotas retrieves the applied quota value for the specified quota and if the applied quota value is not available for a quota, the quota is not retrieved as also mentioned here : https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_GetServiceQuota.html

In order to check what quotas have applied quota values, I made a list-service-quotas call on service-code s3 and the output is empty as can be seen below :

aws service-quotas list-service-quotas --service-code s3

Output : { "Quotas": [] }

As GetServiceQuotas only retrieves applied quota values and s3 has no quotas for which this value can be retrieved, hence you will not receive any output.

You can use GetAWSDefaultServiceQuota to get the default value of the specified quota. However, this will only retrieve the default value and will not reflect any quota increases : https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_GetAWSDefaultServiceQuota.html

The display of quotas in the Service Quotas console varies by service, with some services displaying the AWS Default Quota Value, the Applied Quota Value, or both. At this moment, the AWS console and API only displays the default quota value for the S3 bucket. The actual applied value is not displayed. The limitation with the Service Quotas API is an ongoing improvement that the teams are constantly working on.

Currently, as there is no API that can help you get this information, so the tracking can be done on your side by continuously updating a database and then monitoring the current usage compared to the value stored in the database, or you could hardcode the applied quota value if you are using any custom script and then monitor the current usage limit against the hardcoded limit.

Please feel free to reach out for further queries or concerns.

AWS
SUPPORT ENGINEER
answered 2 years ago
0

Hey,

I'm facing the same issue as described in the first comment.

Is there a plan to expose the applied quota for S3 buckets in the future? like other service quotas

Moreover, I wondered if a user can decrease the applied quota to be lower than the default quota of 100.

Thanks Ori

answered 21 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions