Provides a Sag qos policy resource. You need to create a QoS policy to set priorities, rate limits, and quintuple rules for different messages.
For information about Sag Qos Policy and how to use it, see What is Qos Policy.
Basic Usage
variable "name" {
default = "tf-example"
}
provider "alicloud" {
region = "cn-shanghai"
}
resource "alicloud_sag_qos" "default" {
name = var.name
}
resource "alicloud_sag_qos_policy" "default" {
qos_id = alicloud_sag_qos.default.id
name = var.name
description = var.name
priority = "1"
ip_protocol = "ALL"
source_cidr = "192.168.0.0/24"
source_port_range = "-1/-1"
dest_cidr = "10.10.0.0/24"
dest_port_range = "-1/-1"
start_time = replace(timestamp(), "Z", "+0800")
end_time = replace(timeadd(timestamp(), "24h"), "Z", "+0800")
}
The following arguments are supported:
qos_id
- (Required) The instance ID of the QoS policy to which the quintuple rule is created.name
- (Optional) The name of the QoS policy.description
- (Optional) The description of the QoS policy.priority
- (Required) The priority of the quintuple rule. A smaller value indicates a higher priority. If the priorities of two quintuple rules are the same, the rule created earlier is applied first.Value range: 1 to 7.ip_protocol
- (Required) The transport layer protocol.source_cidr
- (Required) The source CIDR block.source_port_range
- (Required) The source port range of the transport layer.dest_cidr
- (Required) The destination CIDR block.dest_port_range
- (Required) The destination port range.start_time
- (Optional) The time when the quintuple rule takes effect.end_time
- (Optional) The expiration time of the quintuple rule. The following attributes are exported:
id
- The ID of the Qos Policy id and formates as <qos_id>:<qos_policy_id>
.The Sag Qos Policy can be imported using the id, e.g.
$ terraform import alicloud_sag_qos_policy.example qos-abc123456:qospy-abc123456