Commit 1d56b46
authored
fix(mediapackagev2): cdnAuth on OriginEndpoint now generates the required policy (#38013)
### Issue # (if applicable)
Closes #<issue number here>.
### 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
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*1 parent 1798f73 commit 1d56b46
14 files changed
Lines changed: 580 additions & 125 deletions
File tree
- packages/@aws-cdk/aws-mediapackagev2-alpha
- lib
- test
- integ.mediapackagev2-endpoint-cdn-auth.js.snapshot
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
246 | 290 | | |
247 | 291 | | |
248 | 292 | | |
| |||
Lines changed: 0 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 27 | | |
40 | 28 | | |
41 | 29 | | |
| |||
66 | 54 | | |
67 | 55 | | |
68 | 56 | | |
69 | | - | |
70 | 57 | | |
71 | 58 | | |
72 | 59 | | |
| |||
78 | 65 | | |
79 | 66 | | |
80 | 67 | | |
81 | | - | |
82 | 68 | | |
83 | 69 | | |
84 | 70 | | |
| |||
116 | 102 | | |
117 | 103 | | |
118 | 104 | | |
119 | | - | |
120 | 105 | | |
121 | 106 | | |
122 | 107 | | |
| |||
Lines changed: 65 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
1054 | 1055 | | |
1055 | 1056 | | |
1056 | 1057 | | |
1057 | | - | |
1058 | 1058 | | |
1059 | | - | |
| 1059 | + | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | 1062 | | |
| |||
1829 | 1829 | | |
1830 | 1830 | | |
1831 | 1831 | | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
1832 | 1861 | | |
1833 | 1862 | | |
1834 | 1863 | | |
| |||
2653 | 2682 | | |
2654 | 2683 | | |
2655 | 2684 | | |
| 2685 | + | |
2656 | 2686 | | |
2657 | | - | |
2658 | | - | |
2659 | | - | |
2660 | | - | |
2661 | | - | |
2662 | | - | |
2663 | | - | |
2664 | | - | |
2665 | | - | |
2666 | | - | |
2667 | | - | |
| 2687 | + | |
2668 | 2688 | | |
2669 | 2689 | | |
2670 | 2690 | | |
2671 | 2691 | | |
2672 | | - | |
2673 | | - | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
2674 | 2696 | | |
2675 | 2697 | | |
2676 | | - | |
2677 | | - | |
2678 | | - | |
2679 | | - | |
2680 | | - | |
2681 | | - | |
2682 | | - | |
2683 | | - | |
2684 | | - | |
2685 | | - | |
| 2698 | + | |
| 2699 | + | |
2686 | 2700 | | |
2687 | 2701 | | |
2688 | 2702 | | |
| |||
3012 | 3026 | | |
3013 | 3027 | | |
3014 | 3028 | | |
3015 | | - | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
3016 | 3033 | | |
3017 | | - | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
3018 | 3055 | | |
3019 | 3056 | | |
3020 | 3057 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
Lines changed: 37 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
246 | 248 | | |
247 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
248 | 253 | | |
249 | 254 | | |
250 | | - | |
251 | | - | |
252 | 255 | | |
253 | 256 | | |
254 | 257 | | |
255 | 258 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
266 | 265 | | |
267 | 266 | | |
268 | 267 | | |
269 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
270 | 300 | | |
271 | 301 | | |
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments