Skip to content

feat: support glob patterns for -s stack name filtering#621

Merged
go-to-k merged 2 commits intomainfrom
cdk-glob
Mar 30, 2026
Merged

feat: support glob patterns for -s stack name filtering#621
go-to-k merged 2 commits intomainfrom
cdk-glob

Conversation

@go-to-k
Copy link
Copy Markdown
Owner

@go-to-k go-to-k commented Mar 30, 2026

Summary

  • Support glob patterns (*, ?, [...]) for the -s/--stackName option in the cdk subcommand
  • Refactor CdkAction into focused components: CdkStackSelector (pattern matching), CdkStackResolver (region resolution + AWS existence check), IStackExistenceChecker (DI interface), keeping CdkAction as a pure orchestrator
  • Add cdk_glob e2e test with top-level stacks and Stage-nested stacks to verify glob-based partial deletion

Glob matching behavior

  • Patterns containing glob characters (*, ?, [) are matched using path.Match
  • Patterns without glob characters are matched exactly (unchanged behavior)
  • Unmatched exact names produce an error; glob patterns matching nothing do not

…mand

Add glob pattern matching (*, ?, [...]) for the -s/--stackName option
in the cdk subcommand. Patterns without glob characters are matched
exactly as before. Glob patterns that match nothing are not treated
as errors, while exact names not found still produce errors.

Refactor CdkAction to separate concerns:
- CdkStackSelector: pattern/interactive stack selection (pure logic)
- CdkStackResolver: region resolution, selection, AWS existence check
- CdkAction: orchestration only (synth, parse, resolve, confirm, delete)
- IStackExistenceChecker: interface for AWS stack existence verification

Add e2e test (cdk_glob) with top-level stacks and Stage to verify
glob-based partial deletion.
@go-to-k go-to-k merged commit cfcd5b6 into main Mar 30, 2026
5 checks passed
@go-to-k go-to-k deleted the cdk-glob branch March 30, 2026 17:55
@github-actions github-actions bot mentioned this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant