Skip to content

cli: better indicate why a deployment couldn't be hotswapped #22784

Closed
@echeung-amzn

Description

@echeung-amzn

Describe the feature

When attempting a hotswap deployment, it can fail to do so and fallback to a full deployment with a message like:

Could not perform a hotswap deployment, as the stack <YourStackName> contains non-Asset changes
Falling back to doing a full deployment

However, it does not actually indicate what the non-Asset changes are that are preventing a hotswap deployment from working. It can be quite challenging to grok through a stack to narrow down what the issue is.

Since there's already logic to find the non-hotswappable changes, it'd be nice if the CLI either outputted the list of resource by default, or behind a flag.

Use Case

I'd love to use a hotswap deployment to save time when testing changes in a Lambda function's code assets. Having it fallback to full deployments every time introduces a frustrating amount of churn in the development cycle.

Proposed Solution

Perhaps behind a verbose logging flag, be able to list out the non-hotswappable changes when a hotswap deployment is attempted but fails.

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.46.0

Environment details (OS name and version, etc.)

macOS 12.6 but not relevant

Activity

peterwoodworth

peterwoodworth commented on Nov 4, 2022

@peterwoodworth
Contributor

We will throw this when we detect a change in the template that is one of

  1. the removal or addition of a resource to the template
  2. a resource had its type changed

If you encounter this error and then run cdk diff you should be able to find one of these quickly. But you're not wrong that we could be printing this information anyway.

I am marking this issue as p2, which means that we are unable to work on this immediately.

We use +1s to help prioritize our work, and are happy to revaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization.

Check out our contributing guide if you're interested in contributing yourself - there's a low chance the team will be able to address this soon but we'd be happy to review a PR 🙂

added
effort/smallSmall work item – less than a day of effort
and removed
needs-triageThis issue or PR still needs to be triaged.
on Nov 4, 2022
assigned and unassigned on Jan 5, 2023
rix0rrr

rix0rrr commented on Jan 5, 2023

@rix0rrr
Contributor

@comcalvi is working on something that may also address this, assigning and cc'ing for visibility.

added a commit that references this issue on Feb 8, 2023
a5317ca
github-actions

github-actions commented on Feb 8, 2023

@github-actions
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

effort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p2package/toolsRelated to AWS CDK Tools or CLI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @rix0rrr@peterwoodworth@comcalvi@echeung-amzn

    Issue actions

      cli: better indicate why a deployment couldn't be hotswapped · Issue #22784 · aws/aws-cdk