Skip to content

fix(mediapackagev2): cdnAuth on OriginEndpoint now generates the required policy#38013

Open
jamiepmullan wants to merge 2 commits into
aws:mainfrom
jamiepmullan:fix/mediapackagev2-cdn-auth-policy
Open

fix(mediapackagev2): cdnAuth on OriginEndpoint now generates the required policy#38013
jamiepmullan wants to merge 2 commits into
aws:mainfrom
jamiepmullan:fix/mediapackagev2-cdn-auth-policy

Conversation

@jamiepmullan
Copy link
Copy Markdown
Contributor

@jamiepmullan jamiepmullan commented May 27, 2026

Issue # (if applicable)

Closes #.

Reason for this change

Description of changes

Setting cdnAuth on OriginEndpoint previously stored the configuration but
did not by itself produce a working endpoint policy — the
CdnAuthConfiguration block on OriginEndpointPolicy is non-functional
without an accompanying gating policy statement that requires the matching
mediapackagev2:RequestHasMatchingCdnAuthHeader condition. Per the AWS docs
[1], both the gating statement and the configuration block are required.

This change:

  • Auto-emits the AWS-documented gating policy statement when cdnAuth is set
    on OriginEndpointProps. The resulting OriginEndpointPolicy now contains
    both the gating statement and the CdnAuthConfiguration block.
  • Drops the optional cdnAuth second argument from addToResourcePolicy(...)
    on IOriginEndpoint — the field had no clean home there and only the first
    call ever applied. CDN auth now lives only on the endpoint props.
  • Drops the cdnAuth prop on MediaPackageV2OriginProps for the same
    reason — set cdnAuth on the OriginEndpoint directly.
  • Adds an integ test that deploys the full pipeline.
  • Updates the README to document the new pattern, including the JSON shape
    the secret must use (MediaPackageV2CDNIdentifier key).

[1] https://docs.aws.amazon.com/mediapackage/latest/userguide/cdn-auth-setup.html

BREAKING CHANGE: OriginEndpoint.addToResourcePolicy() no longer accepts an
optional cdnAuth second argument. MediaPackageV2OriginProps.cdnAuth has
been removed. Set cdnAuth on OriginEndpointProps instead.

Describe any new or updated permissions being added

Description of how you validated changes

Checklist


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

@github-actions github-actions Bot added the p2 label May 27, 2026
@github-actions github-actions Bot added the valued-contributor [Pilot] contributed between 6-12 PRs to the CDK label May 27, 2026
@jamiepmullan jamiepmullan marked this pull request as ready for review May 27, 2026 13:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

👋 It looks like your PR description follows the template but is missing a valid issue number in the first section.

PRs without a linked issue will receive lower priority for review and merging. Please update the description to include a reference like Closes #123. If no existing issue matches your change, create one first.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.
To suppress a specific rule, see Suppressing Rules.


TestsPassed ❌️SkippedFailed
Security Guardian Results
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.
To suppress a specific rule, see Suppressing Rules.


TestsPassed ❌️SkippedFailed
Security Guardian Results with resolved templates
TestResult
No test annotations available

@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 May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. valued-contributor [Pilot] contributed between 6-12 PRs to the CDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants