Skip to main content

servercore_project_v2 resource

Creates and manages a project using public API v2. For more information about projects, see the official Servercore documentation.

Example usage

Project with quotas

resource "servercore_project_v2" "project_1" {
name = "project1"
quotas {
resource_name = "compute_cores"
resource_quotas {
region = "ru-3"
zone = "ru-3a"
value = 12
}
}
quotas {
resource_name = "compute_ram"
resource_quotas {
region = "ru-3"
zone = "ru-3a"
value = 20480
}
}
quotas {
resource_name = "volume_gigabytes_fast"
resource_quotas {
region = "ru-3"
zone = "ru-3a"
value = 100
}
}
}

Argument reference

  • name - (Required) Project name.

  • quotas - (Optional) Array of project quotas. Learn more from Project limits and quotas.

    • resource_name - (Required) Resource name. To get the name of the resource, use Servercore Cloud Quota Management API.

    • resource_quotas - (Required) Array of quotas for the resource.

      • region - (Optional) Pool where the resource is located, for example, ru-3. Learn more about available pools in the Availability matrix.

      • zone - (Optional) Pool segment where the resource is located, for example, ru-3a. Learn more about available pool segments in the Availability matrix.

      • value - (Required) Quota value. The value cannot exceed the project limit. To get the project limit, in the Control panel, go to Cloud PlatformQuotas. The project limit for the resource is in the Quota column. Learn more about Project limits and quotas.

  • theme - (Optional) Additional theme settings for the external panel.

    • color - (Optional) Fill color of the toolbar in hex format.

    • logo - (Optional) URL of the logo on the toolbar.

Attributes reference

  • url - Project URL. Created automatically and cannot be changed.

  • enabled - Project status. Possible values are active and disabled.

  • all_quotas - List of quotas. Can differ from the values set in the quotas block if all available quotas for the project are applied automatically.

Import

You can import a project:

export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=<username>
export OS_PASSWORD=<password>
terraform import servercore_project_v2.project_1 <project_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> — Service user name. 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> — Service user password.

  • <project_id> — Unique project identifier, for example, a07abc12310546f1b9291ab3013a7d75. To get the ID, in the Control panel, go to Cloud Platform ⟶ project name ⟶ copy the ID of the required project.