mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-13 10:01:08 -04:00
* add docs * add new resource ess * add examples * update aliyun go * merge master * fix ci
3.0 KiB
3.0 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| alicloud | Alicloud: alicloud_security_group_rule | docs-alicloud-resource-security-group-rule | Provides a Alicloud Security Group Rule resource. |
alicloud_security_group_rule
Provides a security group rule resource.
Represents a single ingress or egress group rule, which can be added to external Security Groups.
~> NOTE: nic_type should set to intranet when security group type is vpc. In this situation it does not distinguish between intranet and internet, the rule is effective on them both.
Example Usage
Basic Usage
resource "alicloud_security_group" "default" {
name = "default"
}
resource "alicloud_security_group_rule" "allow_all_tcp" {
type = "ingress"
ip_protocol = "tcp"
nic_type = "internet"
policy = "accept"
port_range = "1/65535"
priority = 1
security_group_id = "${alicloud_security_group.default.id}"
cidr_ip = "0.0.0.0/0"
}
Argument Reference
The following arguments are supported:
type- (Required) The type of rule being created. Valid options areingress(inbound) oregress(outbound).ip_protocol- (Required) The protocol. Can betcp,udp,icmp,greorall.port_range- (Required) The range of port numbers relevant to the IP protocol. When the protocol is tcp or udp, the default port number range is 1-65535. For example,1/200means that the range of the port numbers is 1-200.security_group_id- (Required) The security group to apply this rule to.nic_type- (Optional, Forces new resource) Network type, can be eitherinternetorintranet, the default value isinternet.policy- (Optional, Forces new resource) Authorization policy, can be eitheracceptordrop, the default value isaccept.priority- (Optional, Forces new resource) Authorization policy priority, with parameter values:1-100, default value: 1.cidr_ip- (Optional, Forces new resource) The target IP address range. The default value is 0.0.0.0/0 (which means no restriction will be applied). Other supported formats include 10.159.6.18/12. Only IPv4 is supported.source_security_group_id- (Optional, Forces new resource) The target security group ID within the same region. Either thesource_security_group_idorcidr_ipmust be set. If both are set, thencidr_ipis authorized by default. If this field is specified, but nocidr_ipis specified, thenic_typecan only selectintranet.source_group_owner_account- (Optional, Forces new resource) The Alibaba Cloud user account Id of the target security group when security groups are authorized across accounts. This parameter is invalid ifcidr_iphas already been set.
Attributes Reference
The following attributes are exported:
id- The ID of the security group ruletype- The type of rule,ingressoregressname- The name of the security groupport_range- The range of port numbersip_protocol- The protocol of the security group rule