describeEC2InstanceLimits method
- EC2InstanceType? eC2InstanceType,
- String? location,
This API works with the following fleet types: EC2
Retrieves the instance limits and current utilization for an Amazon Web Services Region or location. Instance limits control the number of instances, per instance type, per location, that your Amazon Web Services account can use. Learn more at Amazon EC2 Instance Types. The information returned includes the maximum number of instances allowed and your account's current usage across all fleets. This information can affect your ability to scale your Amazon GameLift Servers fleets. You can request a limit increase for your account by using the Service limits page in the Amazon GameLift Servers console.
Instance limits differ based on whether the instances are deployed in a fleet's home Region or in a remote location. For remote locations, limits also differ based on the combination of home Region and remote location. All requests must specify an Amazon Web Services Region (either explicitly or as your default settings). To get the limit for a remote location, you must also specify the location. To learn more about how Amazon GameLift Servers handles locations, see Amazon GameLift Servers service locations. For example, the following requests all return different results:
-
Request specifies the Region
ap-northeast-1with no location. The result is limits and usage data on all of the fleets that reside inap-northeast-1, for all instance types that are deployed inap-northeast-1. -
Request specifies the Region
ap-northeast-1with locationus-west-2. The result is limits and usage data on all of the fleets that reside inap-northeast-1, for all instance types that are deployed inus-west-2. -
Request specifies the Region
us-east-1with locationap-northeast-1. The result is limits and usage data on all of the fleets that reside inus-east-1, for all instance types that are deployed inap-northeast-1. These limits do not affect fleets in any other Regions that deploy instances toap-northeast-1.
- To get limit and usage data for all instance types that are deployed in an Amazon Web Services Region by fleets that reside in the same Region: Specify the Region only. Optionally, specify a single instance type to retrieve information for.
- To get limit and usage data for all instance types that are deployed to a remote location by fleets that reside in different Amazon Web Services Region: Provide both the Amazon Web Services Region and the remote location. Optionally, specify a single instance type to retrieve information for.
EC2InstanceLimits object is returned with
limits and usage data for each requested instance type.
Learn more
Setting up Amazon GameLift Servers fleets
May throw InternalServiceException.
May throw InvalidRequestException.
May throw UnauthorizedException.
May throw UnsupportedRegionException.
Parameter eC2InstanceType :
Name of an Amazon EC2 instance type that is supported in Amazon GameLift
Servers. A fleet instance type determines the computing resources of each
instance in the fleet, including CPU, memory, storage, and networking
capacity. Do not specify a value for this parameter to retrieve limits for
all instance types.
Parameter location :
The name of a remote location to request instance limits for, in the form
of an Amazon Web Services Region code such as us-west-2.
Implementation
Future<DescribeEC2InstanceLimitsOutput> describeEC2InstanceLimits({
EC2InstanceType? eC2InstanceType,
String? location,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.DescribeEC2InstanceLimits'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (eC2InstanceType != null) 'EC2InstanceType': eC2InstanceType.value,
if (location != null) 'Location': location,
},
);
return DescribeEC2InstanceLimitsOutput.fromJson(jsonResponse.body);
}