2017-01-19 15:08:56 +01:00
|
|
|
resource "alicloud_security_group" "default" {
|
|
|
|
name = "${var.security_group_name}"
|
|
|
|
}
|
|
|
|
|
2017-03-24 12:04:56 +01:00
|
|
|
resource "alicloud_security_group_rule" "http-in" {
|
2017-01-19 15:08:56 +01:00
|
|
|
type = "ingress"
|
|
|
|
ip_protocol = "tcp"
|
2017-03-24 12:04:56 +01:00
|
|
|
nic_type = "internet"
|
2017-01-19 15:08:56 +01:00
|
|
|
policy = "accept"
|
2017-03-24 12:04:56 +01:00
|
|
|
port_range = "80/80"
|
|
|
|
priority = 1
|
|
|
|
security_group_id = "${alicloud_security_group.default.id}"
|
|
|
|
cidr_ip = "0.0.0.0/0"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "alicloud_security_group_rule" "ssh-in" {
|
|
|
|
type = "ingress"
|
|
|
|
ip_protocol = "tcp"
|
|
|
|
nic_type = "internet"
|
|
|
|
policy = "accept"
|
|
|
|
port_range = "22/22"
|
2017-01-19 15:08:56 +01:00
|
|
|
priority = 1
|
|
|
|
security_group_id = "${alicloud_security_group.default.id}"
|
|
|
|
cidr_ip = "0.0.0.0/0"
|
|
|
|
}
|