-
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
feat(cloudfront): add origin group selection criteria to L2 Distribution and L2 OriginGroup #32740
base: main
Are you sure you want to change the base?
feat(cloudfront): add origin group selection criteria to L2 Distribution and L2 OriginGroup #32740
Conversation
add integration test
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32740 +/- ##
=======================================
Coverage 81.52% 81.52%
=======================================
Files 222 222
Lines 13715 13715
Branches 2417 2417
=======================================
Hits 11181 11181
Misses 2254 2254
Partials 280 280
Flags with carried forward coverage won't be shown. Click here to find out more.
|
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
… better with existing interfaces
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.
Thanks 👍 Left some comments for adjustments
* | ||
* @default - none |
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.
* | |
* @default - none |
enum
declarations don't need a @default
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.
my bad! removed
DEFAULT='default', | ||
/** | ||
* Selection based on media quality. | ||
*/ | ||
MEDIA_QUALITY_BASED='media-quality-based', |
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.
DEFAULT='default', | |
/** | |
* Selection based on media quality. | |
*/ | |
MEDIA_QUALITY_BASED='media-quality-based', | |
DEFAULT = 'default', | |
/** | |
* Selection based on media quality. | |
*/ | |
MEDIA_QUALITY_BASED = 'media-quality-based', |
Formatting.
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.
fixed
* The failover selection for the Distribution. | ||
* | ||
* @default - nothing is returned |
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.
* The failover selection for the Distribution. | |
* | |
* @default - nothing is returned | |
* The selection criteria for the origin group. | |
* | |
* @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html#concept_origin_groups.creating | |
* | |
* @default - OriginSelectionCriteria.DEFAULT |
I assume CFN will enforce default
if not specified by CDK?
Can you please align the documentation in the other variable declarations as well?
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.
Yeah - if it is undefined, then it'll default to default - even if we pass undefined, do you want the docs to reflect the "default" setting?
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.
I think these test cases should be added to the existing distribution.test.ts file.
Also, the Ensure default is undefined
case seems redundant.
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.
I've moved them to distribution.test.ts - i removed that test, but have added in a test where "default" is explicitly set.
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.
Thanks 👍 Please update the documentation for the variable in origin-group.ts
as well
/** | ||
* The selection criteria for the origin group. | ||
* | ||
* @default - nothing is returned |
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.
* @default - nothing is returned | |
* @see https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html#concept_origin_groups.creating | |
* | |
* @default - OriginSelectionCriteria.DEFAULT |
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.
done! thanks!
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue # (if applicable)
Closes #.
Reason for this change
add origin selection criteria to L2 Distribution & L2 OriginGroup
add unit + integration tests
Description of changes
Add Selection Criteria to Distribution L2 construct. CFN docs can be found here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-origingroup.html#cfn-cloudfront-distribution-origingroup-selectioncriteria
Description of how you validated changes
Added unit + integration tests for this new feature - by default it can be undefined, so shouldn't impact other configurations.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license