Terraform Import
Automatically generate network topology diagrams from your Terraform infrastructure-as-code.
Overview
The Terraform import feature:
- Parses Terraform plan JSON files
- Identifies resources and their relationships
- Generates topology nodes for each resource
- Creates connections based on dependencies
- Maps resources to appropriate device types
Supported Providers
AWS (Primary Support)
40+ resource types including:
- Compute: EC2, Lambda, ECS, EKS, Batch
- Networking: VPC, Subnets, Security Groups, Load Balancers, Gateways
- Database: RDS, DynamoDB, ElastiCache, Redshift
- Storage: S3, EBS, EFS, Glacier
Azure (Supported)
- Virtual Networks
- Virtual Machines
- Storage Accounts
- App Services
- And more...
Step 1: Generate Terraform Plan JSON
First, generate a JSON-formatted plan from your Terraform configuration:
# Navigate to your Terraform directory cd /path/to/terraform # Initialize Terraform (if not already done) terraform init # Create a plan file terraform plan -out=plan.tfplan # Convert plan to JSON format terraform show -json plan.tfplan > terraform-plan.json
Important: You must use the
-json flag with terraform show to generate the required JSON format.Step 2: Import into Complinist
- Open your project in Complinist
- Click Projects in the top navigation
- Select Import Terraform
- Click Choose File and select your
terraform-plan.jsonfile - Wait for the plan to be parsed
Step 3: Review Import Preview
Before importing, you'll see a preview showing:
Resource Summary
- Total resources found
- Resources by type (compute, network, storage, etc.)
- Changes detected (create, update, delete)
Detected Relationships
- Network dependencies (VPC → Subnet → Instance)
- Security group associations
- Load balancer targets
Step 4: Complete the Import
- Review the resource summary
- Click Import to generate the topology
- Resources are converted to topology nodes
- Relationships become connections
- Auto-layout positions the nodes
Resource Mapping
Terraform resources are mapped to Complinist device types:
| Terraform Resource | Complinist Device Type |
|---|---|
aws_instance | Virtual Machine |
aws_vpc | Virtual Network |
aws_subnet | Virtual Network |
aws_security_group | Network Security Group |
aws_lb | Load Balancer |
aws_rds_instance | SQL Database |
aws_dynamodb_table | NoSQL Database |
aws_s3_bucket | Storage Account |
aws_lambda_function | Function App |
Best Practices
1. Use Descriptive Tags
Add Name tags to your Terraform resources for better visualization:
resource "aws_instance" "web" {
ami = "ami-12345678"
instance_type = "t3.medium"
tags = {
Name = "Web Server"
Environment = "Production"
Tier = "Frontend"
}
}2. Generate Fresh Plans
Always generate a new plan before importing to ensure accuracy.
3. Review Before Import
Check the preview for correct resource counts and expected mappings.
4. Adjust Layout After Import
Auto-layout provides a starting point. You may want to organize devices into logical groups and add security boundaries.
After Import
Once imported, you can:
- Organize the layout - Move devices into logical groups
- Add boundaries - Create security zones around device groups
- Edit device properties - Add additional details
- Generate SSP - Include the topology in your System Security Plan
See Topology Canvas for editing tips.