I am trying to import/use CDKTF code into my existing Terraform project.
I am trying to implement Lambda with API gateway using typescript, and I figured out that working with typescript lambda + terraform is difficult.
So I am thinking to use CDKTF to generate zip, compiled TS code into JSON format and use that cdktf.json into may existing terraform code.
For simple CDKTF code like creating s3 bucket cdktf.json works with terraform deploy.
But when I am trying to deploy cdktf.json generate form this tutorial it fails
It is failing at this source
→ unable to load "assets/lambda-asset/XXXXXXX8908/archive.zip": open assets/lambda-asset/XXXXXXXX12344XXX/archive.zip: no such file or directory
. Is it possible to extract zip file created from TerraformAsset or is there a solution to use plain HCL without any CDKTF?
"aws_s3_object": {
"lambda-archive": {
"//": {
"metadata": {
"path": "lambda-hello-world/lambda-archive",
"uniqueId": "lambda-archive"
}
},
"bucket": "${aws_s3_bucket.bucket.bucket}",
"key": "v0.0.2/archive.zip",
"source": "assets/lambda-asset/ABCDEDGHIJKLAMN000006786986/archive.zip"
}
},