-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
bugThis issue is a bug.This issue is a bug.
Description
Whenever I try to create a stack with multiple assets I receive the following error when I run cdk synth
:
Error: There is already a Construct with name 'AssetBucket' in ApiStack [ApiStack]
at ApiStack.addChild (/git/project/node_modules/@aws-cdk/cdk/lib/core/construct.js:287:19)
at new Construct (/git/project/node_modules/@aws-cdk/cdk/lib/core/construct.js:38:20)
at new BucketRef (/git/project/node_modules/@aws-cdk/aws-s3/lib/bucket.js:30:9)
at new ImportedBucketRef (/git/project/node_modules/@aws-cdk/aws-s3/lib/bucket.js:519:9)
at Function.import (/git/project/node_modules/@aws-cdk/aws-s3/lib/bucket.js:46:16)
at new Asset (/git/project/node_modules/@aws-cdk/assets/lib/asset.js:48:42)
at new ZipDirectoryAsset (/git/project/node_modules/@aws-cdk/assets/lib/asset.js:95:9)
at new ApiStack (/git/project/index.js:100:24)
at new App (/git/project/index.js:187:5)
at Object.<anonymous> (/git/project/index.js:191:22)
I noticed that when defining a new asset the bucket is always imported with the same name. I think this may be the offending line.
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.