Use ModifyInstanceCreditSpecification with a CLI - Amazon Elastic Compute Cloud

Use ModifyInstanceCreditSpecification with a CLI

The following code examples show how to use ModifyInstanceCreditSpecification.

CLI
AWS CLI

To modify the credit option for CPU usage of an instance

This example modifies the credit option for CPU usage of the specified instance in the specified region to "unlimited". Valid credit options are "standard" and "unlimited".

Command:

aws ec2 modify-instance-credit-specification --instance-credit-specification "InstanceId=i-1234567890abcdef0,CpuCredits=unlimited"

Output:

{ "SuccessfulInstanceCreditSpecifications": [ { "InstanceId": "i-1234567890abcdef0" } ], "UnsuccessfulInstanceCreditSpecifications": [] }
PowerShell
Tools for PowerShell

Example 1: This enables T2 unlimited credits for instance i-01234567890abcdef.

$Credit = New-Object -TypeName Amazon.EC2.Model.InstanceCreditSpecificationRequest $Credit.InstanceId = "i-01234567890abcdef" $Credit.CpuCredits = "unlimited" Edit-EC2InstanceCreditSpecification -InstanceCreditSpecification $Credit

For a complete list of AWS SDK developer guides and code examples, see Create Amazon EC2 resources using an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.