-
Notifications
You must be signed in to change notification settings - Fork 1k
cloudfront-apigw-rest-api-lambda-dynamodb-sam: Update runtime to nodejs22.x #2837
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
base: main
Are you sure you want to change the base?
cloudfront-apigw-rest-api-lambda-dynamodb-sam: Update runtime to nodejs22.x #2837
Conversation
…:WAFv2::WebACLAssociation
…odejs22.x runtime
const { DynamoDBClient } = require('@aws-sdk/client-dynamodb'); | ||
const { DynamoDBDocumentClient, PutCommand } = require('@aws-sdk/lib-dynamodb'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Some error occurs. Because in Node.js 18 and later runtimes, AWS SDK v3 is bundled, so I rewrote it to v3. See articles below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: The error occurred.
./deploy_frontend.sh
zsh: permission denied: ./deploy_frontend.sh
ResourceArn: !Sub arn:aws:apigateway:${AWS::Region}::/restapis/${API}/stages/dev | ||
WebACLArn: !GetAtt APIWebACL.Arn | ||
|
||
DependsOn: APIdevStage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: The error occurred.
CREATE_FAILED AWS::WAFv2::WebACLAssociation APIWAFAssociation Resource handler returned message: "AWS WAF
couldn?t perform the operation because your
resource doesn?t exist. (Service: Wafv2, Status
Code: 400, Request ID: 041ad0fb-
bad6-4a40-bce1-167f1218846f) (SDK Attempt
Count: 1)" (RequestToken:
acdc9901-b12e-7a14-f6c6-01eaa767eba3,
HandlerErrorCode: NotFound)
@@ -1,6 +1,6 @@ | |||
# Amazon Cloudfront distribution in front of Amazon S3 and an Amazon API Gateway REST API to AWS Lambda to Amazon DynamoDB | |||
# Amazon CloudFront distribution in front of Amazon S3 and an Amazon API Gateway REST API to AWS Lambda to Amazon DynamoDB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Fix to correct service name.
1. Create a new directory, navigate to that directory in a terminal and clone the GitHub repository: | ||
``` | ||
git clone https://gitlab.aws.dev/jrdwyer/aws-serverless-webform-sample.git | ||
git clone https://github.com/aws-samples/serverless-patterns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Fix to correct URL.
Issue #, if available:
N/A
Description of changes:
Hi😀 Thanks for the useful patterns!
To prevent future deployment issues, I updated the deprecated Lambda Node.js runtime
nodejs16.x
tonodejs22.x
.See https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
Check
sam deploy
completed successfully and works good.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.