- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ModifyDefaultCreditSpecificationCommand
Modifies the default credit option for CPU usage of burstable performance instances. The default credit option is set at the account level per Amazon Web Services 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 Amazon Web Services 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 EC2 User Guide.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, ModifyDefaultCreditSpecificationCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, ModifyDefaultCreditSpecificationCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const input = { // ModifyDefaultCreditSpecificationRequest
DryRun: true || false,
InstanceFamily: "t2" || "t3" || "t3a" || "t4g", // required
CpuCredits: "STRING_VALUE", // required
};
const command = new ModifyDefaultCreditSpecificationCommand(input);
const response = await client.send(command);
// { // ModifyDefaultCreditSpecificationResult
// InstanceFamilyCreditSpecification: { // InstanceFamilyCreditSpecification
// InstanceFamily: "t2" || "t3" || "t3a" || "t4g",
// CpuCredits: "STRING_VALUE",
// },
// };
ModifyDefaultCreditSpecificationCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
CpuCredits Required | string | undefined | The credit option for CPU usage of the instance family. Valid Values: |
InstanceFamily Required | UnlimitedSupportedInstanceFamily | undefined | The instance family. |
DryRun | boolean | undefined | Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is |
ModifyDefaultCreditSpecificationCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
InstanceFamilyCreditSpecification | InstanceFamilyCreditSpecification | undefined | The default credit option for CPU usage of the instance family. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
EC2ServiceException | Base exception class for all service exceptions from EC2 service. |