Skip to content

eventbridge-sns-lambda-terraform: Update runtime to nodejs22.x #2816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kakakakakku
Copy link
Contributor

Issue #, if available:
N/A

Description of changes:
Hi😀 Thanks for the useful patterns!

To prevent future deployment issues, I updated the Lambda Node.js runtime version to nodejs22.x.

While testing eventbridge-sns-lambda-terraform, I noticed that the Lambda runtime version nodejs16.x was deprecated. Although it's still deployable at the moment, it will not be allowed after October 1, 2025.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

Check

terraform apply completed successfully and works good.

$ aws events put-events --entries file://event.json --region us-east-1
{
    "FailedEntryCount": 0,
    "Entries": [
        {
            "EventId": "79beda9e-c873-ace9-1fa9-2d315bab2801"
        }
    ]
}
image

Thank you😀


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -2,11 +2,7 @@
* SPDX-License-Identifier: MIT-0
*/

const AWS = require('aws-sdk')
AWS.config.region = process.env.AWS_REGION
const sns = new AWS.SNS({apiVersion: '2012-11-05'})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: I removed this because it wasn’t used.

@@ -6,7 +6,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
version = "~> 5.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: Older version does not support Node.js 22 runtime. So I updated the version to v5.

resource "aws_iam_role_policy_attachment" "lambda_basic_execution" {
role = aws_iam_role.lambda_iam_role.name
policy_arn = data.aws_iam_policy.lambda_basic_execution_role_policy.arn
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note: The managed_policy_arns argument is already deprecated. I update code correctly😀 See document below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants