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): support gRPC for distribution #32535

Merged
merged 35 commits into from
Feb 20, 2025
Merged

Conversation

go-to-k
Copy link
Contributor

@go-to-k go-to-k commented Dec 16, 2024

Issue # (if applicable)

Closes #32534.

Reason for this change

CloudFormation supports GrpcConfig property to enable gRPC in CacheBehavior and DefaultCacheBehavior.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-grpcconfig.html

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-cachebehavior.html

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-defaultcachebehavior.html

So it would be good to enable gRPC for CloudFront Distribution using L2.

Description of changes

Add enableGrpc property in BehaviorOptions.

Description of how you validated changes

Both unit and integ tests.

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team December 16, 2024 08:47
@github-actions github-actions bot added distinguished-contributor [Pilot] contributed 50+ PRs to the CDK feature-request A feature should be added or improved. p2 labels Dec 16, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a 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.

@go-to-k go-to-k marked this pull request as ready for review December 17, 2024 06:04
@github-actions github-actions bot added the effort/small Small work item – less than a day of effort label Dec 17, 2024
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.17%. Comparing base (b06daf8) to head (43afbf2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #32535   +/-   ##
=======================================
  Coverage   82.17%   82.17%           
=======================================
  Files         119      119           
  Lines        6862     6862           
  Branches     1158     1158           
=======================================
  Hits         5639     5639           
  Misses       1120     1120           
  Partials      103      103           
Flag Coverage Δ
suite.unit 82.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 82.17% <ø> (ø)

@go-to-k go-to-k marked this pull request as draft December 17, 2024 07:04
@aws-cdk-automation aws-cdk-automation dismissed their stale review December 17, 2024 07:21

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@go-to-k go-to-k marked this pull request as ready for review December 17, 2024 07:33
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Dec 17, 2024
@go-to-k go-to-k marked this pull request as draft December 17, 2024 08:53
@go-to-k go-to-k marked this pull request as ready for review December 17, 2024 08:54
@go-to-k go-to-k marked this pull request as draft December 17, 2024 09:21
Copy link
Contributor

mergify bot commented Feb 18, 2025

update

❌ Mergify doesn't have permission to update

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/codecov.yml without workflows permission

@go-to-k
Copy link
Contributor Author

go-to-k commented Feb 19, 2025

@aaythapa

Thank you for your review! Could you please take a loot at it again?

P.S. I will add the tests, I'll get back to you when that's done.

#32535 (comment)

@go-to-k go-to-k requested a review from aaythapa February 19, 2025 09:04
}
const validHttpVersions = [HttpVersion.HTTP2, HttpVersion.HTTP2_AND_3];
if (!validHttpVersions.includes(this.httpVersion)) {
throw new Error(`'httpVersion' must be ${validHttpVersions.join(', ')} if 'enableGrpc' in 'defaultBehavior' or 'additionalBehaviors' is true, got ${this.httpVersion}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
throw new Error(`'httpVersion' must be ${validHttpVersions.join(', ')} if 'enableGrpc' in 'defaultBehavior' or 'additionalBehaviors' is true, got ${this.httpVersion}`);
throw new Error(`'httpVersion' must be ${validHttpVersions.join('or ')} if 'enableGrpc' in 'defaultBehavior' or 'additionalBehaviors' is true, got ${this.httpVersion}`);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aaythapa
Copy link
Contributor

@mergify update

Copy link
Contributor

mergify bot commented Feb 19, 2025

update

❌ Mergify doesn't have permission to update

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/sync-from-upstream.yml without workflows permission

@aaythapa
Copy link
Contributor

@mergify update

Copy link
Contributor

mergify bot commented Feb 19, 2025

update

☑️ Nothing to do

  • #commits-behind > 0 [📌 update requirement]
  • -closed [📌 update requirement]
  • -conflict [📌 update requirement]
  • queue-position = -1 [📌 update requirement]

@go-to-k
Copy link
Contributor Author

go-to-k commented Feb 20, 2025

@aaythapa

Added the tests and also made other changes (to use ValidationError instead of a default Error)!

Could you please take a look at it again?

@go-to-k go-to-k requested a review from aaythapa February 20, 2025 11:07
Copy link
Contributor

@aaythapa aaythapa left a comment

Choose a reason for hiding this comment

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

Thank you as always for the contribution

@aaythapa
Copy link
Contributor

@mergify update

Copy link
Contributor

mergify bot commented Feb 20, 2025

update

✅ Branch has been successfully updated

Copy link
Contributor

mergify bot commented Feb 20, 2025

Thank you for contributing! Your pull request will be updated from main 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: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 43afbf2
  • 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 1b116b9 into aws:main Feb 20, 2025
20 checks passed
Copy link
Contributor

mergify bot commented Feb 20, 2025

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

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 20, 2025
@go-to-k go-to-k deleted the cf-grpc branch February 21, 2025 05:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(cloudfront): support gRPC config for distribution
3 participants