HostKernel Enum
The host operating system kernel used for builds in a CodeBuild project.
The host kernel does not affect the build environment operating system, which is determined by the build image.
Only applies to the LINUX_CONTAINER, ARM_CONTAINER, LINUX_EC2 and ARM_EC2 environment types. It is not applicable to Windows, Lambda or Mac environment types.
Example
ts
new codebuild.Project(this, 'Project', {
environment: {
buildImage: codebuild.LinuxBuildImage.STANDARD_7_0,
hostKernel: codebuild.HostKernel.LINUX_KERNEL_6,
},
});
python
codebuild.Project(self, "Project",
environment=codebuild.BuildEnvironment(
build_image=codebuild.LinuxBuildImage.STANDARD_7_0,
host_kernel=codebuild.HostKernel.LINUX_KERNEL_6
)
)
java
Project.Builder.create(this, "Project")
.environment(BuildEnvironment.builder()
.buildImage(LinuxBuildImage.STANDARD_7_0)
.hostKernel(HostKernel.LINUX_KERNEL_6)
.build())
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
new Project(this, "Project", new ProjectProps {
Environment = new BuildEnvironment {
BuildImage = LinuxBuildImage.STANDARD_7_0,
HostKernel = HostKernel.LINUX_KERNEL_6
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
codebuild.NewProject(this, jsii.String("Project"), &ProjectProps{
Environment: &BuildEnvironment{
BuildImage: codebuild.LinuxBuildImage_STANDARD_7_0(),
HostKernel: codebuild.HostKernel_LINUX_KERNEL_6,
},
})
Members
| Member | Description |
|---|---|
LINUX_KERNEL_4 | Runs on an Amazon Linux 2 host (kernel 4.x). |
LINUX_KERNEL_6 | Runs on an Amazon Linux 2023 host (kernel 6.x). |
LINUX_KERNEL_LATEST | Runs on the latest supported host kernel. |
Referenced by
BuildEnvironment.hostKernelhost_kernelhostKernelHostKernelHostKernel