---
# System prepended metadata

title: OulaHealth Tech Stack Prelim Notes

---

# OulaHealth Tech Stack Prelim Notes

Discussion on different aspects of [company] engineering dept.

## Expectations

High-level overview of what Sabrina needs.

Question: Ad Hoc or define right now? If there's a desire to explore options, what are those options?

Below are topics for consideration to help with conversations. "Not right now" is a wholly acceptable response.

## Design and Architecture

## Initial Infrastructure

- DNS --> LB --> ASG/Launch Configuration
- Defined in GitHub repo "infra"
- Backend storage in [terraform cloud](https://www.hashicorp.com/products/terraform/) (can discuss this... allows you to approve plans and centralise change logs. [free for <= five users](https://www.hashicorp.com/products/terraform/pricing/))
    - also defined in GitHub "infra" repo
    - consider a GitHub repo that defines the GitHub repos



```graphviz
digraph hierarchy {
                nodesep=.5 // separation between nodes

                node [color=Red,fontname=Courier,shape=box]
                edge [color=Blue, style=dashed] // lines

                //DNS->API_Gateway_Routes->{path1 path2_or_feature_flag}
                DNS->Application_Load_Balancer->{prodServiceRule stagingServiceRule}
                
                //path1->ASG1
                //path2_or_feature_flag->ASG2
                
                prodServiceRule->launch_config_production [ dir = back ];
                stagingServiceRule->launch_config_staging [ dir = back ];

}
```


## Deployment

deployment will evolve in layers until OulaHealth is able to self-serve

## Initial Manual Deployment

Terraform out the DNS, LB, ASG, Launch Config shown above.

Deployment will be

- ssh through a Bastion host to the instances
- follow manual steps
    - document steps in runbook (question pending on source-of-truth.. Git wiki, confluence, README.md)
- test manually
    - doc steps in runbook

### Next phase

Once above is working, automate as much as possible via AWS Code deploy (or something similar)

```flow
st=>start: Trigger:GitHub Event
e=>end: Deployment Completed
op=>operation: AWS Code Deploy
op2=>subroutine: update Launch config and ASG
cond=>condition: Code Deploy Helth passes?
para=>parallel: rollback

st->op->op2->cond
cond(yes)->e
cond(no)->para
para(path1, top)->op2(right)
```

LB, ASG, launch config with userdata that
	- trigger
		- github actions
	- build
		- pull codebase (git clone --depth=1)
	- deploy
		- run deployment tasks (make 'n rake' - ansible playbook)

Recommend that we move to packaging the application in a docker container. That would open up options for ECS or EKS over Fargate.


Design records for

- infrastructure
  - environments
  - parameters
  - secrets
  - persistent storage
    - MySQL
      - runbooks
        - db tasks
      - disaster recovery
        - `dump` target
        - job defined?
        - event trigger
          - cron
          - operational
- Networking
  - service discovery
    - DNS ?
  - segmentation
    - pub / priv; app / data
  - developer access
    - bastion host
    - VPN

## Infrastructure as Code

- Terraform ok?
- GitHub repo
  - Terraform
  - Terraform modules
  - GitHub IaC
    - "i heard you like repos, so i put a repo in your repo and put a repo in it"

## Identity Provider

Centralised account administration

## Project Planning

[AirtableBoard]

## AuthN (see IdP above)
## AuthZ (see IdP above)

Overall system architecture

## Integration / Deployment

- CI framework
  - GitHub Actions - they're already using GitHub. Recent feature parity work with GitLab presents opportunities.
- CD framework
  - Unknown

## Logging and Metrics

APM
Centralised Logging
Tracing (Jaeger?)

## Secrets Management

expand on design section above

## Communication

- Slack
- Email
- Wiki

## Cost Optimisation

Ensure Billing limits are in place. Config watch and other guardrails to limit deployments.

## Camilo Task List / Follow-up

Best to put in Airflow. Listed here until AuthN.

[AirtableBoard]: https://airtable.com/shrRFJa2WeKbRKMII/tblWbe1yHI9B71KGb