> ## Documentation Index
> Fetch the complete documentation index at: https://playbook.smedleygroup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SG-Infra Overview

> Target infrastructure pattern for SG Advanced Tech cloud systems. A TypeScript AWS CDK project providing dedicated infrastructure for systems that adopt it.

Active

## Overview

SG-Infra was created as a cleaner, more maintainable replacement for the infrastructure patterns established in TalentIdPipeline-Infra-CDK. It is the **target infrastructure pattern for all new and migrated cloud systems going forward**.

## Architecture

![SG-Infra deployed infrastructure. Box colour shows the deploying stack; dashed grey is owned by TalentIdPipeline-Infra-CDK.](https://mintcdn.com/smedley_group/J4Qb1kGrTQEJOjVR/images/software/developer/estate/infra/sg-infra/architecture.png?fit=max\&auto=format\&n=J4Qb1kGrTQEJOjVR\&q=85\&s=627b3c62877baf4d3d3faf9ad1cbcc57)

> [!NOTE]
>
> The diagram source is the draw\.io file at `images/software/developer/estate/infra/sg-infra/architecture.drawio`. To change the diagram, edit that source in draw\.io, re-export it as PNG to `architecture.png` in the same folder, and commit both.

## Key Facts

| Setting | Value |
| - | - |
| AWS account | `338232497876` |
| Region | `eu-west-2` (London) |
| Network | Shared VPC from TalentIdPipeline-Infra-CDK (`172.17.0.0/22`); SG-Infra creates no VPC of its own |
| Source | GitHub `Smedley-Group-Advanced-Technology/SG-Infra` (`prod`) |
| CI/CD | CodePipeline `SgInfraPipeline` (self-mutating) |
| IaC | TypeScript AWS CDK (`aws-cdk-lib` 2.215.0) |
| Database | MongoDB 8.2 in Docker on a single EC2 instance (`t3.large`) |
| Used by | Fleet Management Platform only |

## What It Provisions

SG-Infra is a TypeScript AWS CDK project that defines dedicated infrastructure for systems that adopt it. It currently provisions:

* A dedicated, larger and more powerful MongoDB EC2 instance, currently used exclusively by Fleet Management Platform

SG-Infra depends on TalentIdPipeline-Infra-CDK for the VPC and does not define its own network layer. All systems using SG-Infra therefore retain an indirect dependency on TalentIdPipeline-Infra-CDK.

## Repositories

| Repository | Description |
| - | - |
| [SG-Infra](https://github.com/Smedley-Group-Advanced-Technology/SG-Infra) | AWS CDK infrastructure definition |

## Systems That Depend On This

| System | Dependency |
| - | - |
| Fleet Management Platform | Dedicated MongoDB EC2 instance |

## Dependencies

### Infrastructure

* **TalentIdPipeline-Infra-CDK**: SG-Infra depends on this repo for the VPC. It does not define its own network infrastructure.

## Detailed Documentation

> **[Architecture and Deployment Pipeline](/software/developer/estate/infra/sg-infra/architecture)**
>
> The TypeScript CDK app, the GitHub sourced pipeline, the four stacks, and how a change reaches production.

> **[MongoDB Instance and Data Volume](/software/developer/estate/infra/sg-infra/mongodb-and-volume)**
>
> The Dockerised MongoDB, the persistent data volume, TLS, and provisioning.

> **[Backups and Disaster Recovery](/software/developer/estate/infra/sg-infra/backups)**
>
> Versioned backups, retention, and the recovery picture.

> **[Networking, Dependencies and Configuration Contract](/software/developer/estate/infra/sg-infra/networking-and-config)**
>
> The shared VPC dependency, security groups, and the published config.

> **[Security, Risks and Relationship to the Legacy Pattern](/software/developer/estate/infra/sg-infra/security-and-legacy)**
>
> Security posture, remaining risks, and how this improves on the legacy repo.

## Notes

* SG-Infra is the target infrastructure pattern for all future cloud systems. New systems should use this rather than adding to TalentIdPipeline-Infra-CDK.
* Currently only used by Fleet Management Platform. The goal is to migrate all systems toward this pattern over time, though no migration timeline has been agreed.
* A future improvement would be to define the VPC within SG-Infra itself, fully decoupling it from the legacy TalentIdPipeline-Infra-CDK repo.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.