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

feat(cloudfront): Origin Shield support #15453

Merged
merged 10 commits into from
Jul 30, 2021

Conversation

smguggen
Copy link
Contributor

@smguggen smguggen commented Jul 7, 2021

Closes #12872 - Origin Shield is a part of the CfnDistribution resources but has not yet been added to the relevant CloudFront constructs. These changes add originShieldRegion fields to OriginProps and SourceConfiguration as specified here as well as update the ReadMe and all the necessary tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Jul 7, 2021

@peterwoodworth peterwoodworth added the @aws-cdk/aws-cloudfront Related to Amazon CloudFront label Jul 7, 2021
Copy link
Contributor

@njlynch njlynch left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Just a few minor nitpicks and one API clarity question.

packages/@aws-cdk/aws-cloudfront/lib/origin.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-cloudfront/lib/origin.ts Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-cloudfront/lib/origin.ts Outdated Show resolved Hide resolved
Co-authored-by: Nick Lynch <nlynch@amazon.com>
@mergify mergify bot dismissed njlynch’s stale review July 29, 2021 13:54

Pull request has been modified.

packages/@aws-cdk/aws-cloudfront/lib/origin.ts Outdated Show resolved Hide resolved
Comment on lines 1158 to 1160
if (!(/^\w\w\-[a-z]*\-\d$/).test(originShieldRegion)) {
throw new Error(`originShieldRegion ${originShieldRegion} is not a valid AWS region.`);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're removing the region validation from the Distribution, might as well remove it from here for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, missed that one, I removed it and went ahead and made that return use a ternary operator too.

Co-authored-by: Nick Lynch <nlynch@amazon.com>
@mergify mergify bot dismissed njlynch’s stale review July 29, 2021 16:54

Pull request has been modified.

njlynch
njlynch previously approved these changes Jul 29, 2021
Copy link
Contributor

@njlynch njlynch left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@njlynch njlynch changed the title feat(cloudfront): Add Origin Shield to Cloudfront Origins and Web Distribution - closes #12872 feat(cloudfront): Origin Shield support Jul 29, 2021
@smguggen
Copy link
Contributor Author

@njlynch Sorry, build was failing because previous change had trailing spaces, can you approve one more time? Thanks.

@smguggen smguggen requested a review from njlynch July 30, 2021 00:58
@mergify
Copy link
Contributor

mergify bot commented Jul 30, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 5827266
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 08ebbae into aws:master Jul 30, 2021
@mergify
Copy link
Contributor

mergify bot commented Jul 30, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Aug 3, 2021
**Closes [aws#12872](aws#12872 - Origin Shield is a part of the CfnDistribution resources but has not yet been added to the relevant CloudFront constructs. These changes add `originShieldRegion` fields to `OriginProps` and `SourceConfiguration` as specified [here](aws#12872 (comment)) as well as update the ReadMe and all the necessary tests.

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
**Closes [aws#12872](aws#12872 - Origin Shield is a part of the CfnDistribution resources but has not yet been added to the relevant CloudFront constructs. These changes add `originShieldRegion` fields to `OriginProps` and `SourceConfiguration` as specified [here](aws#12872 (comment)) as well as update the ReadMe and all the necessary tests.

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessing OriginShieldProperty in cloudfront.distribution
4 participants