Aws-cdk: NestedStack are not prepared while local testing custom cdk construct lib using npm link

Created on 2 Apr 2020  路  3Comments  路  Source: aws/aws-cdk

While developing a custom construct cdk library, if a NestedStack is used and we are testing locally using npm link o similar, the NestedStack will not be prepared this will cause the error "TemplateURL must be an Amazon S3 URL".
This applies to cdk > 1.28.0 and it is due to a bug in the Construct library , I have submitted a issue and the fix hoping that it could be integrated (https://github.com/aws/constructs/issues/32)
As a temporary workaround could be used instead of using npm link

  • In the custom cdk library folder:
    npm pack
  • In the app folder:
    npm install yourlib.tar.gz

I know that is not a bug strictly related to cdk, but I have created the bug as a reference.

Reproduction Steps

Just write a cdk library containing a NestedStack, then try to npm link it

Error Log

"TemplateURL must be an Amazon S3 URL" for a NestedStack

Environment

  • **CLI Version : 1.31.0
  • **Framework Version: 1.31.0
  • *OS : *macOs Catalina
  • *Language :typesctipt*

Other


This is :bug: Bug Report

bug efforsmall p1 packagtools response-requested

All 3 comments

This is also an issue for stack imports with normal stacks. An example project is available here showcasing the issue https://github.com/AlexCheema/cdk-cross-lib-stacks

hey @apalumbo - saw that https://github.com/aws/constructs/pull/33 was merged a while back, is this issue still needed?
I think it would also take care of your issue @AlexCheema

@shivlaks merge aws/constructs#33 fixes the issue, so it can be closed

Was this page helpful?
0 / 5 - 0 ratings