github.com/candidpartners/terraform@v0.9.5-0.20171005231213-29f5f88820f6/examples/alicloud-security-group-rule/main.tf (about)

     1  resource "alicloud_security_group" "default" {
     2    name = "${var.security_group_name}"
     3  }
     4  
     5  resource "alicloud_security_group_rule" "http-in" {
     6    type = "ingress"
     7    ip_protocol = "tcp"
     8    nic_type = "internet"
     9    policy = "accept"
    10    port_range = "80/80"
    11    priority = 1
    12    security_group_id = "${alicloud_security_group.default.id}"
    13    cidr_ip = "0.0.0.0/0"
    14  }
    15  
    16  resource "alicloud_security_group_rule" "ssh-in" {
    17    type = "ingress"
    18    ip_protocol = "tcp"
    19    nic_type = "internet"
    20    policy = "accept"
    21    port_range = "22/22"
    22    priority = 1
    23    security_group_id = "${alicloud_security_group.default.id}"
    24    cidr_ip = "0.0.0.0/0"
    25  }