Amazon Elastic Compute Cloud

2024/10/03 - Amazon Elastic Compute Cloud - 1 new api methods

Changes  This release includes a new API for modifying instance cpu-options after launch.

ModifyInstanceCpuOptions (new) Link ΒΆ

By default, all vCPUs for the instance type are active when you launch an instance. When you configure the number of active vCPUs for the instance, it can help you save on licensing costs and optimize performance. The base cost of the instance remains unchanged.

The number of active vCPUs equals the number of threads per CPU core multiplied by the number of cores.

Note

Some instance type options do not support this capability. For more information, see Supported CPU options in the Amazon EC2 User Guide .

See also: AWS API Documentation

Request Syntax

client.modify_instance_cpu_options(
    InstanceId='string',
    CoreCount=123,
    ThreadsPerCore=123,
    DryRun=True|False
)
type InstanceId

string

param InstanceId

[REQUIRED]

The ID of the instance to update.

type CoreCount

integer

param CoreCount

[REQUIRED]

The number of CPU cores to activate for the specified instance.

type ThreadsPerCore

integer

param ThreadsPerCore

[REQUIRED]

The number of threads to run for each CPU core.

type DryRun

boolean

param DryRun

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 DryRunOperation . Otherwise, it is UnauthorizedOperation .

rtype

dict

returns

Response Syntax

{
    'InstanceId': 'string',
    'CoreCount': 123,
    'ThreadsPerCore': 123
}

Response Structure

  • (dict) --

    • InstanceId (string) --

      The ID of the instance that was updated.

    • CoreCount (integer) --

      The number of CPU cores that are running for the specified instance after the update.

    • ThreadsPerCore (integer) --

      The number of threads that are running per CPU core for the specified instance after the update.