2

I have a small python piece of code that I want to run on a schedule. The dirty way to do it would be to just spin up an EC2 instance and use CRON to run the script.

But I was wondering if there's a better (cleaner) way to do this

Also I was wondering how to do the same but on Google Cloud as well as AWS

1

1 Answer 1

3

AWS Lambda should be an obvious choice together with a a CloudWatch Event trigger https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/RunLambdaSchedule.html .

Running an EC2 instance may be reasonable in some scenarios as well. It would make sense for me if the trigger for example did some complex data manipulation on a reasonable small data set (fitting in memory on a bigger spot multi-core instance or something like that).

Running a Fargate task - may be reasonable as well.

If it is something close to the gcloud example I would go with Lambda + CloudWatch Event. All of this can be easily defined via CloudFormation template .

2
  • GCP's answer to Lambda is Cloud Functions. You find find them in the console under "Serverless"
    – code_monk
    Dec 16, 2021 at 18:16
  • you can utilize, kubernetes jobs as well. Dec 19, 2021 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.