It would certainly be possible - we have examples that are along these lines - though Fargate launch times can be slow (10s of seconds to minute) which may make this not ideal cost and performance-wise.
https://github.com/pulumi/examples/tree/master/cloud-js-thumbnailer is an example of spawning a Fargate task inside a lambda. You should be able to make an aws-SDK CloudWatch call inside the lambda to get Logs as well.
m
microscopic-florist-85263
09/24/2018, 3:05 AM
Ah thanks!!
microscopic-florist-85263
09/24/2018, 3:20 AM
@white-balloon-205 I see this as a pulumi lambda example:
Copy code
const cloud = require("@pulumi/cloud-aws");
const api = new cloud.API("aws-hellolambda-js");
api.get("/js", (req, res) => {
res.status(200).json("Hi from Javascript lambda");
});
exports.endpointJs = api.publish().url;
Would I be able to import aws-sdk and do an cloudwatch call within the
api.get
callback function?
Or do I need to put lambda specific code somewhere else?
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.