Up-to-date reference of API arguments for HSS host protection you can get at documentation portal.

opentelekomcloud_hss_host_protection_v5

Manages an HSS host protection resource within OpenTelekomCloud.

Example Usage

variable "host_id" {}

resource "opentelekomcloud_hss_host_protection_v5" "pro" {
  host_id                = var.host_id
  version                = "hss.version.premium"
  charging_mode          = "on_demand"
  is_wait_host_available = true
}

Argument Reference

The following arguments are supported:

  • host_id - (Required, String, ForceNew) Specifies the host ID for the host protection. Changing this parameter will create a new resource.

    -> Before using host protection, it is necessary to ensure that the agent status of the host is online.

  • version - (Required, String) Specifies the protection version enabled by the host. The valid values are as follows:

    • hss.version.enterprise: Enterprise version.

    • hss.version.premium: Ultimate version.

  • charging_mode - (Required, String) Specifies the charging mode for host protection. The valid values are as follows:

    • on_demand: The pay-per-use billing mode.

  • resource_id - (Optional, String) Specifies Instance ID for host protection.

  • is_wait_host_available - (Optional, Bool) Specifies whether to wait for the host agent status to become online. The value can be true or false. Defaults to false.

    -> If this field is set to true, the program will wait for a maximum of 30 minutes until the host's agent status becomes online, and then enable host protection.

Attribute Reference

In addition to all arguments above, the following attributes are exported:

  • id - The resource ID same as host_id.

  • host_name - The host name.

  • host_status - The host status. The value can be ACTIVE, SHUTOFF, BUILDING, or ERROR.

  • private_ip - The private IP address of the host.

  • agent_id - The agent ID installed on the host.

  • agent_status - The agent status of the host. The value can be installed, not_installed, online, offline, install_failed, or installing.

  • os_type - The operating system type of the host. The value can be Linux or Windows.

  • status - The protection status of the host. The value can be closed or opened.

  • detect_result - The security detection result of the host. The value can be undetected, clean, risk, or scanning.

  • asset_value - The asset importance. The value can be important, common, or test.

  • region - The region to which the HSS host protection resource belongs.

Timeouts

This resource provides the following timeouts configuration options:

  • create - Default is 30 minutes.

Import

The host protection can be imported using the id, e.g.

$ terraform import opentelekomcloud_hss_host_protection_v5.pro <id>

Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response, security or some other reason. The missing attributes include: resource_id, is_wait_host_available. It is generally recommended running terraform plan after importing a resource. You can then decide if changes should be applied to the resource, or the resource definition should be updated to align with the resource. Also, you can ignore changes as below.

resource "opentelekomcloud_hss_host_protection_v5" "pro" {
  lifecycle {
    ignore_changes = [
      quota_id, is_wait_host_available,
    ]
  }
}