Skip to main content

Ресурс servercore_dedicated_private_subnet_v1

Creates and manages a private subnet for dedicated servers using public API v1. Learn how to assign a private IP address to a dedicated server.

Example usage

resource "servercore_dedicated_private_subnet_v1" "private_subnet_1" {
location_id = data.servercore_dedicated_location_v1.server_location.locations[0].id
vlan = "1000"
subnet = "192.168.100.0/24"
}

Argument Reference

  • location_id — (Required) Unique identifier of the location where the private subnet will be created. Retrieved from the servercore_dedicated_location_v1 data source.

  • vlan — (Required) Unique identifier of the VLAN for the private subnet. To get the unique identifier of the VLAN, in the Control panel, go to ProductsDedicated ServersServers ⟶ servers page ⟶ in the Private block, select a private subnet → copy the ID in the VLAN field.

  • subnet — (Required) CIDR block for the private subnet. Must be within private IP ranges: 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16. Lern more about Private networks and subnets of the dedicated server.

Attributes Reference

Import

You can import a private subnet:

export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=<username>
export OS_PASSWORD=<password>
export INFRA_PROJECT_ID=<servercore_project_id>
terraform import servercore_dedicated_private_subnet_v1.subnet_1 <subnet_id>

where:

  • <account_id> — Servercore account ID. The account ID is in the top right corner of the Control panel. Learn more about Registration.

  • <username> — Name of the service user. To get the name, in the Control panel, go to Identity & Access ManagementUser management ⟶ the Service users tab ⟶ copy the name of the required user. Learn more about Service users.

  • <password> — Password of the service user.

  • <servercore_project_id> — Unique identifier of the associated project. To get the ID, in the Control panel, go to ProductsDedicated Servers ⟶ project name ⟶ Project management ⟶ copy the ID of the required project. Learn more about Projects.

  • <subnet_id> — Unique identifier of the private subnet.