Skip to content

feat: Add error annotation when a deprecated lambda runtime is used#1007

Merged
akash1810 merged 1 commit intomainfrom
aa-deprecated-lambda-runtime
Dec 23, 2021
Merged

feat: Add error annotation when a deprecated lambda runtime is used#1007
akash1810 merged 1 commit intomainfrom
aa-deprecated-lambda-runtime

Conversation

@akash1810
Copy link
Copy Markdown
Member

What does this change?

We should never use a deprecated or non-LTS runtime for lambdas. In this change, we add an error annotation to this effect.

Note: the annotation does not prevent the stack from being synthesised, to do this, we'd want to throw. I'm not sure if that's desirable behaviour atm though?

How to test

See added tests.

How can we measure success?

We are discouraged from using deprecated or non-LTS lambda runtimes.

Have we considered potential risks?

We have to maintain the DEPRECATED_RUNTIMES list.

Checklist

  • I have listed any breaking changes, along with a migration path 1
  • I have updated the documentation as required for the described changes 2

Footnotes

  1. Consider whether this is something that will mean changes to projects that have already been migrated, or to the CDK CLI tool. If changes are required, consider adding a checklist here and/or linking to related PRs.

  2. If you are adding a new construct or pattern, has new documentation been added? If you are amending defaults or changing behaviour, are the existing docs still valid?

@akash1810 akash1810 requested a review from a team December 23, 2021 14:18
@akash1810
Copy link
Copy Markdown
Member Author

Raised this as a way to test #1006 hasn't negatively impacted the release process.

Runtime.NODEJS_6_10,
Runtime.NODEJS_8_10,
Runtime.NODEJS_10_X,
Runtime.NODEJS_12_X,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, this version becomes EOL on 2022-04-30 - do we want to deprecate it before then?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I thought it was already deprecated! I think it's fine to do so before then as:

  • We're not blocking the synth step
  • It acts as a reminder to update before the deadline
  • There aren't too many lambdas defined using GuCDK today (and 0 using this version of the library)

@jacobwinch
Copy link
Copy Markdown
Contributor

Note: the annotation does not prevent the stack from being synthesised, to do this, we'd want to throw. I'm not sure if that's desirable behaviour atm though?

I guess this is something that we (or the Security team) might want to consider in the future but I think it's better to start with this less disruptive approach.

@akash1810 akash1810 merged commit c587cca into main Dec 23, 2021
@akash1810 akash1810 deleted the aa-deprecated-lambda-runtime branch December 23, 2021 15:01
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 32.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

akash1810 added a commit that referenced this pull request Aug 18, 2022
Since it was originally introduced in #1007,
AWS CDK has added native deprecation annotations to runtimes in aws/aws-cdk#19938 AWS CDK.

The means we can remove some code!
akash1810 added a commit that referenced this pull request Aug 18, 2022
Since it was originally introduced in #1007,
AWS CDK has added native deprecation annotations to runtimes in aws/aws-cdk#19938.

The means we can remove some code!
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.

2 participants