# dlddu/aws-cli-credential-utility architecture

> Architecture diagram of the GitHub repository dlddu/aws-cli-credential-utility, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dlddu/aws-cli-credential-utility
- Repository: https://github.com/dlddu/aws-cli-credential-utility

## Overview

##### Project Type and Purpose
This is a utility application that automates the process of handling AWS SSO credentials, specifically addressing the limitation of AWS SSO login credentials not working with Terraform's S3 backend.

##### Main Components

A. Application Layer (WPF Components):
- Present using a rectangle labeled "WPF Application"
- MainWindow (UI Layer)
- MainWindowViewModel (MVVM Pattern)

B. Process Interaction Layer:
- As a separate component that interfaces with AWS CLI

C. File System Interaction Layer:
- Interaction with local AWS configuration files
- AWS SSO Cache Directory
- AWS Credentials File
- AWS Config File

D. External Services:
- AWS SSO Service
- AWS Identity Center

##### Important Elements to Highlight

A. Authentication Flow:
- Complete cycle from SSO login to credential writing
- Token retrieval and credential generation steps

B. File System Integration:
- Interaction with the .aws directory
- Different configuration files involved

##### Additional Notes

- Notes about the MVVM pattern implementation
- Automated nature of the credential management
- Error handling paths (if any)

##### Technical Details

- .NET/WPF framework indication
- AWS CLI dependency
- File paths for configuration files
- SSO token handling process

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Legend"
        L1[Application Component]:::application
        L2[External Service]:::external
        L3[(File System)]:::filesystem
        L4[Process Component]:::process
    end

    subgraph "WPF Application Layer"
        AppEntry["Application Entry"]:::application
        MainUI["Main Window UI"]:::application
        MainVM["Main Window ViewModel"]:::application
    end

    subgraph "Process Layer"
        CliRunner["AWS CLI Process Runner"]:::process
    end

    subgraph "File System Layer"
        SSOCache[(AWS SSO Cache)]:::filesystem
        Credentials[(AWS Credentials File)]:::filesystem
        Config[(AWS Config File)]:::filesystem
    end

    subgraph "External Services"
        AWSSSO["AWS SSO Service"]:::external
        AWSIdentity["AWS Identity Center"]:::external
    end

    %% Relationships
    AppEntry --> MainUI
    MainUI --> MainVM
    MainVM --> CliRunner
    CliRunner --> AWSSSO
    CliRunner --> SSOCache
    MainVM --> AWSIdentity
    MainVM --> Credentials
    MainVM --> Config
    AWSSSO --> AWSIdentity

    %% Click Events
    click AppEntry "https://github.com/dlddu/aws-cli-credential-utility/blob/master/App.xaml"
    click MainUI "https://github.com/dlddu/aws-cli-credential-utility/blob/master/MainWindow.xaml"
    click MainVM "https://github.com/dlddu/aws-cli-credential-utility/blob/master/MainWindowViewModel.cs"

    %% Styles
    classDef application fill:#a8d1ff,stroke:#333
    classDef external fill:#90EE90,stroke:#333
    classDef filesystem fill:#FFE5B4,stroke:#333
    classDef process fill:#E6E6E6,stroke:#333
    classDef legend fill:#ffffff,stroke:#333
```
