Dormeto

Docs

Architecture

One manager in your AWS account serves the routers of both clouds, each beside its workloads.

5 min read

A router naps and wakes the workloads of one AWS account or Google Cloud project, in one region. The manager discovers, onboards and operates them all.

Each arrow goes from caller to called. Its scenarios, replayed: Installation, Discovery, Onboarding, Napping, Waking, Scheduler, Router update and Manager update.

One deployment of both clouds: the manager in an AWS account, a router in an AWS account and region, another in a Google Cloud project and region, and the calls between them, numbered as listed under the drawingTHE MANAGER · YOUR AWS ACCOUNTGOOGLE CLOUD · HOST PROJECTAWS ACCOUNT · REGIONGOOGLE CLOUD PROJECT · REGIONAmazon CloudFrontthe dashboardCloudFront, S3Amazon API Gatewaythe APIAPI GatewayAmazon Cognitosign-inCognitoAmazon SNShealth alertsSNSAWS Step Functionsoperations, discoveryStep FunctionsAmazon EventBridgerouter eventsEventBridgeAWS Lambdathe manager's codeLambdaAmazon DynamoDBits tableDynamoDBWorkload Identity Federationfederation from AWSWorkload Identity FederationIdentity and Access Managementdiscovery and command accountsIAM service accountsAmazon EventBridge Scheduleridle checkEventBridge SchedulerAWS LambdacontrollerLambdaAmazon CloudWatchrequest countsCloudWatchAWS LambdawakerLambdaAmazon DynamoDBthe router's stateDynamoDBAmazon EC2Amazon EC2 Auto ScalingAmazon ECSAmazon EKSAmazon RDSyour workloadstag dormeto:workloadElastic Load Balancingyour load balancerElastic Load BalancingCloud Scheduleridle checkCloud SchedulerCloud RuncontrollerCloud RunCloud Monitoring and Cloud Loggingrequest countsMonitoring, LoggingCloud RunwakerCloud RunCloud Taskswakes and napsCloud TasksCompute EngineCloud SQLGoogle Kubernetes Engineyour workloadstag dormeto=managedCloud Load Balancingyour load balancerCloud Load BalancingFirestorethe router's stateFirestorethe dashboardyour operators›dormeto awsyour AWS profile›dormeto gcpyour gcloud accountvisitorsyour workloads' users112233445566778889101011121314151616a router's parta visitor's request
  1. A visitor's request reaches your load balancer.
  2. Awake, the load balancer sends it straight to your workload: Dormeto stays out of the path.
  3. Asleep, it goes to the router's waker, which answers the waiting page.
  4. The waker asks the controller for a wake, through a Cloud Tasks queue on Google Cloud.
  5. The controller starts the workload, then gives the load balancer its route back.
  6. Every 5 minutes, the schedule runs the controller's idle check.
  7. The check reads the request counts, and naps each workload idle for its window.
  8. Routers put their events on the manager's bus.
  9. Google Cloud routers ask the API for credentials hourly.
  10. The manager calls each router to nap, wake or onboard; its watchdog, a silent Google Cloud router.
  11. It reads each AWS account as DmtDiscoveryRole, and installs its router as DmtCommandRole.
  12. For Google Cloud, it trades its AWS signature for short-lived tokens: no key.
  13. As its discovery account it reads your projects; as its command account it binds the tag.
  14. Operators open the dashboard: its pages from CloudFront, sign-in with Cognito, the API.
  15. dormeto aws calls the same API, signed with your AWS credentials.
  16. dormeto gcp, as you, installs the Google Cloud routers and connects the manager.

Service icons: AWS Architecture Icons and Google Cloud product icons, trademarks of their owners.

The manager

It runs in one AWS account and region, installed with Terraform (Get started). Its settings: Manager.

