@@ -134,6 +134,10 @@ func resourceSecurityGroup() *schema.Resource {
134
134
Type : schema .TypeString ,
135
135
Optional : true ,
136
136
},
137
+ "remote_ip_prefix" : & schema.Schema {
138
+ Type : schema .TypeString ,
139
+ Optional : true ,
140
+ },
137
141
"updated_at" : & schema.Schema {
138
142
Type : schema .TypeString ,
139
143
Computed : true ,
@@ -187,6 +191,7 @@ func resourceSecurityGroupCreate(ctx context.Context, d *schema.ResourceData, m
187
191
portRangeMax := rule ["port_range_max" ].(int )
188
192
portRangeMin := rule ["port_range_min" ].(int )
189
193
descr := rule ["description" ].(string )
194
+ remoteIPPrefix := rule ["remote_ip_prefix" ].(string )
190
195
191
196
sgrOpts := securitygroups.CreateSecurityGroupRuleOpts {
192
197
Direction : types .RuleDirection (rule ["direction" ].(string )),
@@ -195,6 +200,10 @@ func resourceSecurityGroupCreate(ctx context.Context, d *schema.ResourceData, m
195
200
Description : & descr ,
196
201
}
197
202
203
+ if remoteIPPrefix != "" {
204
+ sgrOpts .RemoteIPPrefix = & remoteIPPrefix
205
+ }
206
+
198
207
if portRangeMax != 0 && portRangeMin != 0 {
199
208
sgrOpts .PortRangeMax = & portRangeMax
200
209
sgrOpts .PortRangeMin = & portRangeMin
@@ -275,6 +284,10 @@ func resourceSecurityGroupRead(ctx context.Context, d *schema.ResourceData, m in
275
284
r ["description" ] = * sgr .Description
276
285
}
277
286
287
+ if sgr .RemoteIPPrefix != nil {
288
+ r ["remote_ip_prefix" ] = * sgr .RemoteIPPrefix
289
+ }
290
+
278
291
r ["updated_at" ] = sgr .UpdatedAt .String ()
279
292
r ["created_at" ] = sgr .CreatedAt .String ()
280
293
0 commit comments