Skip to content

Commit

Permalink
use the sdk v3 styl
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsiaw committed Aug 18, 2023
1 parent f1ae5c9 commit 5317fa4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions schedule_handler.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
var AWS = require('aws-sdk');
import { ECSClient, RunTaskCommand } from "@aws-sdk/client-ecs";

var util = require('util');

exports.handler = function(input, context) {
console.log(util.inspect(input, {showHidden: false, depth: null}))
console.log(context)

var ecs = new AWS.ECS();
var ecs = new ECSClient();
var params = {
cluster: input.cluster,
taskDefinition: input.task_family,
Expand All @@ -20,8 +21,9 @@ exports.handler = function(input, context) {
}

console.log(util.inspect(params, {depth: null}))
ecs.runTask(params, function(err, data) {
console.log(util.inspect(err, {depth: null}))
console.log(util.inspect(data, {depth: null}))
})

const command = new RunTaskCommand(params);
const response = await ecs.send(command);

console.log(util.inspect(response, {depth: null}))
}

0 comments on commit 5317fa4

Please sign in to comment.