InstanceType

class aws_cdk.aws_ec2.InstanceType(instance_type_identifier)

Bases: object

Instance type for EC2 instances.

This class takes a literal string, good if you already know the identifier of the type you want.

Example:

# vpc is of type Vpc


my_security_group = ec2.SecurityGroup(self, "SecurityGroup", vpc=vpc)
autoscaling.AutoScalingGroup(self, "ASG",
    vpc=vpc,
    instance_type=ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO),
    machine_image=ec2.AmazonLinuxImage(),
    security_group=my_security_group
)
Parameters

instance_type_identifier (str) –

Methods

to_string()

Return the instance type as a dotted string.

Return type

str

Attributes

architecture

The instance’s CPU architecture.

Return type

InstanceArchitecture

Static Methods

classmethod of(instance_class, instance_size)

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.

Parameters
Return type

InstanceType