AWS Architech
Published in

AWS Architech

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"
]
}
}
})
});

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store