This repo holds Lambda scripts for turning off services (eg AWS Fargate [containers], AWS Aurora [databases]) to save money (eg dev, test environments that don't need to be operational all the time).
By default, Lambda/CloudWatch/EventBridge will only execute with the same project set/space. In order to centralize/consolidate the Lambda and CloudWatch/EventBridge, the architecture requires three accounts:
- AccountA: the source event account with a Lambda function that sends events.
- AccountGlobal: the account hosting the global Event bus and forwarding rule to the target account.
- AccountB: the target event account containing our target workload, a Lambda function.
The flow has four steps:
- EventSender Lambda is triggered.
- EventSender Lambda sends an event towards the global event bus.
- Global event bus forwards the event to a target event bus.
- The target event bus forwards the event to Event Receiver Lambda.
Step-by-step instructions: https://repost.aws/articles/ARIw6q_ozaTmqqI25Eq4YIcQ/a-step-by-step-guide-to-cross-account-and-cross-region-events-with-eventbridge
⬆️ Back to Top
This script takes arguments via CloudWatch/EventBridge:
- AURORA_CLUSTER
⬆️ Back to Top
This script takes arguments via CloudWatch/EventBridge:
- ECS_CLUSTER
- ECS_SERVICE_NAME
⬆️ Back to Top