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

Use the SDK V3 Style #794

Merged
merged 3 commits into from
Aug 18, 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
1 change: 1 addition & 0 deletions barcelona.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ environments:
command: rake jobs:work
cpu: 128
memory: 256

26 changes: 14 additions & 12 deletions schedule_handler.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
var AWS = require('aws-sdk');
const { ECSClient, RunTaskCommand } = require("@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)
exports.handler = async 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 @@ -17,11 +18,12 @@ exports.handler = function(input, context) {
}
]
}
}
};

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

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

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}))
})
}
console.log(util.inspect(response, {depth: null}));
};
Loading