https://serverless-stack.com/ logo
#help
Title
# help
s

Sam Hulick

01/21/2022, 4:42 PM
so, with the new CDK v2, can we just update
aws-cdk-lib
and any related
-alpha
libraries as we normally would with npm & yarn? no need for
sst update
?
d

Derek Kershner

01/21/2022, 4:43 PM
This is true even with CDK v1, so long as the version matches the SST version used.
s

Sam Hulick

01/21/2022, 4:44 PM
true. so I guess the question is, how do we know what version of CDK is needed by SST?
d

Derek Kershner

01/21/2022, 4:45 PM
i havent found a great answer for that, but l often just pull up the github repo and look, or dig into node_modules.
s

Sam Hulick

01/21/2022, 4:46 PM
yeah, I was just thinking that. SST 0.60.4
node_modules/@serverless-stack/resources/package.json
contains aws-cdk-lib 2.7.0
d

Derek Kershner

01/21/2022, 4:46 PM
correct, thats how I usually go about it. with CDK v1, you could just look at the peerDependencies complaining, but I think with so few that is no longer the case.
r

Ross Coundon

01/21/2022, 4:48 PM
if you run
sst --version
it gives you the current SST version and the supported CDK version
s

Sam Hulick

01/21/2022, 4:48 PM
ah! even better
d

Derek Kershner

01/21/2022, 4:49 PM
just be careful about the global install
sst
vs the project
sst
(might be different versions)
but, good tip indeed.
r

Ross Coundon

01/21/2022, 4:50 PM
Good point, I always run
./node_modules/.bin/sst --version
despite not having it installed globally
s

Sam Hulick

01/21/2022, 4:51 PM
yep.
yarn sst
will run the local project’s version
5 Views