Commit ca9fbdd
fix(scheduler): wrong ARN generated in
The `ScheduleGroup.grant*()` methods are delegating to the methods in the auto-generated `ScheduleGroupGrants` class. This class is generating policies with an incorrect ARN. Instead of:
```
arn:aws:scheduler:<region>:xxx:schedule/my-group-name/*
```
it is generating:
```
arn:aws:scheduler:<region>:xxx:schedule-group/my-group-name/*
```
Since the code generation mechanism doesn't provide any way of specifying a custom logic for the ARN generation, replace the auto-generated `ScheduleGroupGrants` with hand-written one, in which the ARN is computed by:
```ts
private arnForScheduleInGroup(scheduleName: string): string {
return Arn.format({
region: this.resource.env.region,
account: this.resource.env.account,
partition: Aws.PARTITION,
service: 'scheduler',
resource: 'schedule',
resourceName: this.resource.scheduleGroupRef.scheduleGroupName + '/' + scheduleName,
});
}
```
Fixes #36165.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*ScheduleGroup.grant* methods (#36175)1 parent 1379fd1 commit ca9fbdd
File tree
5 files changed
+93
-76
lines changed- packages/aws-cdk-lib/aws-scheduler
- lib
- test
5 files changed
+93
-76
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| 7 | + | |
Lines changed: 81 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | 263 | | |
275 | 264 | | |
276 | 265 | | |
277 | 266 | | |
278 | 267 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | 268 | | |
285 | 269 | | |
286 | 270 | | |
287 | 271 | | |
288 | 272 | | |
289 | 273 | | |
290 | 274 | | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | 275 | | |
297 | 276 | | |
298 | 277 | | |
299 | 278 | | |
300 | 279 | | |
301 | 280 | | |
302 | 281 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | 282 | | |
309 | 283 | | |
310 | 284 | | |
| |||
Lines changed: 10 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
188 | 189 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 190 | + | |
193 | 191 | | |
194 | | - | |
| 192 | + | |
195 | 193 | | |
196 | 194 | | |
197 | 195 | | |
| |||
228 | 226 | | |
229 | 227 | | |
230 | 228 | | |
| 229 | + | |
231 | 230 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
| 231 | + | |
236 | 232 | | |
237 | | - | |
| 233 | + | |
238 | 234 | | |
239 | 235 | | |
240 | 236 | | |
| |||
258 | 254 | | |
259 | 255 | | |
260 | 256 | | |
261 | | - | |
262 | | - | |
| 257 | + | |
263 | 258 | | |
264 | 259 | | |
265 | 260 | | |
| |||
269 | 264 | | |
270 | 265 | | |
271 | 266 | | |
| 267 | + | |
272 | 268 | | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
| 269 | + | |
277 | 270 | | |
278 | | - | |
| 271 | + | |
279 | 272 | | |
280 | 273 | | |
281 | 274 | | |
| |||
0 commit comments