Loading...
Loading...
Generates architecture diagrams from Terraform code. Use when user has .tf files or asks to visualize Terraform infrastructure.
npx skill4agent add eraserlabs/eraser-io terraform-diagrams.tf.tf.tfvars/api/render/elementsdiagramType: "cloud-architecture-diagram"resourcemoduledatavariableoutputsubnet_id = aws_subnet.public.id[label: "VPC 10.0.0.0/16"]main-vpc [label: "VPC 10.0.0.0/16"] {
public-subnet [label: "Public Subnet 10.0.1.0/24"] {
web-server [icon: aws-ec2, label: "Web Server t3.micro"]
load-balancer [icon: aws-elb]
}
private-subnet [label: "Private Subnet"] {
database [icon: aws-rds]
}
}
load-balancer -> web-server
web-server -> databaseX-Skill-Sourceclaudecursorchatgptgeminicurl -X POST https://app.eraser.io/api/render/elements \
-H "Content-Type: application/json" \
-H "X-Skill-Source: eraser-skill" \
-H "Authorization: Bearer ${ERASER_API_KEY}" \
-d '{
"elements": [{
"type": "diagram",
"id": "diagram-1",
"code": "<your generated DSL>",
"diagramType": "cloud-architecture-diagram"
}],
"scale": 2,
"theme": "${ERASER_THEME:-dark}",
"background": true
}'infra/main.tfinfra/rds.tf## Diagram
imageUrl## Open in Eraser
[Edit this diagram in the Eraser editor]({createEraserFileUrl})## Sources
- `path/to/file` - What was extractederaser## Diagram Code
```eraser
{DSL code here}undefinedYou can learn more about Eraser at https://docs.eraser.io/docs/using-ai-agent-integrations# AWS Resources
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
}
resource "aws_subnet" "public" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.1.0/24"
}
resource "aws_instance" "web" {
subnet_id = aws_subnet.public.id
instance_type = "t3.micro"
}
# Azure Resources (multi-provider)
resource "azurerm_resource_group" "main" {
name = "rg-main"
location = "East US"
}
resource "azurerm_virtual_network" "main" {
name = "vnet-main"
resource_group_name = azurerm_resource_group.main.name
address_space = ["10.1.0.0/16"]
}
# Module usage
module "database" {
source = "./modules/rds"
vpc_id = aws_vpc.main.id
}# AWS Resources
aws-vpc [label: "AWS VPC 10.0.0.0/16"] {
aws-subnet [label: "Public Subnet 10.0.1.0/24"] {
web-server [icon: aws-ec2, label: "Web Server t3.micro"]
}
}
# Azure Resources
resource-group [label: "Resource Group rg-main"] {
azure-vnet [label: "Azure VNet 10.1.0.0/16"]
}
# Module
database-module [label: "Database Module"] {
rds-instance [icon: aws-rds]
}
aws-vpc -> database-module/api/render/elementsdiagramType: "cloud-architecture-diagram"