-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
To submit a template to the Serverless Patterns Collection, submit an issue with the following information.
IMPORTANT
Patterns are intended to be primarily IaC-focused implementations of 2-4 AWS services, with minimum custom code. They should be commonly used combinations that help developers get started quickly. If you have a utility, demo, or application, submit these to the Serverless Repos Collection instead.
ONLY SUBMIT ONE PATTERN CHANGE PER PR. Multiple patterns or files spanning multiple pattern directories will be automatically rejected.
Patterns may take up to 4-6 weeks to review, test, and merge but there is no SLA and can take significantly longer due to other work the team has.
To learn more about submitting a pattern, read the publishing guidelines page.
-
Use the model template located at https://github.com/aws-samples/serverless-patterns/tree/main/_pattern-model to set up a README, template and any associated code.
-
THIS PROCESS HAS BEEN SIMPLIFIED. All the information below must be provided in the "example-pattern.json" file cloned from the model **
Note the following information for the model:
- Description (intro.text) should be a 300-500 word explanation of how the pattern works.
This pattern addresses a common need in cloud infrastructure: scheduling and triggering automated tasks for containerized applications.
- Leveraging AWS EventBridge and Amazon ECS, this solution offers a robust, serverless, and cost-effective approach to running recurring workloads using cron schedules within a Terraform framework.
- At its core, this pattern simplifies the execution of routine operations for containerized applications hosted on Amazon ECS. Instead of manually initiating tasks or relying on a dedicated server for scheduling, EventBridge acts as a central hub, intelligently routing scheduled events to trigger ECS tasks at specified intervals. This eliminates the need for managing underlying infrastructure for task scheduling, significantly reducing operational overhead.
- The solution incorporates Terraform, a powerful infrastructure-as-code tool, to define and manage the AWS resources involved. With Terraform, users can declare the EventBridge rules, ECS task definitions, and any other necessary components in a version-controlled and repeatable manner. This approach ensures consistency across environments and facilitates efficient deployment and management of the scheduled tasks.
- The cron-based scheduling capabilities of EventBridge allow for flexible and precise control over when ECS tasks are executed. Whether it's a nightly data backup, an hourly report generation, or a weekly system cleanup, cron expressions can be tailored to meet diverse operational requirements. For example, you could define a cron expression to stop development ECS tasks during non-working hours and weekends to optimize costs. The integration with Terraform allows these cron schedules to be defined and managed programmatically within the infrastructure configuration itself.
- A significant advantage of this pattern lies in its serverless nature. By utilizing EventBridge and ECS Fargate (a serverless compute engine for containers), organizations can run containerized applications without provisioning, scaling, or managing servers. This translates to enhanced scalability, as the system automatically adapts to fluctuating workloads, and improved cost-effectiveness, as users only pay for the resources consumed during task execution. Furthermore, EventBridge offers features like retry policies and dead-letter queues, ensuring the reliable delivery of events and handling of potential failures during task invocation. This robustness is crucial for maintaining the availability and integrity of scheduled workloads.
- Ultimately, this pattern offers a comprehensive solution for organizations aiming to automate their containerized workloads on a schedule. By combining the power of Amazon EventBridge for scheduling, Amazon ECS for container orchestration, and Terraform for infrastructure management, this pattern provides a reliable, scalable, and cost-efficient approach to running scheduled tasks in a serverless environment.
- Resources should like to AWS documentation and AWS blogs related to the post (1-5 maximum).
- [Amazon EventBridge User Guide](https://docs.aws.amazon.com/eventbridge/latest/userguide/)
- [Amazon ECS Developer Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/)
- [AWS Fargate User Guide](https://docs.aws.amazon.com/AmazonECS/latest/userguide/what-is-fargate.html)
- [EventBridge Cron Expressions](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html)
- [Terraform AWS Provider Documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs)
- Author bio may include a LinkedIn and/or Twitter reference and a 1-sentence bio.
LinkedIn: https://www.linkedin.com/in/sudhansu-mohapatra-83a51811a/
Name: Sudhansu Mohapatra
Bio: Sudhansu is a Associate Delivery consultant in AWS
You must ensure that the sections of the model README.md are completed in full.