-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(aws-cloudfront): Add sslSupportMethod #19737
Merged
mergify
merged 3 commits into
aws:master
from
dayjournal:dayjournal/add-sslSupportMethod
Apr 7, 2022
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -220,6 +220,25 @@ export interface DistributionProps { | |
* @default - SecurityPolicyProtocol.TLS_V1_2_2021 if the '@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021' feature flag is set; otherwise, SecurityPolicyProtocol.TLS_V1_2_2019. | ||
*/ | ||
readonly minimumProtocolVersion?: SecurityPolicyProtocol; | ||
|
||
/** | ||
* The SSL method CloudFront will use for your distribution. | ||
* | ||
* Server Name Indication (SNI) - is an extension to the TLS computer networking protocol by which a client indicates | ||
* which hostname it is attempting to connect to at the start of the handshaking process. This allows a server to present | ||
* multiple certificates on the same IP address and TCP port number and hence allows multiple secure (HTTPS) websites | ||
* (or any other service over TLS) to be served by the same IP address without requiring all those sites to use the same certificate. | ||
* | ||
* CloudFront can use SNI to host multiple distributions on the same IP - which a large majority of clients will support. | ||
* | ||
* If your clients cannot support SNI however - CloudFront can use dedicated IPs for your distribution - but there is a prorated monthly charge for | ||
* using this feature. By default, we use SNI - but you can optionally enable dedicated IPs (VIP). | ||
* | ||
* See the CloudFront SSL for more details about pricing : https://aws.amazon.com/cloudfront/custom-ssl-domains/ | ||
* | ||
* @default - SSLMethod.SNI | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Corrected comment. |
||
*/ | ||
readonly sslSupportMethod?: SSLMethod; | ||
} | ||
|
||
/** | ||
|
@@ -304,7 +323,8 @@ export class Distribution extends Resource implements IDistribution { | |
logging: this.renderLogging(props), | ||
priceClass: props.priceClass ?? undefined, | ||
restrictions: this.renderRestrictions(props.geoRestriction), | ||
viewerCertificate: this.certificate ? this.renderViewerCertificate(this.certificate, props.minimumProtocolVersion) : undefined, | ||
viewerCertificate: this.certificate ? this.renderViewerCertificate(this.certificate, | ||
props.minimumProtocolVersion, props.sslSupportMethod) : undefined, | ||
webAclId: props.webAclId, | ||
}, | ||
}); | ||
|
@@ -450,16 +470,17 @@ export class Distribution extends Resource implements IDistribution { | |
} | ||
|
||
private renderViewerCertificate(certificate: acm.ICertificate, | ||
minimumProtocolVersionProp?: SecurityPolicyProtocol): CfnDistribution.ViewerCertificateProperty { | ||
minimumProtocolVersionProp?: SecurityPolicyProtocol, sslSupportMethodProp?: SSLMethod): CfnDistribution.ViewerCertificateProperty { | ||
|
||
const defaultVersion = FeatureFlags.of(this).isEnabled(CLOUDFRONT_DEFAULT_SECURITY_POLICY_TLS_V1_2_2021) | ||
? SecurityPolicyProtocol.TLS_V1_2_2021 : SecurityPolicyProtocol.TLS_V1_2_2019; | ||
const minimumProtocolVersion = minimumProtocolVersionProp ?? defaultVersion; | ||
const sslSupportMethod = sslSupportMethodProp ?? SSLMethod.SNI; | ||
|
||
return { | ||
acmCertificateArn: certificate.certificateArn, | ||
sslSupportMethod: SSLMethod.SNI, | ||
minimumProtocolVersion: minimumProtocolVersion, | ||
sslSupportMethod: sslSupportMethod, | ||
}; | ||
} | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove the extra space at the front of these two lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected comment.