Skip to content

bcgov/moh-aws-devops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lifecycle:Stable

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).

Table of Contents

  1. Cross-account and Cross-region Events
  2. Aurora_Stop
  3. Fargate_Stop

Cross-account and Cross-region Events

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:

  1. EventSender Lambda is triggered.
  2. EventSender Lambda sends an event towards the global event bus.
  3. Global event bus forwards the event to a target event bus.
  4. 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

Aurora_Stop

This script takes arguments via CloudWatch/EventBridge:

  • AURORA_CLUSTER

⬆️ Back to Top

Fargate_Stop

This script takes arguments via CloudWatch/EventBridge:

  • ECS_CLUSTER
  • ECS_SERVICE_NAME

⬆️ Back to Top

Releases

No releases published

Packages

No packages published