# srajasimman/terraform-aws-github-oidc-iam architecture

> Architecture diagram of the GitHub repository srajasimman/terraform-aws-github-oidc-iam, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/srajasimman/terraform-aws-github-oidc-iam
- Repository: https://github.com/srajasimman/terraform-aws-github-oidc-iam

## Overview

##### Main Components

a) External Systems:
- GitHub Actions (Source)
- AWS (Target Platform)

b) Core Components:
- OIDC Identity Provider
- IAM Role
- IAM Policies (both custom and existing)

##### Specific Elements

a) Components:
- Blue: GitHub components
- Orange: AWS components
- Green: Security/Authentication components

b) Connections:

##### Detailed Flow Representation

**[GitHub Actions] --OIDC Token--> [AWS OIDC Provider]**

- Trust Policy

- [IAM Role] -----> [Attached Policies]

- [Custom Policy] [Existing AWS] [Additional]
- Policies     Policies

##### Additional Details

- Role assumption process
- Policy attachment points
- A note about the thumbprint validation

##### Technical Specifications

- Required provider versions (AWS >= 4.0, TLS >= 3.0)
- Terraform version requirement (>= 1.5.0)
- Resource types being created

##### Implementation Notes

- The modular nature of the policy attachment system
- The flexibility in repository access control
- The security boundary created by the OIDC trust relationship

##### Optional Elements

- A small section showing example repository patterns
- A mini-view of the policy structure
- Role assumption workflow

- How the OIDC authentication flow works
- Where and how policies are attached
- The security implications of the setup
- The configuration points available through the module variables

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Define styles
    classDef github fill:#4078c0,stroke:#333,stroke-width:2px,color:white
    classDef aws fill:#FF9900,stroke:#333,stroke-width:2px,color:white
    classDef security fill:#2ECC71,stroke:#333,stroke-width:2px,color:white
    classDef config fill:#95A5A6,stroke:#333,stroke-width:2px,color:white
    classDef docs fill:#3498DB,stroke:#333,stroke-width:2px,color:white

    %% GitHub Components
    GHA["GitHub Actions"]:::github

    %% Authentication Flow
    OIDC["AWS OIDC Provider"]:::security
    Trust["Trust Relationship"]:::security

    %% IAM Components
    IAMRole["IAM Role"]:::aws
    Policies["Policy Management"]:::aws

    %% Policy Types
    subgraph PolicyTypes["Policy Types"]
        CustomPol["Custom Policies"]:::aws
        ExistingPol["Existing AWS Policies"]:::aws
        AddPol["Additional Policies"]:::aws
    end

    %% Configuration
    Config["Configuration Parameters"]:::config
    Examples["Implementation Examples"]:::docs
    Outputs["Resource Outputs"]:::docs

    %% Connections
    GHA -->|"OIDC Token"| OIDC
    OIDC -->|"Validates"| Trust
    Trust -->|"Establishes"| IAMRole
    IAMRole --> Policies
    Policies --> PolicyTypes
    Config --> Trust
    Config --> IAMRole
    IAMRole --> Outputs

    %% Click Events
    click IAMRole "https://github.com/srajasimman/terraform-aws-github-oidc-iam/blob/main/main.tf"
    click Config "https://github.com/srajasimman/terraform-aws-github-oidc-iam/blob/main/variables.tf"
    click Outputs "https://github.com/srajasimman/terraform-aws-github-oidc-iam/blob/main/outputs.tf"
    click Examples "https://github.com/srajasimman/terraform-aws-github-oidc-iam/blob/main/examples/basic/main.tf"
    click Examples "https://github.com/srajasimman/terraform-aws-github-oidc-iam/blob/main/examples/basic/README.md"
    click Trust "https://github.com/srajasimman/terraform-aws-github-oidc-iam/blob/main/README.md"

    %% Legend
    subgraph Legend
        L1["GitHub Component"]:::github
        L2["AWS Component"]:::aws
        L3["Security Component"]:::security
        L4["Configuration"]:::config
        L5["Documentation"]:::docs
    end
```
