Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CloudFront] Check specifically for undefined and determining of the defaultRootObject prop is set or not #801

Merged
merged 4 commits into from
Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## [UNRELEASED]


### Bug Fixes

* **aws-cloudfront:** Fix empty string defaultRootObject being replaced with the default value instead of passing the empty string to CloudFormation. Closes [#794](https://github.com/awslabs/aws-cdk/issues/794)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required. Just follow conventional commits and it will be added to the changelog

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update. Thanks for the call
out


### CloudFormation Changes

* __@aws-cdk/cfnspec__: Updated [CloudFormation resource specification] to `v2.8.0` ([@RomainMuller] in [#767](https://github.com/awslabs/aws-cdk/pull/767))
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export class CloudFrontWebDistribution extends cdk.Construct {
const distributionConfig: cloudformation.DistributionResource.DistributionConfigProperty = {
comment: props.comment,
enabled: true,
defaultRootObject: props.defaultRootObject || "index.html",
defaultRootObject: props.defaultRootObject !== undefined ? props.defaultRootObject : "index.html",
httpVersion: props.httpVersion || HttpVersion.HTTP2,
priceClass: props.priceClass || PriceClass.PriceClass100,
ipv6Enabled: props.enableIpV6 || true,
Expand Down