I have deployed an AWS Lambda with Python 3.6 and CloudFormation executing a scheduled task which writes a JSON file once a minute to an S3 bucket. Now I wonder if this is a good way of doing it, or if an automation tool such as Ansible would be better suited for the task?

The background is that I am developing a PoC for data analysis.


CloudFormation is service that allows you to create your infrastructure from code to automate your deployments.

You can set up a rule to run an AWS Lambda function on a schedule by using CloudWatch event. https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/RunLambdaSchedule.html


CloudFormation by itself has no way to schedule execution every minute. CloudFormation is great to create AWS resources, like Lambda, but not execute them.

There is another facility in AWS that allows scheduling execution of Lambda functions, it is called “CloudWatch Events”. You can set it to run the Lambda every minute, and you can create the rule for CWE using CloudFormation.

Ansible is similar to CloudFormation in this regard, it can create resources - but has no mechanism to do scheduled executions, only setup some other resource to execute on a schedule.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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