Commit 752bd9b
authored
fix(scheduler): scheduleName returns undefined when imported from ARN (#36400)
### Issue # (if applicable)
Closes #36361.
### Reason for this change
When importing a schedule using `Schedule.fromScheduleArn()`, the `scheduleName` property returns `undefined` instead of the actual schedule name.
### Description of changes
Fixed the ARN parsing logic in `Schedule.fromScheduleArn()` to correctly extract the schedule name from the resource path. AWS Scheduler ARNs have the format `arn:aws:scheduler:region:account:schedule/GROUP/NAME`, and the previous implementation only captured the group name.
### Describe any new or updated permissions being added
No new or updated permissions.
### Description of how you validated changes
Added unit tests to verify correct parsing and error handling.
### 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 3485d53 commit 752bd9b
File tree
2 files changed
+36
-1
lines changed- packages/aws-cdk-lib/aws-scheduler
- lib
- test
2 files changed
+36
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
258 | 267 | | |
259 | 268 | | |
260 | | - | |
| 269 | + | |
261 | 270 | | |
262 | 271 | | |
263 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 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 | + | |
263 | 289 | | |
0 commit comments