Skip to main content

servercore_domains_zone_v2

Creates and manages a zone in DNS Hosting using public API v2. For more information about zones, see the official Servercore documentation. With the zone, NS and SOA records with default values will be automatically created, you cannot edit or delete these records.

Example usage

resource "servercore_domains_zone_v2" "zone_1" {
name = "example.com."
project_id = servercore_project_v2.project_1.id
}

Argument Reference

  • name — (Required) Zone name. Changing this creates a new zone.

  • project_id — (Required) Unique identifier of the associated project. Retrieved from the servercore_vpc_project_v2 resource. Learn more about Projects.

  • comment — (Optional) Comment to add to the zone.

  • disabled — (Optional) Enables or disables the zone. Boolean flag, the default value is false.

Attributes Reference

  • created_at — Time when the zone was created in the RFC 3339 timestamp format.

  • updated_at — Time when the zone was updated in the RFC 3339 timestamp format.

  • delegation_checked_at — Time when DNS Hosting checked if the zone was delegated to Servercore NS servers in the RFC 3339 timestamp format.

  • last_check_status — Zone status retrieved during the last delegation check.

  • last_delegated_at — Equals to the delegation_check_at argument value when the last_check_status is true.

Import

You can import a zone:

export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=<username>
export OS_PASSWORD=<password>
export INFRA_PROJECT_ID=<servercore_project_id>
terraform import servercore_domains_zone_v2.zone_1 <zone_name>

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 DNS ⟶ project name ⟶ copy the ID of the required project. Learn more about Projects.

  • <zone_name> — Zone name, for example, example.com.. To get the name, in the Control panel, go to DNS. The zone name is in the Zone column.