# AmazonLinux2022Kernel

Amazon Linux 2022 kernel versions.

Obtainable from: AmazonLinux2022Kernel.CDK_LATEST, AmazonLinux2022Kernel.DEFAULT, AmazonLinux2022Kernel.KERNEL_5_15

- Source: [`aws-ec2/lib/machine-image/amazon-linux-2022.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ec2/lib/machine-image/amazon-linux-2022.ts#L7)
- Type last changed: v2.76.0 · 20 Apr 2023

## Example

TypeScript:

```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:

```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:

```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;
```

C# / .NET:

```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;
```

Golang:

```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

TypeScript:

```ts
new AmazonLinux2022Kernel(version: string)
```

Python:

```python
AmazonLinux2022Kernel(version: str)
```

Java:

```java
new AmazonLinux2022Kernel(String version)
```

C# / .NET:

```csharp
new AmazonLinux2022Kernel(string version)
```

Golang:

```go
NewAmazonLinux2022Kernel(Version *string)
```

## Properties

- `CDK_LATEST`: [AmazonLinux2022Kernel](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.AmazonLinux2022Kernel.html) (static) — The latest kernel version currently available in a published AMI.

  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.

- `DEFAULT`: [AmazonLinux2022Kernel](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.AmazonLinux2022Kernel.html) (static) — 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_5_15`: [AmazonLinux2022Kernel](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.AmazonLinux2022Kernel.html) (static) — Kernel version 5.15.

## Methods

- `toString(): string` — Generate a string representation of the kernel.
