# Cloud diagrams

Cloud diagrams are AI diagrams generated from a connected cloud environment. Reference an AWS account, an Azure subscription, or a Google Cloud project in AI chat, describe what you want, and Eraser draws it from the infrastructure it found in the last scan – not from a description of what should be there.

## Before you start

* A cloud environment has to be connected and **Active** in **Settings → Cloud connect**. Each provider has its own walkthrough: [AWS](/connecting-aws), [Azure](/connecting-azure), or [Google Cloud](/connecting-google-cloud).
* The first scan starts when you connect and takes a minute or two. Until it finishes, the environment cannot be used in a prompt.

## Generating a cloud diagram

### 1. Open AI chat

A new chat opens on the screen below. Leave the prompt box empty for now – the reference menu only opens from an empty prompt.

<Figure src="/assets/cloud-diagrams-ai-chat.png" alt="The AI chat starting screen, with six diagram types to choose from and an empty prompt box" width="440px" border />

### 2. Add a cloud environment

Press `/` to open the reference menu, then choose **Cloud environments** under **Add Reference**.

<Figure src="/assets/cloud-diagrams-add-reference.png" alt="The Add Reference menu, with Cloud environments highlighted" width="440px" border />

### 3. Pick the environment

Each entry is one AWS account, one Azure subscription, or one Google Cloud project. A connection that covers several – an AWS organization, an Azure tenant, a set of Google Cloud projects – lists each one separately, with the connection it belongs to underneath.

<Figure src="/assets/cloud-diagrams-pick-environment.png" alt="The Cloud environments list, showing three Azure subscriptions from one tenant" width="440px" border />

Only connections that are **Active** in **Settings → Cloud connect** are listed. If the list is empty, nothing is connected yet.

To include more than one environment, press `/` again and pick another. Each one appears as a chip above the prompt.

### 4. Describe what you want

Type your prompt and send it. Eraser reads the environment and draws the diagram.

<Figure src="/assets/cloud-diagrams-prompt.png" alt="A prompt with the web-geo subscription attached, asking for an architecture diagram of the subscription" width="440px" border />

## What to ask for

Ask for the whole environment, or for one part of it. Naming what you are after gives the best results:

* "Create an architecture diagram of this Azure subscription"
* "Draw the VPC that contains the `orders` service, with its subnets and load balancers"
* "Diagram the `checkout` workload – everything it talks to, and everything that talks to it"
* "Draw everything deployed in `us-east-1`"
* "Show the network topology: VNets, peerings, and private endpoints"
* "Diagram the data stores in this project and which services connect to them"
* "Show what has access to the production database"

## How Eraser reads the environment

Eraser reads the newest scan of the environment, not the live account. There is no scheduled background scan, so before generating a diagram that should reflect something you just deployed, choose **Rescan** in **Settings → Cloud connect**.

Several environments can be attached to one prompt – two subscriptions, or an account and a project. Eraser reads each one and draws them together.

## Refining the result

Keep prompting to change the result – add a service, drop a region, group things differently. [AI presets](/ai-presets) and [custom styles](/custom-styles) apply to cloud diagrams the same way they do to any other AI diagram: add them from the same `/` menu.

You can also ask for a document instead of a diagram – an inventory of what is deployed, or a description of how a workload is wired up – with the same environment attached.

## Troubleshooting

| What Eraser says | What it means |
|---|---|
| … is still being scanned for the first time. Try again in a minute. | The first scan is running. Wait for it to finish, then send the prompt again. |
| No scan has been run for … yet. Run a scan of the account, then try again. | No scan has completed. Open **Settings → Cloud connect** and choose **Rescan**. |
| … is not connected. Reconnect the account, then try again. | The credential no longer works – usually the role, app registration, or service account was removed. Reconnect the environment. |
| Scanning is turned off for …. Turn it back on, then try again. | The connection is set to **Inactive**. Set it back to **Active** in **Settings → Cloud connect**. |
| Connect a cloud account to reference live infrastructure. | The Cloud environments list is empty: nothing is connected, or every connection is inactive. Choose **Add cloud connection**, or reactivate one. |
