class AmazonLinux2Kernel
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.EC2.AmazonLinux2Kernel |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#AmazonLinux2Kernel |
![]() | software.amazon.awscdk.services.ec2.AmazonLinux2Kernel |
![]() | aws_cdk.aws_ec2.AmazonLinux2Kernel |
![]() | aws-cdk-lib » aws_ec2 » AmazonLinux2Kernel |
Amazon Linux 2 kernel versions.
Example
declare const vpc: ec2.Vpc;
declare const instanceType: ec2.InstanceType;
// Amazon Linux 2
new ec2.Instance(this, 'Instance2', {
vpc,
instanceType,
machineImage: ec2.MachineImage.latestAmazonLinux2(),
});
// Amazon Linux 2 with kernel 5.x
new ec2.Instance(this, 'Instance3', {
vpc,
instanceType,
machineImage: ec2.MachineImage.latestAmazonLinux2({
kernel: ec2.AmazonLinux2Kernel.KERNEL_5_10,
}),
});
// Amazon Linux 2023
new ec2.Instance(this, 'Instance4', {
vpc,
instanceType,
machineImage: ec2.MachineImage.latestAmazonLinux2023(),
});
// Graviton 3 Processor
new ec2.Instance(this, 'Instance5', {
vpc,
instanceType: ec2.InstanceType.of(ec2.InstanceClass.C7G, ec2.InstanceSize.LARGE),
machineImage: ec2.MachineImage.latestAmazonLinux2023({
cpuType: ec2.AmazonLinuxCpuType.ARM_64,
}),
});
Initializer
new AmazonLinux2Kernel(version: string)
Parameters
- version
string
Properties
Name | Type | Description |
---|---|---|
static CDK_LATEST | Amazon | The latest kernel version currently available in a published AMI. |
static DEFAULT | Amazon | The default kernel version for Amazon Linux 2 is 4.14 and Linux 4.14.311-233.529.amzn2.x86_64 the SSM parameter does not include it in the name (i.e. /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2). |
static KERNEL_5_10 | Amazon | Kernel version 5.10. |
static CDK_LATEST
Type:
Amazon
The latest kernel version currently available in a published AMI.
When a new kernel version is available for an amzn2 AMI this will be updated to contain the latest kernel version and will cause your instances to be replaced. Do not store stateful information on the instance if you are using this version.
static DEFAULT
Type:
Amazon
The default kernel version for Amazon Linux 2 is 4.14 and Linux 4.14.311-233.529.amzn2.x86_64 the SSM parameter does not include it in the name (i.e. /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2).
static KERNEL_5_10
Type:
Amazon
Kernel version 5.10.
Methods
Name | Description |
---|---|
to | Generate a string representation of the kernel. |
toString()
public toString(): string
Returns
string
Generate a string representation of the kernel.