Resource
dcloud_security_group_rule
One inbound or outbound rule of a security group.
Example Usage
resource "dcloud_security_group_rule" "https" {
security_group_id = dcloud_security_group.web.id
direction = "inbound"
protocol = "tcp"
from_port = 443
to_port = 443
cidr_ipv4 = "0.0.0.0/0"
description = "HTTPS"
}Schema
Required
direction(String)inboundoroutbound. One of:inbound,outbound. Changing it replaces the resource.protocol(String) The IP protocol the rule matches One of:tcp,udp,icmp. Changing it replaces the resource.security_group_id(String) The id of the parent resource ({id}in the path). Changing it replaces the resource.
Optional
cidr_ipv4(String) Where traffic may come from: a CIDR block or a single address (IPv4 or IPv6); default 0.0.0.0/0. Default0.0.0.0/0. Changing it replaces the resource.description(String) Free text; omitted: none. Up to 255 characters. Changing it replaces the resource.from_port(Number) First port of the range; omitted: every port. Ignored for ICMP. From 0 to 65535. Changing it replaces the resource.to_port(Number) Last port of the range; omitted: fromPort alone. From 0 to 65535. Changing it replaces the resource.
Read-Only
id(String) The resource's id.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
terraform import dcloud_security_group_rule.https <security-group-id>/<rule-id>Generated from the provider's schema.
Related