Class: AWSCDK::EC2::InstanceType
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::EC2::InstanceType
- Defined in:
- ec2/instance_type.rb
Overview
Instance type for EC2 instances.
This class takes a literal string, good if you already know the identifier of the type you want.
Direct Known Subclasses
Class Method Summary collapse
- .jsii_overridable_methods ⇒ Object
-
.of(instance_class, instance_size) ⇒ AWSCDK::EC2::InstanceType
Instance type for EC2 instances.
Instance Method Summary collapse
-
#architecture ⇒ AWSCDK::EC2::InstanceArchitecture
The instance's CPU architecture.
-
#initialize(instance_type_identifier) ⇒ InstanceType
constructor
A new instance of InstanceType.
-
#is_burstable ⇒ Boolean
Return whether this instance type is a burstable instance type.
- #same_instance_class_as(other) ⇒ Boolean
-
#to_string ⇒ String
Return the instance type as a dotted string.
Constructor Details
#initialize(instance_type_identifier) ⇒ InstanceType
Returns a new instance of InstanceType.
12 13 14 15 |
# File 'ec2/instance_type.rb', line 12 def initialize(instance_type_identifier) Jsii::Type.check_type(instance_type_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceTypeIdentifier") Jsii::Object.instance_method(:initialize).bind(self).call(instance_type_identifier) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'ec2/instance_type.rb', line 17 def self.jsii_overridable_methods { :architecture => { kind: :property, name: "architecture", is_optional: false }, :is_burstable => { kind: :method, name: "isBurstable", is_optional: false }, :same_instance_class_as => { kind: :method, name: "sameInstanceClassAs", is_optional: false }, :to_string => { kind: :method, name: "toString", is_optional: false }, } end |
.of(instance_class, instance_size) ⇒ AWSCDK::EC2::InstanceType
Instance type for EC2 instances.
This class takes a combination of a class and size.
Be aware that not all combinations of class and size are available, and not all classes are available in all regions.
36 37 38 39 40 |
# File 'ec2/instance_type.rb', line 36 def self.of(instance_class, instance_size) Jsii::Type.check_type(instance_class, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluc3RhbmNlQ2xhc3MifQ==")), "instanceClass") Jsii::Type.check_type(instance_size, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluc3RhbmNlU2l6ZSJ9")), "instanceSize") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.InstanceType", "of", [instance_class, instance_size]) end |
Instance Method Details
#architecture ⇒ AWSCDK::EC2::InstanceArchitecture
The instance's CPU architecture.
45 46 47 |
# File 'ec2/instance_type.rb', line 45 def architecture() jsii_get_property("architecture") end |
#is_burstable ⇒ Boolean
Return whether this instance type is a burstable instance type.
52 53 54 |
# File 'ec2/instance_type.rb', line 52 def is_burstable() jsii_call_method("isBurstable", []) end |
#same_instance_class_as(other) ⇒ Boolean
58 59 60 61 |
# File 'ec2/instance_type.rb', line 58 def same_instance_class_as(other) Jsii::Type.check_type(other, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluc3RhbmNlVHlwZSJ9")), "other") jsii_call_method("sameInstanceClassAs", [other]) end |
#to_string ⇒ String
Return the instance type as a dotted string.
66 67 68 |
# File 'ec2/instance_type.rb', line 66 def to_string() jsii_call_method("toString", []) end |