AWS CDK: Specify Runtime Version for CodeBuild Project
Assuming you have a CodeBuild project and you want to specify the runtime to be Node.js latest, here is your answer:
new PipelineProject(this, `CodeBuildProject`, {
buildSpec: BuildSpec.fromObject({
version: '0.2',
phases: {
install: {
'runtime-versions': {
nodejs: "latest"
}
},
pre_build: {
commands: [
"npm install"
]
}
}
})
});