Skip to content
v2.274.0

AmazonLinux2022Kernel Class ​

Amazon Linux 2022 kernel versions.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const amazonLinux2022Kernel = ec2.AmazonLinux2022Kernel.CDK_LATEST;
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

amazon_linux2022_kernel = ec2.AmazonLinux2022Kernel.CDK_LATEST
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

AmazonLinux2022Kernel amazonLinux2022Kernel = AmazonLinux2022Kernel.CDK_LATEST;
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

var amazonLinux2022Kernel = AmazonLinux2022Kernel.CDK_LATEST;
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

amazonLinux2022Kernel := awscdk.Aws_ec2.AmazonLinux2022Kernel_CDK_LATEST()

Initializer ​

ts
new AmazonLinux2022Kernel(version: string)
python
AmazonLinux2022Kernel(version: str)
java
new AmazonLinux2022Kernel(String version)
csharp
new AmazonLinux2022Kernel(string version)
go
NewAmazonLinux2022Kernel(Version *string)

Properties ​

The latest kernel version currently available in a published AMI.
notes

When a new kernel version is available for an al2022 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.

The default kernel version for Amazon Linux 2022 is 5.15 and the SSM parameter does not include it in the name (i.e. /aws/service/ami-amazon-linux-latest/amzn2022-ami-kernel-default-x86_64).
Kernel version 5.15.

Methods ​

toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Generate a string representation of the kernel.