I thought this would be straightforward but so far it isn't. I'm trying to specify the runtime version in a buildspec (using CDK in python). In the below snippet, if I specify the nodejs version without quotes then python complains that nodejs is an undefined variable. If I put it in quotes then it doesn't update the runtime version.
How do I specify the version?
codebuild.Project(
self,
"client-frontend-react-codebuild",
project_name="frontend-react",
build_spec=codebuild.BuildSpec.from_object(
{
"version": "0.2",
"phases": {
"install": {
"runtime-versions": {nodejs: "16.x"}
}, # this doesn't work
"build": {
"commands": [
"echo Hello, World!",
]
},
},
}
)