Skip to content

Conversation

badmintoncryer
Copy link
Contributor

Issue # (if applicable)

None

Reason for this change

AWS Cloudfront supports for configuring response completion timeout.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DownloadDistValuesOrigin.html#response-completion-timeout

Description of changes

Core Implementation

  • Added responseCompletionTimeout: Duration to OriginOptions interface
  • Added validation in OriginBase for 1-3600 seconds range
  • Updated bind() method to include property in CloudFormation output

Origin Classes

  • HttpOrigin & FunctionUrlOrigin: Added validation to ensure responseCompletionTimeout >= readTimeout
  • RestApiOrigin & LoadBalancerV2Origin: Inherit validation through HttpOrigin

Describe any new or updated permissions being added

None

Description of how you validated changes

Add 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 September 14, 2025 14:34
@github-actions github-actions bot added p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Sep 14, 2025
@badmintoncryer badmintoncryer marked this pull request as ready for review September 14, 2025 15:57
@badmintoncryer badmintoncryer changed the title feat(cloudfront-origins): response completion timeout feat(cloudfront-origins): support for response completion timeout Sep 15, 2025
@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 Sep 15, 2025
@badmintoncryer badmintoncryer changed the title feat(cloudfront-origins): support for response completion timeout feat(cloudfront-origins): response completion timeout Sep 15, 2025
@alvazjor alvazjor self-assigned this Sep 15, 2025
const responseCompletionSec = responseCompletionTimeout.toSeconds();
const readTimeoutSec = readTimeout.toSeconds();

if (responseCompletionSec < readTimeoutSec) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It is probably very unlikely, but possible, that either responseCompletionTimeout and/or readTimeout is a Token, so this validation should consider that edge case. Feel free to use either !Token.isResolved() or withResolved() approach to run or skip the validation.

withResolved(responseCompletionTimeout, readTimeout, () => {
  // Validation
});

OR

if (!Token.isUnresolved(responseCompletionTimeout) && !Token.isUnresolved(readTimeout)) {
  // Validation
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are absolutely right!! Thanks.

@alvazjor
Copy link
Contributor

@badmintoncryer added one comment, other than that, the PR looks good to me. Will be approved once the changes are done.

@mergify mergify bot dismissed alvazjor’s stale review September 17, 2025 14:59

Pull request has been modified.

@badmintoncryer
Copy link
Contributor Author

@alvazjor Thank you for your review!! I've updated my implementation.

Copy link
Contributor

mergify bot commented Sep 17, 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).

@mergify mergify bot merged commit 7d70bf4 into aws:main Sep 17, 2025
23 checks passed
Copy link
Contributor

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 Sep 17, 2025
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Sep 17, 2025
@badmintoncryer badmintoncryer deleted the origin branch September 17, 2025 23:32
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 p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants