Skip to content

Why are changes to a Lambda Function code not considered an update? #161

Description

@dashmug

I encountered the following where code for a Lambda Function was updated. cdk diff shows the diff correctly but the summary created by this action is incorrect, "0 to add, 0 to update, 0 to destroy".

Image

I checked out the code to see if I can fix it and submit a PR but then I found out that it is intentional.

In src/diff.ts#L117,

const resourceType = change.oldValue?.Type ?? change.newValue?.Type;
switch (resourceType) {
  case 'AWS::CDK::Metadata':
    return;
  case 'AWS::Lambda::Function':
    const keys = Object.keys(change.propertyUpdates);
    if (
      (keys.length <= 2 && keys.includes('Code')) ||
      keys.includes('Metadata')
    ) {
      return;
    }
}

Any reason why we drift from cdk diff's result? If it's 0 to add, 0 to update, 0 to destroy, I expect it to be a no-op CDK deploy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions