-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(cloudfront): support geo restrictions for cloudfront distribution #7345
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
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
iliapolo
left a comment
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.
Hi @mina-asham.
The PR looks good. However, I believe we can offer a slightly higher level experience.
Notice that the API you implemented is actually very similar to the native CloudFormation spec (and hence to the L1 construct).
Since we are building an L2, we should strive to simplify the usage, and not necessarily just expose CloudFormation properties as is. For example, what if the usage would have been something like:
new cloudfront.CloudFrontWebDistribution(stack, 'MyDistribution', {
//...
geoRestriction: GeoRestriction.whitelist('UK', 'US')
});This feels a bit more clear, less nesting and less code on the user's part.
What do you think?
|
@mina-asham Also - did you intentionally reference #6414 in the PR body? |
Nope, I don't recall putting that there, sorry for the mix up will drop it! |
I like that, it's much more intuitive to use this way indeed, will update! |
|
@iliapolo updated per comments! |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
- Restrictions currently support GeoRestriction only, but if CloudFront adds support for other types it can easily be expanded - Closes #3456
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
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). |
Commit Message
feat(cloudfront): support geo restrictions for cloudfront distribution (#7345)
End Commit Message
Pull Request Checklist
CLI change?: coordinate update of integration tests with teamcdk-init template change?: coordinated update of integration tests with teamDesign: For significant features, design document added todesignfolderBreaking?: last paragraph: "BREAKING CHANGE: <describe what changed + link for details>"[ ] Sensitive Modules (requires 2 PR approvers)IAM Policy Document (in @aws-cdk/aws-iam)EC2 Security Groups and ACLs (in @aws-cdk/aws-ec2)Grant APIs (only if not based on official documentation with a reference)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license