Managing your networks and subnets
Creating a new VPC network
- CLI
- UI
- Terraform
Use the networking vpc-networks create command to create a new VPC network.
crusoe networking vpc-networks create \
--name my-new-vpc-network \
--cidr 10.0.0.0/8
To create a VPC network via the console:
- From the console, select Networking > VPC Networks in the left nav.
- Click Create VPC Network.
- Input a name and CIDR range for the VPC Network.
- Click Create.
To create a VPC network using the Crusoe Terraform provider, you can use the following code snippet:
terraform {
required_providers {
crusoe = {
source = "registry.terraform.io/crusoecloud/crusoe"
}
}
}
resource "crusoe_vpc_network" "my_vpc_network" {
name = "my-new-network"
cidr = "10.0.0.0/8"
}
"name" and "cidr" required arguments for the VPC network resource in the Crusoe Terraform provider.
Viewing all VPC networks
- CLI
- UI
- Terraform
Use the networking vpc-networks list command to list existing networks.
crusoe networking vpc-networks list
To view networks via the console, select Networking > VPC Networks in the left nav.
To list existing VPC networks using Terraform, the following code snippet can be used to populate a Terraform data source using the Crusoe Terraform provider.
# list vpc networks
data "crusoe_vpc_networks" "networks" {}
output "crusoe_vpc_networks" {
value = data.crusoe_vpc_networks.networks
}
Update an existing VPC network
- CLI
- UI
- Terraform
Non-default VPC networks can be updated in the CLI using the networking vpc-networks update <id> command. Currently, only the name of the non-default VPC network can be updated (using the --name flag).
To update an existing non-default VPC network via the console:
- From the console, select Networking > VPC Networks in the left nav.
- Navigate to the row of the VPC network you want to update.
- Click the pencil icon on the far right side of the row.
- Edit the fields you want to modify.
- Click Update to save your changes.
To update a VPC network using the Crusoe Terraform provider, you can change the fields of an existing VPC network resource and run terraform apply. The Crusoe Terraform provider will apply the changes to the VPC network.
terraform {
required_providers {
crusoe = {
source = "registry.terraform.io/crusoecloud/crusoe"
}
}
}
resource "crusoe_vpc_network" "my_vpc_network" {
name = "my-new-network" -> "new-network-name"
cidr = "10.0.0.0/8"
}
Currently, only the "name" of the VPC network can be updated. Changes to the "cidr" of the VPC network will force a re-creation of the VPC network (deletion and then creation of a new network)
Deleting a VPC network
Warning: deleting a VPC network is a permanant action that will require re-creation of the network to recover.
- CLI
- UI
- Terraform
Non-default VPC Networks can be deleted in the CLI using the networking vpc-networks delete <id> command.
To delete a VPC network via the console:
- From the console, select Networking > VPC Networks in the left nav.
- Navigate to the row of the VPC Network you want to delete.
- Click the trash can icon on the far right side of the row.
- Click Confirm.
A VPC network can be deleted by using the terraform destroy command provided by the Terraform CLI tool.
If you are having issues working with your VPC networks, please contact support.