Skip to content

sdk-v3: Remove v2 lambda client #787

New issue

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

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

Already on GitHub? # to your account

Merged
Merged
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
11 changes: 3 additions & 8 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -971,22 +971,17 @@ they may not work as expected in the Lambda environment.
}
console.log(params)

// Migrating to v3.
const lambda = new aws.sdk.Lambda({
region,
apiVersion: '2015-03-31'
})
const lambdaClient = new LambdaClient({ region })

// Migrating to v3.
const scheduleEvents = new ScheduleEvents(aws.sdk, region)
const s3Events = new S3Events(aws.sdk, region)
const cloudWatchLogs = new CloudWatchLogs(aws.sdk, region)

const existsFunction = await (async () => {
try {
await lambda.getFunction({
await lambdaClient.send(new GetFunctionCommand({
FunctionName: params.FunctionName
}).promise()
}))
return true
} catch (err) {
if (!this._isFunctionDoesNotExist(err)) {
Expand Down
Loading