class InstanceType
| Language | Type name | 
|---|---|
  .NET | Amazon.CDK.AWS.EC2.InstanceType | 
  Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#InstanceType | 
  Java | software.amazon.awscdk.services.ec2.InstanceType | 
  Python | aws_cdk.aws_ec2.InstanceType | 
  TypeScript (source) | aws-cdk-lib » aws_ec2 » InstanceType | 
Instance type for EC2 instances.
This class takes a literal string, good if you already know the identifier of the type you want.
Example
declare const vpc: ec2.Vpc;
const cluster = new docdb.DatabaseCluster(this, 'Database', {
  masterUser: {
    username: 'myuser',
  },
  instanceType: ec2.InstanceType.of(ec2.InstanceClass.MEMORY5, ec2.InstanceSize.LARGE),
  vpcSubnets: {
    subnetType: ec2.SubnetType.PUBLIC,
  },
  vpc,
  caCertificate: docdb.CaCertificate.RDS_CA_RSA4096_G1, // CA certificate for all instances under this cluster
});
Initializer
new InstanceType(instanceTypeIdentifier: string)
Parameters
- instanceTypeIdentifier 
string 
Properties
| Name | Type | Description | 
|---|---|---|
| architecture | Instance | The instance's CPU architecture. | 
architecture
Type:
Instance
The instance's CPU architecture.
Methods
| Name | Description | 
|---|---|
| is | Return whether this instance type is a burstable instance type. | 
| same | |
| to | Return the instance type as a dotted string. | 
| static of(instanceClass, instanceSize) | Instance type for EC2 instances. | 
isBurstable() 
public isBurstable(): boolean
Returns
boolean
Return whether this instance type is a burstable instance type.
sameInstanceClassAs(other)   
public sameInstanceClassAs(other: InstanceType): boolean
Parameters
- other 
InstanceType  
Returns
boolean
toString() 
public toString(): string
Returns
string
Return the instance type as a dotted string.
static of(instanceClass, instanceSize)
public static of(instanceClass: InstanceClass, instanceSize: InstanceSize): InstanceType
Parameters
- instanceClass 
InstanceClass  - instanceSize 
InstanceSize  
Returns
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.

 .NET
 Go
 Java
 Python
 TypeScript (