# aws/aws-toolkit-visual-studio architecture

> Architecture diagram of the GitHub repository aws/aws-toolkit-visual-studio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aws/aws-toolkit-visual-studio
- Repository: https://github.com/aws/aws-toolkit-visual-studio

## Overview

##### Project Type and Purpose
- This is an open-source Visual Studio extension (AWS Toolkit) that integrates AWS services into VS 2019/2022 on Windows.
- Its purpose is to allow developers to browse and manage AWS resources (EC2, S3, DynamoDB, Lambda, CloudFormation, SQS, SNS, IAM) and to deploy applications from within Visual Studio.

##### File Structure
- Top-level folder contains only GitHub meta (issue templates, workflows), a Telemetry folder with a JSON definitions file, and versioning.
- There is no core source code here—this repo is “issues only.” However, we know from the README that the actual extension uses the AWS .NET SDK, Visual Studio extension APIs (VSIX), and a telemetry component.

##### Extract Insights from the README
- The extension integrates deeply into Visual Studio’s Solution Explorer, provides UI editors (tree view, property editors), and invokes AWS REST APIs via AWS SDK for .NET.
- Telemetry definitions are shipped so that user actions can be recorded and sent to AWS telemetry endpoints.
- Key architectural concerns: VSIX packaging, extension lifecycle (load/unload), UI tooling, service calls, and telemetry.

##### Defining the Main Components
a. Visual Studio IDE Host
- Provides extension points (menus, tool windows, Solution Explorer integration).
b. AWS Toolkit Extension (VSIX Package)
- UI Layer – AWS Explorer window, property editors, context menus.
- Core Logic – Commands, deployment workflows, resource CRUD actions.
- Telemetry Module – loads vs-telemetry-definitions.json and emits events.
- Configuration – reads version.json, AWS credentials/configuration.
c. AWS SDK for .NET
- Low-level client interfaces to AWS services (EC2, S3, DynamoDB, Lambda, etc.).
d. AWS Services (Cloud)
- REST endpoints for each AWS service called by the SDK.
e. External Systems
- Visual Studio Marketplace (publishing/distribution).
- User’s local .NET/solution projects (to deploy from).

##### Relationships & Data Flows
- At startup, Visual Studio loads the VSIX, which registers commands and tool windows.
- When the user opens the AWS Explorer, the UI Layer retrieves current AWS credentials/config and calls the Core Logic.
- Core Logic uses the AWS SDK to make API calls to AWS Services—these calls return data that’s rendered in the UI.
- Deployment actions initiate build/publish workflows: the extension invokes MSBuild or VS project APIs, packages artifacts, then calls AWS SDK to deploy to Elastic Beanstalk or Lambda.
- Telemetry Module hooks into user actions (e.g., node expanded, resource created) and sends events per vs-telemetry-definitions.json to AWS telemetry endpoints.

##### Architectural Patterns/Design Principles
- MVVM or MVP pattern inside the tool windows (separating UI from business logic).
- Dependency Injection for AWS SDK clients.
- Plugin/Extension architecture based on VSIX manifest and MEF (Managed Extensibility Framework).
- Telemetry as a cross-cutting concern with clearly defined schema.

##### Detail, Not Overthinking
- Integration points: VSIX, AWS SDK, Telemetry, Deployment pipelines.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "IDE Host & Extension"
        VS["Visual Studio Host"]:::ide
        subgraph "AWS Toolkit VSIX Extension"
            UIExplorer["AWS Explorer UI"]:::ui
            PropertyEditor["Property Editor"]:::ui
            ContextMenu["Solution Explorer Context Menu"]:::ui
            Commands["Command Handlers"]:::logic
            Deployment["Deployment Orchestrator"]:::logic
            TelemetryModule["Telemetry Module"]:::telemetry
            Config["Configuration (version.json)"]:::config
        end
        SDK["AWS SDK for .NET"]:::sdk

        VS -->|"hosts"| UIExplorer
        VS --> Commands
        UIExplorer -->|interacts with| Commands
        PropertyEditor -->|interacts with| Commands
        ContextMenu -->|invokes| Deployment
        Commands -->|calls| SDK
        Deployment -->|calls| SDK
        TelemetryModule -->|reads definitions| Config
        Commands -->|emits events| TelemetryModule
        Deployment -->|emits events| TelemetryModule
        TelemetryModule -->|uses| SDK
    end

    subgraph "AWS Cloud"
        subgraph "AWS Services"
            EC2["EC2"]:::awsservice
            S3["S3"]:::awsservice
            DynamoDB["DynamoDB"]:::awsservice
            Lambda["Lambda"]:::awsservice
            CloudFormation["CloudFormation"]:::awsservice
            SQS["SQS"]:::awsservice
            SNS["SNS"]:::awsservice
            IAM["IAM"]:::awsservice
        end
        TelemetryEndpoint["Telemetry Endpoint"]:::awsservice
    end

    SDK -->|API calls| EC2
    SDK -->|API calls| S3
    SDK -->|API calls| DynamoDB
    SDK -->|API calls| Lambda
    SDK -->|API calls| CloudFormation
    SDK -->|API calls| SQS
    SDK -->|API calls| SNS
    SDK -->|API calls| IAM
    TelemetryModule -->|sends events| TelemetryEndpoint

    Marketplace["Visual Studio Marketplace"]:::extservice
    LocalProjects["User's .NET Projects"]:::extservice

    VS -->|"extension published to"| Marketplace
    Deployment -->|"deploys artifacts from"| LocalProjects

    click TelemetryModule "https://github.com/aws/aws-toolkit-visual-studio/blob/main/Telemetry/vs-telemetry-definitions.json"
    click Config "https://github.com/aws/aws-toolkit-visual-studio/blob/main/version.json"

    classDef ide fill:#f0f8ff,stroke:#333,stroke-width:1px
    classDef ui fill:#b3e5fc,stroke:#333
    classDef logic fill:#80deea,stroke:#333
    classDef telemetry fill:#a5d6a7,stroke:#333
    classDef config fill:#fff59d,stroke:#333
    classDef sdk fill:#ffe0b2,stroke:#333
    classDef awsservice fill:#c8e6c9,stroke:#333
    classDef extservice fill:#d7ccc8,stroke:#333
```
