@@ -49,11 +49,9 @@ func TestAccCloudStackNetworkACLRule_basic(t *testing.T) {
4949 resource .TestCheckResourceAttr (
5050 "cloudstack_network_acl_rule.foo" , "rule.0.protocol" , "tcp" ),
5151 resource .TestCheckResourceAttr (
52- "cloudstack_network_acl_rule.foo" , "rule.0.ports.# " , "2 " ),
52+ "cloudstack_network_acl_rule.foo" , "rule.0.port " , "443 " ),
5353 resource .TestCheckResourceAttr (
54- "cloudstack_network_acl_rule.foo" , "rule.0.ports.1" , "80" ),
55- resource .TestCheckResourceAttr (
56- "cloudstack_network_acl_rule.foo" , "rule.0.ports.0" , "443" ),
54+ "cloudstack_network_acl_rule.foo" , "rule.0.port" , "80" ),
5755 resource .TestCheckResourceAttr (
5856 "cloudstack_network_acl_rule.foo" , "rule.0.traffic_type" , "ingress" ),
5957 resource .TestCheckResourceAttr (
@@ -103,11 +101,9 @@ func TestAccCloudStackNetworkACLRule_update(t *testing.T) {
103101 resource .TestCheckResourceAttr (
104102 "cloudstack_network_acl_rule.foo" , "rule.0.protocol" , "tcp" ),
105103 resource .TestCheckResourceAttr (
106- "cloudstack_network_acl_rule.foo" , "rule.0.ports.#" , "2" ),
107- resource .TestCheckResourceAttr (
108- "cloudstack_network_acl_rule.foo" , "rule.0.ports.1" , "80" ),
104+ "cloudstack_network_acl_rule.foo" , "rule.0.port" , "443" ),
109105 resource .TestCheckResourceAttr (
110- "cloudstack_network_acl_rule.foo" , "rule.0.ports.0 " , "443 " ),
106+ "cloudstack_network_acl_rule.foo" , "rule.0.port " , "80 " ),
111107 resource .TestCheckResourceAttr (
112108 "cloudstack_network_acl_rule.foo" , "rule.0.traffic_type" , "ingress" ),
113109 resource .TestCheckResourceAttr (
@@ -140,11 +136,9 @@ func TestAccCloudStackNetworkACLRule_update(t *testing.T) {
140136 resource .TestCheckResourceAttr (
141137 "cloudstack_network_acl_rule.foo" , "rule.1.protocol" , "tcp" ),
142138 resource .TestCheckResourceAttr (
143- "cloudstack_network_acl_rule.foo" , "rule.1.ports.# " , "2 " ),
139+ "cloudstack_network_acl_rule.foo" , "rule.1.port " , "1000-2000 " ),
144140 resource .TestCheckResourceAttr (
145- "cloudstack_network_acl_rule.foo" , "rule.1.ports.0" , "1000-2000" ),
146- resource .TestCheckResourceAttr (
147- "cloudstack_network_acl_rule.foo" , "rule.1.ports.1" , "80" ),
141+ "cloudstack_network_acl_rule.foo" , "rule.1.port" , "80" ),
148142 resource .TestCheckResourceAttr (
149143 "cloudstack_network_acl_rule.foo" , "rule.1.traffic_type" , "egress" ),
150144 resource .TestCheckResourceAttr (
@@ -168,11 +162,9 @@ func TestAccCloudStackNetworkACLRule_update(t *testing.T) {
168162 resource .TestCheckResourceAttr (
169163 "cloudstack_network_acl_rule.foo" , "rule.0.protocol" , "tcp" ),
170164 resource .TestCheckResourceAttr (
171- "cloudstack_network_acl_rule.foo" , "rule.0.ports.#" , "2" ),
172- resource .TestCheckResourceAttr (
173- "cloudstack_network_acl_rule.foo" , "rule.0.ports.1" , "80" ),
165+ "cloudstack_network_acl_rule.foo" , "rule.0.port" , "443" ),
174166 resource .TestCheckResourceAttr (
175- "cloudstack_network_acl_rule.foo" , "rule.0.ports.0 " , "443 " ),
167+ "cloudstack_network_acl_rule.foo" , "rule.0.port " , "80 " ),
176168 resource .TestCheckResourceAttr (
177169 "cloudstack_network_acl_rule.foo" , "rule.0.traffic_type" , "ingress" ),
178170 ),
@@ -278,9 +270,10 @@ resource "cloudstack_network_acl_rule" "foo" {
278270 }
279271
280272 rule {
273+ action = "allow"
281274 cidr_list = ["172.16.100.0/24"]
282275 protocol = "tcp"
283- ports = [ "80", "443"]
276+ port = "80"
284277 traffic_type = "ingress"
285278 description = "Allow HTTP and HTTPS"
286279 }
@@ -324,15 +317,15 @@ resource "cloudstack_network_acl_rule" "foo" {
324317 action = "allow"
325318 cidr_list = ["172.18.100.0/24"]
326319 protocol = "tcp"
327- ports = [ "80", "443"]
320+ port = "80"
328321 traffic_type = "ingress"
329322 }
330323
331324 rule {
332325 action = "deny"
333326 cidr_list = ["10.0.0.0/24"]
334327 protocol = "tcp"
335- ports = ["80", " 1000-2000"]
328+ port = " 1000-2000"
336329 traffic_type = "egress"
337330 description = "Deny specific TCP ports"
338331 }
0 commit comments