what happens after either of those limits are reached?
When those limits are reached, you will run into a
ConflictException with an error message like
Current limit of builds of 1000 have been reached. or
Account is currently over limit. Current total size: 100.12GB. Allowed total size: 100.00GB.
Ideally, this should be
LimitsExceededException, but the service is quite old and we cannot change it anymore to be backwards compatible.
Do old builds need to manually be removed, or is there some options in place to cycle out oldest as new builds come in.
Nope, GameLift does not offer such mechanism intentionally, because it’s very risky to delete something on behalf of the customer (False positives could be costly).
It’s straightforward to do this by yourself though. You can write a scheduled job (e.g. a cloudwatch scheduled event triggering a lambda function every N days) that does the following:
- Call ListBuild to get all of your build
- Iterate through the resulting Builds (you’ll likely need to paginate multiple pages), get the Build’s Version or CreationTime.
- Compare the value with your cutoff version or cutoff date, if too stale, call DeleteBuild to delete the build. The cutoff version/date could be set as lambda environment variable to enable easy editing.
- Deletion by CreationTime is not recommended, because some of your build could be old but might still be useful.
- DeleteBuild has a API rate limit of 4TPS burst and 1TPS sustained, so please add a rate limiter to ensure no more than 1 DeleteBuild is called per second, or you will get throttling exceptions.
- If needed, you could also setup monitors to alert you when you have more than N builds (e.g. 700, or 70% of your capacity), and manually drive an aggressive cleanup if needed.