(cdk): can't use hotswap when Custom::AWS is present in template
- Dominant language
- TypeScript
- Stars
- 105
- Forks
- 122
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 71
Description
### Describe the bug
`Could not perform a hotswap deployment, because the CloudFormation template could not be resolved: We don't support attributes of the 'Custom::AWS' resource. This is a CDK limitation. Please report it at https://github.com/aws/aws-cdk/issues/new/choose`.
The template i have does contain a Custom::AWS resource but cdk diff does not detect any changes to it.
```
[~] AWS::CloudFormation::Stack a.NestedStack/a.NestedStackResource aNaNREEA7D805
└─ [~] TemplateURL
└─ [~] .Fn::Join:
└─ @@ -5,6 +5,6 @@
[ ] {
[ ] "Ref": "AWS::URLSuffix"
[ ] },
[-] "/cdk-hnb659fds-assets--/.json"
[+] "/cdk-hnb659fds-assets--/.json"
[ ] ]
[ ] ]
Stack stack-bNbNRE1B71636-1XZCJ7DPIISJG
There were no differences
Stack stack-aNaNREEA7D805-VZ5MPHGEVZF3
Resources
[~] AWS::Lambda::Function a/fn fn588520B7
├─ [~] Code
│ └─ [~] .S3Key:
│ ├─ [-].zip
│ └─ [+] .zip
└─ [~] Metadata
└─ [~] .aws:asset:path:
├─ [-] asset.
└─ [+] asset.
```
### Regression Issue
- [ ] Select this option if this issue appears to be a regression.
### Last Known Working CDK Library Version
_No response_
### Expected Behavior
If possible it should be possible for this check to be bypassed.
### Current Behavior
`Could not perform a hotswap deployment, because the CloudFormation template could not be resolved: We don't support attributes of the 'Custom::AWS' resource. This is a CDK limitation. Please report it at https://github.com/aws/aws-cdk/issues/new/choose`.
### Reproduction Steps
Create a simple stack with an AwsCustomResource and a lambda function. Update code in lambda function and attempt to deploy with --hotswap.
### Possible Solution
_No response_
### Additional Information/Context
_No response_
### AWS CDK Library version (aws-cdk-lib)
2.218.0
### AWS CDK CLI version
2.1031.0 (build 3d7b09b)
### Node.js Version
v22.18.0
### OS
MacOS 26
### Language
TypeScript
### Language Version
_No response_
### Other information
_No response_
Contributor guide
Research direction
Start with the --hotswap deployment path that resolves the CloudFormation template, using the reported reproduction: a stack with AwsCustomResource and a Lambda function whose code changes. Verify the behavior when Custom::AWS is present but unchanged, and consider the issue's expected outcome: allowing the hotswap check to be bypassed or proceed safely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cli, cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100