Skip to content

Commit

Permalink
fix(assets): can now use multiple assets in the same stack
Browse files Browse the repository at this point in the history
Fixed by attaching the imported bucket to the Asset object instead
of the Asset object's parent.

Fixes #706.
  • Loading branch information
Rico Huijbers committed Sep 17, 2018
1 parent 815915e commit 2d6f28b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assets/lib/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class Asset extends cdk.Construct {
const s3Filename = new cdk.FnSelect(1, new cdk.FnSplit(cxapi.ASSET_PREFIX_SEPARATOR, keyParam.value));
this.s3ObjectKey = new s3.ObjectKey(new cdk.FnConcat(this.s3Prefix, s3Filename));

this.bucket = s3.BucketRef.import(parent, 'AssetBucket', {
this.bucket = s3.BucketRef.import(this, 'AssetBucket', {
bucketName: this.s3BucketName
});

Expand Down

0 comments on commit 2d6f28b

Please sign in to comment.