Skip to content

Commit 8caa28c

Browse files
ZeldoKavirarix0rrr
authored andcommitted
fix(aws-s3): properly export bucketDomainName (#844)
1 parent 8215389 commit 8caa28c

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

Diff for: packages/@aws-cdk/aws-s3/lib/bucket.ts

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export abstract class BucketRef extends cdk.Construct {
110110
return {
111111
bucketArn: new cdk.Output(this, 'BucketArn', { value: this.bucketArn }).makeImportValue().toString(),
112112
bucketName: new cdk.Output(this, 'BucketName', { value: this.bucketName }).makeImportValue().toString(),
113+
bucketDomainName: new cdk.Output(this, 'DomainName', { value: this.domainName }).makeImportValue().toString(),
113114
};
114115
}
115116

Diff for: packages/@aws-cdk/aws-s3/test/test.bucket.ts

+26-2
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ export = {
329329
const bucketRef = bucket.export();
330330
test.deepEqual(cdk.resolve(bucketRef), {
331331
bucketArn: { 'Fn::ImportValue': 'MyStack:MyBucketBucketArnE260558C' },
332-
bucketName: { 'Fn::ImportValue': 'MyStack:MyBucketBucketName8A027014' }
332+
bucketName: { 'Fn::ImportValue': 'MyStack:MyBucketBucketName8A027014' },
333+
bucketDomainName: { 'Fn::ImportValue': 'MyStack:MyBucketDomainNameF76B9A7A' }
333334
});
334335
test.done();
335336
},
@@ -340,7 +341,8 @@ export = {
340341
const bucketRef = bucket.export();
341342
test.deepEqual(cdk.resolve(bucketRef), {
342343
bucketArn: { 'Fn::ImportValue': 'MyStack:MyBucketBucketArnE260558C' },
343-
bucketName: { 'Fn::ImportValue': 'MyStack:MyBucketBucketName8A027014' }
344+
bucketName: { 'Fn::ImportValue': 'MyStack:MyBucketBucketName8A027014' },
345+
bucketDomainName: { 'Fn::ImportValue': 'MyStack:MyBucketDomainNameF76B9A7A' }
344346
});
345347
test.done();
346348
},
@@ -457,6 +459,17 @@ export = {
457459
"Export": {
458460
"Name": "S1:MyBucketBucketName8A027014"
459461
}
462+
},
463+
"MyBucketDomainNameF76B9A7A": {
464+
"Value": {
465+
"Fn::GetAtt": [
466+
"MyBucketF68F3FF0",
467+
"DomainName"
468+
]
469+
},
470+
"Export": {
471+
"Name": "S1:MyBucketDomainNameF76B9A7A"
472+
}
460473
}
461474
}
462475
});
@@ -881,6 +894,17 @@ export = {
881894
"Export": {
882895
"Name": "MyBucketBucketName8A027014"
883896
}
897+
},
898+
"MyBucketDomainNameF76B9A7A": {
899+
"Value": {
900+
"Fn::GetAtt": [
901+
"MyBucketF68F3FF0",
902+
"DomainName"
903+
]
904+
},
905+
"Export": {
906+
"Name": "MyBucketDomainNameF76B9A7A"
907+
}
884908
}
885909
}
886910
});

0 commit comments

Comments
 (0)