yandex_vpc_security_group_rule (Data Source)
Статья создана
Обновлена 7 августа 2025 г.
Get information about a Yandex VPC Security Group Rule. For more information, see Yandex Cloud VPC.
Example usage
//
// Get information about existing VPC Security Group Rule.
//
data "yandex_vpc_security_group_rule" "rule1" {
security_group_binding = "my-sg-id"
rule_id = "my-rule-id"
}
This data source used to define Security Group Rule that can be used by other resources.
Argument Reference
The following arguments are supported:
security_group_binding(Required) - ID of Security Group that owns the rule.rule_id- (Required) - ID of the Security Group Rule.
Attributes Reference
The following attribute is exported:
description- Description of the rule.direction- Direction of the rule. Can beingress(inbound) oregress(outbound).labels- Labels to assign to this rule.protocol- One ofANY,TCP,UDP,ICMP,IPV6_ICMP.from_port- Minimum port number.to_port- Maximum port number.port- Port number (if applied to a single port).security_group_id- Target security group ID for this rule.predefined_target- Special-purpose targets.self_security_grouprefers to this particular security group.loadbalancer_healthchecksrepresents loadbalancer health check nodes.v4_cidr_blocks- The blocks of IPv4 addresses for this rule.v6_cidr_blocks- The blocks of IPv6 addresses for this rule.