aws / aws/aws-cdk-cli

(hotswap): Support for skipping resources in hotswap

Open
#895 9 comments 0 reactions 0 assignees View on GitHub
aws-cdk effort/medium feature-request p2
Dominant language
TypeScript
Stars
105
Forks
122
Avg merge
1d 17h
Merged PRs (30d)
71

Description

### Maintainer's note

We are not planning to force this feature into the existing CloudFormation deployment system. However it is a perfectly fine addition to the [hotswap](https://docs.aws.amazon.com/cdk/v2/guide/cli.html#:~:text=developing%20your%20infrastructure.-,Hot%20swapping,-Use%20the%20%2D%2Dhotswap) development feature.

Treating this as a hotswap feature request.

---

### Describe the feature

I'd like to see a CDK equivalent of [this Pulumi feature](https://www.pulumi.com/blog/excluding-targets-from-stack-operations/).

### Use Case

When managing both infrastructure and application code within the same stack and deploying through a single pipeline, certain challenges arise. For example, consider a monorepo where the CDK code is stored in a `/cdk` folder and the application code in a `/app` folder. If a developer modifies only the `/app` folder, the pipeline still triggers a `cdk diff` command. What's needed is a way to exclude all resources except for:

* `AWS::Lambda::Function`
* `Custom::CDKBucketDeployment`

This would allow developers to make application changes without affecting unrelated parts of the infrastructure. It also relieves them from the responsibility of managing infrastructure code directly. Even if configuration drift occurs in other resources, the deployment would only act on the whitelisted resources and ignore the rest. In a separate pipeline, the platform team could then run a full `cdk diff` and `cdk deploy` to reconcile and apply changes across the entire stack.

### Proposed Solution

_No response_

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.1029.3

### Environment details (OS name and version, etc.)

Ubuntu 24.04

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.