Class: AWSCDK::EC2::CfnInstance::CpuOptionsProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/cfn_instance.rb

Overview

Specifies the CPU options for the instance.

When you specify CPU options, you must specify both the number of CPU cores and threads per core.

Modifying the CPU options for an instance results in instance replacement .

For more information, see Optimize CPU options in the Amazon Elastic Compute Cloud User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(core_count: nil, threads_per_core: nil) ⇒ CpuOptionsProperty

Returns a new instance of CpuOptionsProperty.

Parameters:

  • core_count (Numeric, nil) (defaults to: nil)

    The number of CPU cores for the instance.

  • threads_per_core (Numeric, nil) (defaults to: nil)

    The number of threads per CPU core.



1264
1265
1266
1267
1268
1269
# File 'ec2/cfn_instance.rb', line 1264

def initialize(core_count: nil, threads_per_core: nil)
  @core_count = core_count
  Jsii::Type.check_type(@core_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "coreCount") unless @core_count.nil?
  @threads_per_core = threads_per_core
  Jsii::Type.check_type(@threads_per_core, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "threadsPerCore") unless @threads_per_core.nil?
end

Instance Attribute Details

#core_countNumeric? (readonly)

The number of CPU cores for the instance.



1275
1276
1277
# File 'ec2/cfn_instance.rb', line 1275

def core_count
  @core_count
end

#threads_per_coreNumeric? (readonly)

The number of threads per CPU core.



1280
1281
1282
# File 'ec2/cfn_instance.rb', line 1280

def threads_per_core
  @threads_per_core
end

Class Method Details

.jsii_propertiesObject



1282
1283
1284
1285
1286
1287
# File 'ec2/cfn_instance.rb', line 1282

def self.jsii_properties
  {
    :core_count => "coreCount",
    :threads_per_core => "threadsPerCore",
  }
end

Instance Method Details

#to_jsiiObject



1289
1290
1291
1292
1293
1294
1295
1296
# File 'ec2/cfn_instance.rb', line 1289

def to_jsii
  result = {}
  result.merge!({
    "coreCount" => @core_count,
    "threadsPerCore" => @threads_per_core,
  })
  result.compact
end