Open dreamorosi opened 1 year ago
This could be related to https://github.com/aws/aws-cdk/issues/20873
I am making this a p1 but as cli-lib-alpha
is an early experimental package, we probably won't be able to look into this issue immediately. But we welcome any further insights for this if any.
Hi @pahud thank you replying and providing a link to another issue.
I am positive that this is indeed related to #20873. Using the workaround described in this comment makes the error go away.
Describe the bug
When using the
AwsCdkCli
from the@aws-cdk/cli-lib-alpha
package I'm unable to synthesise stacks containing aNodejsFunction
construct.Expected Behavior
The stack should synth & deploy normally, provided that all other parameters are valid.
Current Behavior
When attempting to synth the stack, an error is thrown:
Reproduction Steps
ICloudAssemblyDirectoryProducer
, along the lines of what described in the construct docs:const nodeJsFunction = new NodejsFunction(producer.stack, "my-function", { runtime: Runtime.NODEJS_18_X, functionName: "my-function-1234", entry: join(__dirname,
./src/index.ts
), timeout: Duration.seconds(30), handler: "handler", environment: { IDEMPOTENCY_TABLE_NAME: table.tableName, }, logRetention: RetentionDays.ONE_DAY, }); table.grantReadWriteData(nodeJsFunction);src/index.ts
Full file below
Alternatively, clone this repo with the same code as above and run: https://github.com/dreamorosi/cdk-cli-poc
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.87.0
Framework Version
No response
Node.js Version
v18.12.1
OS
macOS
Language
Typescript
Language Version
5.1.6
Other information
No response