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.

ExampleMetadata

infused

Example:

# vpc: ec2.Vpc

cluster = docdb.DatabaseCluster(self, "Database",
    master_user=docdb.Login(
        username="myuser",  # NOTE: 'admin' is reserved by DocumentDB
        exclude_characters=""@/:",  # optional, defaults to the set ""@/" and is also used for eventually created rotations
        secret_name="/myapp/mydocdb/masteruser"
    ),
    instance_type=ec2.InstanceType.of(ec2.InstanceClass.MEMORY5, ec2.InstanceSize.LARGE),
    vpc_subnets=ec2.SubnetSelection(
        subnet_type=ec2.SubnetType.PUBLIC
    ),
    vpc=vpc
)
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