Skip to main content
Crusoe Support Help Center home page
Crusoe

Terraform Failure While Creating Network Resources

Chinmay Baikar
Chinmay Baikar
Updated

Last Updated: Jan 12, 2026

Overview

While trying to create a VPC, subnet and firewall rules using terraform, the operation fails on subnet and firewall creation, but the VPC network gets created successfully. The following error is observed:

│ Error: Failed to create VPC Subnet
│
│ with crusoe_vpc_subnet.test_vpc_subnet,
│ on main.tf line 22, in resource "crusoe_vpc_subnet" "test_vpc_subnet":
│ 22: resource "crusoe_vpc_subnet" "test_vpc_subnet" {
│
│ There was an error starting a create VPC Subnet operation (453cd9af-c2c5-4e71-a815-bddf560cc2b2): an internal server error occurred

Prerequisites

  • Terraform installed (version 1.0+ recommended) – Download Terraform
  • Crusoe Terraform Provider (version >= 0.5.27)
  • Access to a Crusoe Cloud project with appropriate permissions

Step-by-Step Instructions

Currently, its not possible for the Crusoe terraform provider to create subnets and firewall rules concurrently because both resources try to acquire a lease on the same VPC resource. To achieve this perform the below steps

Step 1: Modify terraform to add a depends_on property to the subnet and firewall rule resource

resource "crusoe_vpc_network" "test_vpc_network" {
  name = "my-new-network"
  cidr = "10.0.0.0/8"
}

resource "crusoe_vpc_subnet" "test_vpc_subnet" {
  name = "test-new-subnet"
  cidr = "10.0.0.0/16"
  location = "us-northcentral1-a"
  network = crusoe_vpc_network.test_vpc_network.id
  depends_on = [crusoe_vpc_network.test_vpc_subnet]
}

resource "crusoe_vpc_firewall_rule" "open_fw_rule" {
  network = crusoe_vpc_network.test_vpc_network.id
  name = "example-terraform-rule"
  action = "allow"
  direction = "ingress"
  protocols = "tcp"
  source = "0.0.0.0/0"
  source_ports = "1-65535"
  destination = crusoe_vpc_network.test_vpc_network.cidr
  destination_ports = "1-65535"
  depends_on = [crusoe_vpc_subnet.test_vpc_subnet]
}

Step 2: Re-run terraform apply

Terraform apply

Additional Resources

Related to

Was this article helpful?

0 out of 0 found this helpful

Still need help?

Our support team is ready to assist you with any questions.

Have more questions? Submit a request

Recently Viewed

Comments

0 comments

Article is closed for comments.