Skip to content

fix(scheduler): scheduleName returns undefined when imported from ARN#36400

Merged
mergify[bot] merged 4 commits into
aws:mainfrom
mazyu36:fix-36361
Jan 20, 2026
Merged

fix(scheduler): scheduleName returns undefined when imported from ARN#36400
mergify[bot] merged 4 commits into
aws:mainfrom
mazyu36:fix-36361

Conversation

@mazyu36
Copy link
Copy Markdown
Contributor

@mazyu36 mazyu36 commented Dec 16, 2025

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


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 December 16, 2025 04:19
@github-actions github-actions Bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p1 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Dec 16, 2025
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

(This review is outdated)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 16, 2025

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 16, 2025

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

@mazyu36
Copy link
Copy Markdown
Contributor Author

mazyu36 commented Dec 16, 2025

Exemption Request: This change only fixes ARN parsing logic in a static import method and does not interact with AWS APIs. Unit tests fully cover the parsing logic and error handling.

@aws-cdk-automation aws-cdk-automation added pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. pr/needs-maintainer-review This PR needs a review from a Core Team Member labels Dec 16, 2025
@Abogical Abogical self-assigned this Jan 5, 2026
*/
public static fromScheduleArn(scope: Construct, id: string, scheduleArn: string): ISchedule {
// Format: arn:aws:scheduler:region:account:schedule/SCHEDULE-GROUP/SCHEDULE-NAME
const arnComponents = Arn.split(scheduleArn, ArnFormat.NO_RESOURCE_NAME);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No reason to change the ArnFormat for splitting. We can use it to parse the resource path directly.

Suggested change
const arnComponents = Arn.split(scheduleArn, ArnFormat.NO_RESOURCE_NAME);
const arnComponents = Arn.split(scheduleArn, ArnFormat.SLASH_RESOURCE_NAME);

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 5, 2026
@Abogical Abogical added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Jan 5, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 5, 2026 13:38

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@mergify mergify Bot dismissed Abogical’s stale review January 20, 2026 02:29

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 20, 2026
@mazyu36
Copy link
Copy Markdown
Contributor Author

mazyu36 commented Jan 20, 2026

@Abogical
Sorry for the delay. Thanks for the review, I've addressed it.

@mazyu36 mazyu36 requested a review from Abogical January 20, 2026 03:45
Copy link
Copy Markdown
Member

@Abogical Abogical left a comment

Choose a reason for hiding this comment

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

Thank you!

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 20, 2026

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 752bd9b into aws:main Jan 20, 2026
20 of 21 checks passed
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 20, 2026

Merge Queue Status

✅ The pull request has been merged at 128ed05

This pull request spent 6 seconds in the queue, with no time running CI.
The checks were run in-place.

Required conditions to merge

@github-actions
Copy link
Copy Markdown
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 Jan 20, 2026
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug This issue is a bug. distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/small Small work item – less than a day of effort p1 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws_scheduler: scheduleName returns undefined

3 participants