ComponentServiceWhat it does
The dashboardAmazon CloudFrontCloudFront, Amazon S3S3Serves the dashboard's pages from a private bucket.
Sign-inAmazon CognitoCognitoSigns the dashboard's users in, with an authenticator app (Manager).
The APIAmazon API GatewayAPI GatewayAnswers the dashboard and dormeto aws; gives Google Cloud routers credentials.
Its codeAWS LambdaLambdaRuns the API, discovery, operations, savings, IP lists and the watchdog.
OperationsAWS Step FunctionsStep FunctionsRuns each operation and each discovery run, step by step.
Its dataAmazon DynamoDBDynamoDBHolds the manager's table: workloads, history, operations and audit.
Router eventsAmazon EventBridgeEventBridge, Amazon SQSSQSTakes every router's events on its bus, queued for its code.
Its schedulesAmazon EventBridge SchedulerEventBridge SchedulerStarts discovery, savings, the IP lists' downloads and the watchdog.
Health alertsAmazon SNSSNS, Amazon CloudWatchCloudWatchSends the alerts to alert_emails; an alarm watches the watchdog.
IP listsAmazon S3S3Keeps the lists it downloads, which its AWS routers read.
The installAWS CodeBuildCodeBuild, Amazon S3S3Plans and applies the manager's Terraform for dormeto aws install.
Its rolesAWS IAMIAMIts own roles, and those it assumes in your accounts (Roles).

A router

What it creates: Router.

ComponentAWSGoogle CloudWhat it does
ControllerAWS LambdaLambdaCloud RunCloud RunNaps and wakes the workloads, runs the idle check, answers the manager.
WakerAWS LambdaLambdaCloud RunCloud RunAnswers a napping workload's visitors with the waiting page, and asks for the wake.
OnboardingAWS LambdaLambda, its onboarderCloud RunCloud Run, its controllerAdds and removes a workload's routes to the waker (Workloads).
Its stateAmazon DynamoDBDynamoDBFirestoreFirestoreHolds its workloads, their settings and their runs.
Its queuesAmazon SQSSQSCloud TasksCloud TasksCarry its naps and wakes to the controller.
The idle checkAmazon EventBridge SchedulerEventBridge SchedulerCloud SchedulerCloud SchedulerStarts the check every 5 minutes (Workloads).
Request countsAmazon CloudWatchCloudWatchCloud Monitoring and Cloud LoggingCloud Monitoring, Cloud LoggingWhat the check reads of your load balancer's requests.
Drift repair Amazon Web ServicesAWS onlyAmazon EventBridgeEventBridge, AWS CloudTrailCloudTrail—Puts back what your tools remove of onboarding's changes.
Its identityAWS IAMIAM rolesIdentity and Access ManagementIAM service accountIts own identity, with the permissions Roles lists.
Its codeAmazon S3S3Artifact RegistryArtifact RegistryThe manager's release, or Dormeto's public image (Router).

Your workloads

They stay yours: onboarding tags them, and the router acts on nothing else. What can nap: Eligibility.

ComponentAWSGoogle CloudWhat it does
Load balancerElastic Load BalancingElastic Load BalancingCloud Load BalancingCloud Load BalancingRoutes to your workload, or to the waker while it naps.
MachinesAmazon EC2EC2, Amazon EC2 Auto ScalingEC2 Auto ScalingCompute EngineCompute EngineInstances, VMs and their groups, stopped or scaled to zero.
Containers Amazon Web ServicesAWS onlyAmazon ECSECS, AWS FargateFargate—Services scaled to zero tasks.
KubernetesAmazon EKSEKSGoogle Kubernetes EngineGKEDeployments and StatefulSets scaled to zero (Router).
DatabasesAmazon RDSRDS, Amazon AuroraAuroraCloud SQLCloud SQLCompanions that nap with their application (Router).

The Google Cloud connection Google Cloud only

The manager reaches Google Cloud through a host project, which dormeto gcp connect sets up (Manager).

ComponentServiceWhat it does
The pool dmt-<env>Workload Identity FederationWorkload Identity FederationAdmits the manager's own roles, from its AWS account only.
The tokensSecurity Token ServiceSecurity Token ServiceTrades the manager's AWS signature for a short-lived token: no key.
dmt-<env>-discovery, dmt-<env>-commandIdentity and Access ManagementIAM service accountsRead your scopes; call the routers and bind the tag (Roles).

Who comes in

  • Operators: the dashboard in a browser, signed in with Cognito.
  • The CLI: dormeto aws with your AWS credentials, dormeto gcp with your gcloud account (CLI).
  • Visitors: your load balancer only; Dormeto's waker answers them while a workload naps.