# aws-samples/aws-cft-digital-preservation-archivematica-on-aws architecture

> Architecture diagram of the GitHub repository aws-samples/aws-cft-digital-preservation-archivematica-on-aws, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aws-samples/aws-cft-digital-preservation-archivematica-on-aws
- Repository: https://github.com/aws-samples/aws-cft-digital-preservation-archivematica-on-aws

## Overview

##### Main Components
- CloudFormation Templates: They are the “source code” for deploying the AWS infrastructure. Indicate that there are two variations:
- Deployment in an existing VPC (with an external load balancer)
- Deployment in a new VPC (with a public Application Load Balancer)
- Networking Infrastructure:
- Virtual Private Cloud (VPC), Subnets (public and private), Internet Gateway, NAT Gateways, and Private S3 VPC Endpoint.
- Security Components:
- IAM roles, KMS keys for encryption, and Security Groups.
- Compute:
- A single EC2 instance (CentOS7 on c6i.2xlarge) running Archivematica.
- Block Storage:
- Multiple EBS volumes (Root, MySQL, Elasticsearch, Archivematica Data Volume) with an emphasis on storage performance (IOPS and throughput settings).
- Object Storage:
- Amazon S3 bucket for AIP Storage and Transfer Source with distinct folder structure.
- Load Balancing:
- An Application Load Balancer with two target groups and HTTP listeners (and a mention of HTTPS when configured).

##### Relationships and Interactions
- ALB as the frontend routing component receiving inbound HTTP/HTTPS traffic and directing it to the EC2 instance.
- From the EC2 instance, illustrate outgoing communications/configuration connections:
- It interacts with the attached EBS volumes (for OS, MySQL, Elasticsearch, Archivematica data) and S3 for object storage.
- Communication between the Archivematica Dashboard (accessed at ALB:81) and the Storage Service (running on port 8001), including creation and usage of super-user credentials and API keys.
- Secure connectivity paths between the components, e.g., how the EC2 instance uses its IAM role to access the S3 bucket, and how security groups manage inbound/outbound traffic.

##### Architectural Patterns and Technologies
- The deployment follows a well-architected AWS design with visible separation between compute, block storage, and object storage.
- Best practices for securing the deployment with IAM, KMS, and explicit network security (using subnets, NAT gateways, and ALB security rules).
- Mention operational aspects such as bootstrapping of the EC2 instance, dynamic configuration via the archivematica bootstrap process, and the configuration wizard interaction through the browser.
- That it builds on key AWS services: EC2, EBS, S3, VPC, and CloudFormation.

##### Elements
- Use clear labels and distinguish between:
- Infrastructure provisioning (CloudFormation Templates)
- Networking components (VPC, subnets, NAT Gateway, Internet Gateway, VPC Endpoint)
- Compute resources (EC2 instance with its attached EBS volumes)
- Load Balancing components (ALB, with indication of HTTPS/HTTP listeners)
- Object storage (S3 bucket along with notes on the two key directories: aip_storage and transfer_source)
- Security components (IAM role, KMS key, Security Groups)
- Data flows such as user requests routed by the ALB to the EC2 instance.
- EC2 interactions with the S3 bucket (for archival object storage) and EBS volumes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Infrastructure Provisioning
    subgraph "Infrastructure Provisioning"
        CF_Ev["CF Template: Existing VPC Deployment (Ext LB)"]:::cf
        CF_NV["CF Template: New VPC Deployment (Public ALB)"]:::cf
        IAC["IAC Repository"]:::cf
    end

    %% Networking Layer
    subgraph "Networking Layer"
        VPC["VPC"]:::networking
        PublicSubnets["Public Subnets"]:::networking
        PrivateSubnets["Private Subnets"]:::networking
        IGW["Internet Gateway"]:::networking
        NAT["NAT Gateway"]:::networking
        VPCEndpoint["S3 VPC Endpoint"]:::networking
    end

    %% Security Components
    subgraph "Security Components"
        IAM["IAM Role"]:::security
        KMS["KMS Keys"]:::security
        SG["Security Groups"]:::security
    end

    %% Compute Layer
    subgraph "Compute Layer"
        EC2["EC2 Instance (CentOS7 on c6i.2xlarge)"]:::compute
        EBS_Root["EBS Volume: Root"]:::compute
        EBS_MySQL["EBS Volume: MySQL"]:::compute
        EBS_ES["EBS Volume: Elasticsearch"]:::compute
        EBS_Archivematica["EBS Volume: Archivematica Data"]:::compute
    end

    %% Storage Layer
    subgraph "Storage Layer"
        S3["S3 Bucket (contains directories: aip_storage & transfer_source)"]:::storage
    end

    %% Load Balancing
    subgraph "Load Balancing"
        ALB["Application Load Balancer (ALB with HTTP/HTTPS listeners & two target groups)"]:::alb
    end

    %% Provisioning relationships from CloudFormation to Layers
    CF_Ev -->|"provisions"| VPC
    CF_NV -->|"provisions"| VPC
    IAC   -->|"contains IaC for"| VPC

    CF_Ev -->|"provisions"| SG
    CF_NV -->|"provisions"| SG
    IAC   -->|"contains IaC for"| SG

    CF_Ev -->|"provisions"| EC2
    CF_NV -->|"provisions"| EC2
    IAC   -->|"contains IaC for"| EC2

    CF_Ev -->|"provisions"| ALB
    CF_NV -->|"provisions"| ALB
    IAC   -->|"contains IaC for"| ALB

    CF_Ev -->|"provisions"| S3
    CF_NV -->|"provisions"| S3
    IAC   -->|"contains IaC for"| S3

    %% Networking internal relationships
    VPC --> PublicSubnets
    VPC --> PrivateSubnets
    VPC --> IGW
    VPC --> NAT
    VPC --> VPCEndpoint

    %% Compute internal relationships
    EC2 --> EBS_Root
    EC2 --> EBS_MySQL
    EC2 --> EBS_ES
    EC2 --> EBS_Archivematica

    %% Load Balancing routing
    ALB -->|"routes HTTP/HTTPS traffic"| EC2

    %% EC2 interactions
    EC2 -->|"accesses object storage"| S3
    IAM ---|"assigned to"| EC2

    %% Styling
    classDef cf fill:#E6E6FA,stroke:#8A2BE2,stroke-width:2px;
    classDef networking fill:#ADD8E6,stroke:#0000FF,stroke-width:2px;
    classDef security fill:#FFC0CB,stroke:#FF0000,stroke-width:2px;
    classDef compute fill:#90EE90,stroke:#008000,stroke-width:2px;
    classDef storage fill:#FFFFE0,stroke:#FFD700,stroke-width:2px;
    classDef alb fill:#FFA07A,stroke:#FF4500,stroke-width:2px;

    %% Click Events for IaC components
    click CF_Ev "https://github.com/aws-samples/aws-cft-digital-preservation-archivematica-on-aws/blob/main/cloudformation/archivematica‐existing‐vpc‐with‐loadbalancer.yaml"
    click CF_NV "https://github.com/aws-samples/aws-cft-digital-preservation-archivematica-on-aws/blob/main/cloudformation/archivematica‐new‐vpc‐with‐public‐alb.yaml"
    click IAC "https://github.com/aws-samples/aws-cft-digital-preservation-archivematica-on-aws/tree/main/cloudformation"
```
