Class: AWSCDK::EC2::CfnLaunchTemplate::CpuOptionsProperty

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

Overview

Specifies the CPU options for an instance.

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

CpuOptions is a property of AWS::EC2::LaunchTemplate LaunchTemplateData .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of CpuOptionsProperty.

Parameters:

  • amd_sev_snp (String, nil) (defaults to: nil)

    Indicates whether to enable the instance for AMD SEV-SNP.

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

    The number of CPU cores for the instance.

  • nested_virtualization (String, nil) (defaults to: nil)

    Indicates whether the instance is enabled for nested virtualization.

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

    The number of threads per CPU core.



998
999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'ec2/cfn_launch_template.rb', line 998

def initialize(amd_sev_snp: nil, core_count: nil, nested_virtualization: nil, threads_per_core: nil)
  @amd_sev_snp = amd_sev_snp
  Jsii::Type.check_type(@amd_sev_snp, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "amdSevSnp") unless @amd_sev_snp.nil?
  @core_count = core_count
  Jsii::Type.check_type(@core_count, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "coreCount") unless @core_count.nil?
  @nested_virtualization = nested_virtualization
  Jsii::Type.check_type(@nested_virtualization, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "nestedVirtualization") unless @nested_virtualization.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

#amd_sev_snpString? (readonly)

Indicates whether to enable the instance for AMD SEV-SNP.

AMD SEV-SNP is supported with M6a, R6a, and C6a instance types only. For more information, see AMD SEV-SNP for Amazon EC2 instances .



1015
1016
1017
# File 'ec2/cfn_launch_template.rb', line 1015

def amd_sev_snp
  @amd_sev_snp
end

#core_countNumeric? (readonly)

The number of CPU cores for the instance.



1020
1021
1022
# File 'ec2/cfn_launch_template.rb', line 1020

def core_count
  @core_count
end

#nested_virtualizationString? (readonly)

Indicates whether the instance is enabled for nested virtualization.



1025
1026
1027
# File 'ec2/cfn_launch_template.rb', line 1025

def nested_virtualization
  @nested_virtualization
end

#threads_per_coreNumeric? (readonly)

The number of threads per CPU core.

To disable multithreading for the instance, specify a value of 1 . Otherwise, specify the default value of 2 .



1032
1033
1034
# File 'ec2/cfn_launch_template.rb', line 1032

def threads_per_core
  @threads_per_core
end

Class Method Details

.jsii_propertiesObject



1034
1035
1036
1037
1038
1039
1040
1041
# File 'ec2/cfn_launch_template.rb', line 1034

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

Instance Method Details

#to_jsiiObject



1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
# File 'ec2/cfn_launch_template.rb', line 1043

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