describeEC2InstanceLimits method

Future<DescribeEC2InstanceLimitsOutput> describeEC2InstanceLimits({
  1. EC2InstanceType? eC2InstanceType,
})

Retrieves the following information for the specified EC2 instance type:

  • Maximum number of instances allowed per AWS account (service limit).
  • Current usage for the AWS account.
To learn more about the capabilities of each instance type, see Amazon EC2 Instance Types. Note that the instance types offered may vary depending on the region.

Learn more

Setting up GameLift Fleets

Related operations

May throw InvalidRequestException. May throw InternalServiceException. May throw UnauthorizedException.

Parameter eC2InstanceType : Name of an EC2 instance type that is supported in Amazon GameLift. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. Amazon GameLift supports the following EC2 instance types. See Amazon EC2 Instance Types for detailed descriptions. Leave this parameter blank to retrieve limits for all types.

Implementation

Future<DescribeEC2InstanceLimitsOutput> describeEC2InstanceLimits({
  EC2InstanceType? eC2InstanceType,
}) 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.toValue(),
    },
  );

  return DescribeEC2InstanceLimitsOutput.fromJson(jsonResponse.body);
}