Skip to content

feat(cli): support notification-arns in cdk import#1740

Open
lemon0333 wants to merge 2 commits into
aws:mainfrom
lemon0333:feat/import-notification-arns
Open

feat(cli): support notification-arns in cdk import#1740
lemon0333 wants to merge 2 commits into
aws:mainfrom
lemon0333:feat/import-notification-arns

Conversation

@lemon0333

Copy link
Copy Markdown

Closes aws/aws-cdk#23548

Adds the --notification-arns option to cdk import, matching cdk deploy.

An import runs through the same CloudFormation change-set machinery as a deployment, and the deployment layer (Deployments.deployStack()) already supports notification ARNs — this change exposes the option on the import command and threads it through:

  • cli-config.ts: new notification-arns option on import (generated CLI argument files regenerated by the build)
  • CdkToolkit.import(): merges with the stack's notificationArns and validates each ARN, reusing the exact semantics of cdk deploy (undefined = keep existing / externally managed, [] = clear, ['arn'] = set)
  • toolkit-lib ImportDeploymentOptions: new optional notificationArns field, forwarded to deployStack()

Tests mirror the existing deploy notification-arns coverage: CLI argument forwarding, toolkit-level merge/validation, and NotificationARNs reaching the CreateChangeSet call.

Checklist

  • This change contains a major version upgrade for a dependency and I confirm all breaking changes are addressed (N/A)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

An import is executed through the same CloudFormation change-set
machinery as a deployment, and the deployment layer already supports
notification ARNs. This exposes the --notification-arns option on the
import command, merging and validating the ARNs with the same semantics
as cdk deploy before forwarding them to the change set.

Closes aws/aws-cdk#23548
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.09677% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.17%. Comparing base (a1c7075) to head (a1a8327).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
packages/aws-cdk/lib/cli/cdk-toolkit.ts 86.20% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1740      +/-   ##
==========================================
+ Coverage   89.57%   90.17%   +0.60%     
==========================================
  Files          78       78              
  Lines       11790    11821      +31     
  Branches     1655     1673      +18     
==========================================
+ Hits        10561    10660      +99     
+ Misses       1200     1130      -70     
- Partials       29       31       +2     
Flag Coverage Δ
suite.unit 90.17% <87.09%> (+0.60%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aws-cdk-automation
aws-cdk-automation added this pull request to the merge queue Jul 27, 2026
@mrgrain
mrgrain removed this pull request from the merge queue due to a manual request Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(cli): Support notification-arns in cdk import

3 participants