ModifyDefaultCreditSpecification - Amazon Elastic Compute Cloud

ModifyDefaultCreditSpecification

Modifies the default credit option for CPU usage of burstable performance instances. The default credit option is set at the account level per AWS Region, and is specified per instance family. All new burstable performance instances in the account launch using the default credit option.

ModifyDefaultCreditSpecification is an asynchronous operation, which works at an AWS Region level and modifies the credit option for each Availability Zone. All zones in a Region are updated within five minutes. But if instances are launched during this operation, they might not get the new credit option until the zone is updated. To verify whether the update has occurred, you can call GetDefaultCreditSpecification and check DefaultCreditSpecification for updates.

For more information, see Burstable performance instances in the Amazon Elastic Compute Cloud User Guide.

Request Parameters

The following parameters are for this specific action. For more information about required and optional parameters that are common to all actions, see Common Query Parameters.

CpuCredits

The credit option for CPU usage of the instance family.

Valid Values: standard | unlimited

Type: String

Required: Yes

DryRun

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Type: Boolean

Required: No

InstanceFamily

The instance family.

Type: String

Valid Values: t2 | t3 | t3a

Required: Yes

Response Elements

The following elements are returned by the service.

instanceFamilyCreditSpecification

The default credit option for CPU usage of the instance family.

Type: InstanceFamilyCreditSpecification object

requestId

The ID of the request.

Type: String

Errors

For information about the errors that are common to all actions, see Common Client Errors.

Examples

Example 1

This example modifies the default credit option for CPU usage to unlimited for all instances in the T2 instance family in the specified Region.

Sample Request

https://ec2.amazonaws.com/?Action=ModifyDefaultCreditSpecification &Region=us-east-1 &InstanceFamily=t2 &CpuCredits=unlimited &AUTHPARAMS

Sample Response

<ModifyDefaultCreditSpecificationResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>11111111-2222-3333-4444-5555EXAMPLE</requestId> <instanceFamilyCreditSpecification> <cpuCredits>unlimited</cpuCredits> <instanceFamily>t2</instanceFamily> </instanceFamilyCreditSpecification> </ModifyDefaultCreditSpecificationResponse>

Example 2

This example modifies the default credit option for CPU usage to standard for all instances in the T3 instance family in the specified Region.

Sample Request

https://ec2.amazonaws.com/?Action=ModifyDefaultCreditSpecification &Region=us-east-1 &InstanceFamily=t3 &CpuCredits=standard &AUTHPARAMS

Sample Response

<ModifyDefaultCreditSpecificationResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <requestId>11111111-2222-3333-4444-5555EXAMPLE</requestId> <instanceFamilyCreditSpecification> <cpuCredits>standard</cpuCredits> <instanceFamily>t3</instanceFamily> </instanceFamilyCreditSpecification> </ModifyDefaultCreditSpecificationResponse>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: