AmazonLinuxKernel

class aws_cdk.aws_ec2.AmazonLinuxKernel(value)

Bases: enum.Enum

Amazon Linux Kernel.

ExampleMetadata

infused

Example:

# vpc: ec2.Vpc
# instance_type: ec2.InstanceType


# AWS Linux
ec2.Instance(self, "Instance1",
    vpc=vpc,
    instance_type=instance_type,
    machine_image=ec2.AmazonLinuxImage()
)

# AWS Linux 2
ec2.Instance(self, "Instance2",
    vpc=vpc,
    instance_type=instance_type,
    machine_image=ec2.AmazonLinuxImage(
        generation=ec2.AmazonLinuxGeneration.AMAZON_LINUX_2
    )
)

# AWS Linux 2 with kernel 5.x
ec2.Instance(self, "Instance3",
    vpc=vpc,
    instance_type=instance_type,
    machine_image=ec2.AmazonLinuxImage(
        generation=ec2.AmazonLinuxGeneration.AMAZON_LINUX_2,
        kernel=ec2.AmazonLinuxKernel.KERNEL5_X
    )
)

# AWS Linux 2022
ec2.Instance(self, "Instance4",
    vpc=vpc,
    instance_type=instance_type,
    machine_image=ec2.AmazonLinuxImage(
        generation=ec2.AmazonLinuxGeneration.AMAZON_LINUX_2022
    )
)

Attributes

KERNEL5_X

Standard edition.