Skip to content
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

chore: Update integration test file to use nodejs18 #3332

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
return {
Expand Down Expand Up @@ -45,7 +45,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
console.log(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Resources:
InlineCode: |
print("hello")
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
Events:
API3:
Type: Api
Expand All @@ -50,7 +50,7 @@ Resources:
InlineCode: |
print("hello")
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
Events:
MyApiWithAwsIamAuth:
Type: Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
return {
Expand Down Expand Up @@ -101,7 +101,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
const token = event.type === 'TOKEN' ? event.authorizationToken : event.queryStringParameters.authorization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
return {
Expand Down Expand Up @@ -114,7 +114,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
const token = event.type === 'TOKEN' ? event.authorizationToken : event.queryStringParameters.authorization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
return {
Expand Down Expand Up @@ -80,7 +80,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
const token = event.type === 'TOKEN' ? event.authorizationToken : event.queryStringParameters.authorization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
CodeUri:
Bucket:
Ref: Bucket
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
CodeUri: ${codeuri}
MemorySize: 128

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Resources:
body: JSON.stringify({ message: "Hello, SAM!" }),
}
}
Runtime: nodejs16.x
Runtime: nodejs18.x

ApiGatewayLambdaRole:
Type: AWS::IAM::Role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
CodeUri: ${codeuri}
MemorySize: 128

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
CodeUri: ${codeuri}
MemorySize: 128

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
CodeUri: ${codeuri}
MemorySize: 128

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
CodeUri: ${codeuri}
MemorySize: 128

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
CodeUri: ${codeuri}
MemorySize: 128

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Resources:
return response;
};
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
Events:
Fetch:
Type: Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Resources:
return response;
};
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
Events:
ImplicitGet:
Type: Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Resources:
return response;
};
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
Events:
ImplicitGet:
Type: Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Resources:
return response;
};
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
Events:
Iam:
Type: Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Resources:
return response;
};
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
Events:
Iam:
Type: Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Resources:
return response;
};
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
Events:
Iam:
Type: Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
InlineCode: |
exports.handler = async (event, context, callback) => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Resources:
});
}
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
Events:
GetHtml:
Type: Api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
CodeUri: ${codeuri}
MemorySize: 128

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Resources:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x
CodeUri: ${codeuri}
Events:
Api:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Resources:
}
}
PackageType: Zip
Runtime: nodejs16.x
Runtime: nodejs18.x
Handler: index.handler

TriggerFunction:
Expand All @@ -97,7 +97,7 @@ Resources:
Environment:
Variables:
GRAPHQL_URL: !GetAtt Api.GraphQLUrl
Runtime: nodejs16.x
Runtime: nodejs18.x
Handler: index.handler
InlineCode: |
const https = require("https");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Resources:
return "Hello World"
}
Handler: index.handler
Runtime: nodejs16.x
Runtime: nodejs18.x

AppSyncApi:
Type: AWS::AppSync::GraphQLApi
Expand Down Expand Up @@ -88,7 +88,7 @@ Resources:
Variables:
API_KEY: !GetAtt ApiKey.ApiKey
GRAPHQL_URL: !GetAtt AppSyncApi.GraphQLUrl
Runtime: nodejs16.x
Runtime: nodejs18.x
Handler: index.handler
InlineCode: |
const https = require("https");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Resources:
Variables:
API_KEY: !GetAtt ApiKey.ApiKey
GRAPHQL_URL: !GetAtt AppSyncApi.GraphQLUrl
Runtime: nodejs16.x
Runtime: nodejs18.x
Handler: index.handler
InlineCode: |
const https = require("https");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,29 @@ Resources:
TriggerFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: nodejs16.x
Runtime: nodejs18.x
Handler: index.handler
Timeout: 10 # in case eb has delay
InlineCode: |
const AWS = require('aws-sdk');
const {
S3
} = require("@aws-sdk/client-s3"),
{
SQS
} = require("@aws-sdk/client-sqs");
exports.handler = async (event) => {
var params = {
Bucket: process.env.BUCKET_NAME,
Key: "MyKey",
Body: JSON.stringify("Test Message")
};
var s3 = new AWS.S3();
await s3.putObject(params).promise();
var s3 = new S3();
await s3.putObject(params);

const data = await new AWS.SQS().receiveMessage({
const data = await new SQS().receiveMessage({
QueueUrl: process.env.VERIFICATION_QUEUE_URL,
WaitTimeSeconds: 5,
}).promise();
});
if (data.Messages.length == 0) {
throw 'No messages in the queue!';
}
Expand All @@ -42,16 +47,18 @@ Resources:
InvokedFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: nodejs16.x
Runtime: nodejs18.x
Handler: index.handler
InlineCode: |
const AWS = require('aws-sdk');
const {
SQS
} = require("@aws-sdk/client-sqs");
exports.handler = async (event) => {
const sqs = new AWS.SQS();
const sqs = new SQS();
await sqs.sendMessage({
QueueUrl: process.env.VERIFICATION_QUEUE_URL,
MessageBody: "test"
}).promise();
});
};
Environment:
Variables:
Expand Down
Loading