@@ -74,6 +74,11 @@ func resourceFWRuleV1() *schema.Resource {
7474 Optional : true ,
7575 ForceNew : true ,
7676 },
77+ "value_specs" : & schema.Schema {
78+ Type : schema .TypeMap ,
79+ Optional : true ,
80+ ForceNew : true ,
81+ },
7782 },
7883 }
7984}
@@ -90,18 +95,21 @@ func resourceFWRuleV1Create(d *schema.ResourceData, meta interface{}) error {
9095 ipVersion := resourceFWRuleV1DetermineIPVersion (d .Get ("ip_version" ).(int ))
9196 protocol := resourceFWRuleV1DetermineProtocol (d .Get ("protocol" ).(string ))
9297
93- ruleConfiguration := rules.CreateOpts {
94- Name : d .Get ("name" ).(string ),
95- Description : d .Get ("description" ).(string ),
96- Protocol : protocol ,
97- Action : d .Get ("action" ).(string ),
98- IPVersion : ipVersion ,
99- SourceIPAddress : d .Get ("source_ip_address" ).(string ),
100- DestinationIPAddress : d .Get ("destination_ip_address" ).(string ),
101- SourcePort : d .Get ("source_port" ).(string ),
102- DestinationPort : d .Get ("destination_port" ).(string ),
103- Enabled : & enabled ,
104- TenantID : d .Get ("tenant_id" ).(string ),
98+ ruleConfiguration := RuleCreateOpts {
99+ rules.CreateOpts {
100+ Name : d .Get ("name" ).(string ),
101+ Description : d .Get ("description" ).(string ),
102+ Protocol : protocol ,
103+ Action : d .Get ("action" ).(string ),
104+ IPVersion : ipVersion ,
105+ SourceIPAddress : d .Get ("source_ip_address" ).(string ),
106+ DestinationIPAddress : d .Get ("destination_ip_address" ).(string ),
107+ SourcePort : d .Get ("source_port" ).(string ),
108+ DestinationPort : d .Get ("destination_port" ).(string ),
109+ Enabled : & enabled ,
110+ TenantID : d .Get ("tenant_id" ).(string ),
111+ },
112+ MapValueSpecs (d ),
105113 }
106114
107115 log .Printf ("[DEBUG] Create firewall rule: %#v" , ruleConfiguration )
0 commit comments