I’m attempting to run cdktf synth on an AWS Lambda function, targeting the writeable tmp folder for the output as all other folders on the Lambda are read-only. However, running the command throws an error where cdktf seemingly attempts to write something to the home folder : “Error: EROFS: read-only file system, mkdir ‘/home/sbx_user1051’”.
Is this expected behavior?
The full command: cdktf synth --output ~/tmp/cdktf/cdktf.out
This is probably the caching of the version check that’s happening. It writes to the CDKTF_HOME directory (which by default is ~/.cdktf if I remember correctly). You can either set that directory to a writable one or try disabling the version check via the env var DISABLE_VERSION_CHECK=true.
Hey @nbaju1. Are you able to share more details of your setup? Having issues running cdktf deploy in an aws lambda, based on a Amazon Linux 2023 (node 20) image. The error I’m getting is
The lambda image is custom built from public.ecr.aws/docker/library/python:3.10-slim-bookworm, where I install the various dependencies. Not sure what else would be relevant other than that.