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

  1. Open your project in Complinist
  2. Click Projects in the top navigation
  3. Select Import Terraform
  4. Click Choose File and select your terraform-plan.json file
  5. 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

  1. Review the resource summary
  2. Click Import to generate the topology
  3. Resources are converted to topology nodes
  4. Relationships become connections
  5. Auto-layout positions the nodes

Resource Mapping

Terraform resources are mapped to Complinist device types:

Terraform ResourceComplinist Device Type
aws_instanceVirtual Machine
aws_vpcVirtual Network
aws_subnetVirtual Network
aws_security_groupNetwork Security Group
aws_lbLoad Balancer
aws_rds_instanceSQL Database
aws_dynamodb_tableNoSQL Database
aws_s3_bucketStorage Account
aws_lambda_functionFunction 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:

  1. Organize the layout - Move devices into logical groups
  2. Add boundaries - Create security zones around device groups
  3. Edit device properties - Add additional details
  4. Generate SSP - Include the topology in your System Security Plan

See Topology Canvas for editing tips.