Skip to content

Commit

Permalink
fix(aws-s3): properly export bucketDomainName (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeldoKavira authored and rix0rrr committed Oct 3, 2018
1 parent 8215389 commit 8caa28c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-s3/lib/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export abstract class BucketRef extends cdk.Construct {
return {
bucketArn: new cdk.Output(this, 'BucketArn', { value: this.bucketArn }).makeImportValue().toString(),
bucketName: new cdk.Output(this, 'BucketName', { value: this.bucketName }).makeImportValue().toString(),
bucketDomainName: new cdk.Output(this, 'DomainName', { value: this.domainName }).makeImportValue().toString(),
};
}

Expand Down
28 changes: 26 additions & 2 deletions packages/@aws-cdk/aws-s3/test/test.bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ export = {
const bucketRef = bucket.export();
test.deepEqual(cdk.resolve(bucketRef), {
bucketArn: { 'Fn::ImportValue': 'MyStack:MyBucketBucketArnE260558C' },
bucketName: { 'Fn::ImportValue': 'MyStack:MyBucketBucketName8A027014' }
bucketName: { 'Fn::ImportValue': 'MyStack:MyBucketBucketName8A027014' },
bucketDomainName: { 'Fn::ImportValue': 'MyStack:MyBucketDomainNameF76B9A7A' }
});
test.done();
},
Expand All @@ -340,7 +341,8 @@ export = {
const bucketRef = bucket.export();
test.deepEqual(cdk.resolve(bucketRef), {
bucketArn: { 'Fn::ImportValue': 'MyStack:MyBucketBucketArnE260558C' },
bucketName: { 'Fn::ImportValue': 'MyStack:MyBucketBucketName8A027014' }
bucketName: { 'Fn::ImportValue': 'MyStack:MyBucketBucketName8A027014' },
bucketDomainName: { 'Fn::ImportValue': 'MyStack:MyBucketDomainNameF76B9A7A' }
});
test.done();
},
Expand Down Expand Up @@ -457,6 +459,17 @@ export = {
"Export": {
"Name": "S1:MyBucketBucketName8A027014"
}
},
"MyBucketDomainNameF76B9A7A": {
"Value": {
"Fn::GetAtt": [
"MyBucketF68F3FF0",
"DomainName"
]
},
"Export": {
"Name": "S1:MyBucketDomainNameF76B9A7A"
}
}
}
});
Expand Down Expand Up @@ -881,6 +894,17 @@ export = {
"Export": {
"Name": "MyBucketBucketName8A027014"
}
},
"MyBucketDomainNameF76B9A7A": {
"Value": {
"Fn::GetAtt": [
"MyBucketF68F3FF0",
"DomainName"
]
},
"Export": {
"Name": "MyBucketDomainNameF76B9A7A"
}
}
}
});
Expand Down

0 comments on commit 8caa28c

Please sign in to comment.