@@ -127,6 +127,12 @@ Example inputs include: ["22"], ["80","443"], and ["12345-12349"].`,
127
127
Type : schema .TypeString ,
128
128
},
129
129
},
130
+ "dest_network_scope" : {
131
+ Type : schema .TypeString ,
132
+ Optional : true ,
133
+ ValidateFunc : verify .ValidateEnum ([]string {"INTERNET" , "INTRA_VPC" , "NON_INTERNET" , "VPC_NETWORKS" , "" }),
134
+ Description : `Network scope of the traffic destination. Possible values: ["INTERNET", "INTRA_VPC", "NON_INTERNET", "VPC_NETWORKS"]` ,
135
+ },
130
136
"dest_region_codes" : {
131
137
Type : schema .TypeList ,
132
138
Optional : true ,
@@ -167,6 +173,20 @@ Example inputs include: ["22"], ["80","443"], and ["12345-12349"].`,
167
173
Type : schema .TypeString ,
168
174
},
169
175
},
176
+ "src_network_scope" : {
177
+ Type : schema .TypeString ,
178
+ Optional : true ,
179
+ ValidateFunc : verify .ValidateEnum ([]string {"INTERNET" , "INTRA_VPC" , "NON_INTERNET" , "VPC_NETWORKS" , "" }),
180
+ Description : `Network scope of the traffic source. Possible values: ["INTERNET", "INTRA_VPC", "NON_INTERNET", "VPC_NETWORKS"]` ,
181
+ },
182
+ "src_networks" : {
183
+ Type : schema .TypeList ,
184
+ Optional : true ,
185
+ Description : `Networks of the traffic source. It can be either a full or partial url.` ,
186
+ Elem : & schema.Schema {
187
+ Type : schema .TypeString ,
188
+ },
189
+ },
170
190
"src_region_codes" : {
171
191
Type : schema .TypeList ,
172
192
Optional : true ,
@@ -719,6 +739,12 @@ func flattenComputeFirewallPolicyRuleMatch(v interface{}, d *schema.ResourceData
719
739
flattenComputeFirewallPolicyRuleMatchSrcIpRanges (original ["srcIpRanges" ], d , config )
720
740
transformed ["dest_ip_ranges" ] =
721
741
flattenComputeFirewallPolicyRuleMatchDestIpRanges (original ["destIpRanges" ], d , config )
742
+ transformed ["src_network_scope" ] =
743
+ flattenComputeFirewallPolicyRuleMatchSrcNetworkScope (original ["srcNetworkScope" ], d , config )
744
+ transformed ["src_networks" ] =
745
+ flattenComputeFirewallPolicyRuleMatchSrcNetworks (original ["srcNetworks" ], d , config )
746
+ transformed ["dest_network_scope" ] =
747
+ flattenComputeFirewallPolicyRuleMatchDestNetworkScope (original ["destNetworkScope" ], d , config )
722
748
transformed ["layer4_configs" ] =
723
749
flattenComputeFirewallPolicyRuleMatchLayer4Configs (original ["layer4Configs" ], d , config )
724
750
transformed ["dest_address_groups" ] =
@@ -747,6 +773,18 @@ func flattenComputeFirewallPolicyRuleMatchDestIpRanges(v interface{}, d *schema.
747
773
return v
748
774
}
749
775
776
+ func flattenComputeFirewallPolicyRuleMatchSrcNetworkScope (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
777
+ return v
778
+ }
779
+
780
+ func flattenComputeFirewallPolicyRuleMatchSrcNetworks (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
781
+ return v
782
+ }
783
+
784
+ func flattenComputeFirewallPolicyRuleMatchDestNetworkScope (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
785
+ return v
786
+ }
787
+
750
788
func flattenComputeFirewallPolicyRuleMatchLayer4Configs (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
751
789
if v == nil {
752
790
return v
@@ -886,6 +924,27 @@ func expandComputeFirewallPolicyRuleMatch(v interface{}, d tpgresource.Terraform
886
924
transformed ["destIpRanges" ] = transformedDestIpRanges
887
925
}
888
926
927
+ transformedSrcNetworkScope , err := expandComputeFirewallPolicyRuleMatchSrcNetworkScope (original ["src_network_scope" ], d , config )
928
+ if err != nil {
929
+ return nil , err
930
+ } else if val := reflect .ValueOf (transformedSrcNetworkScope ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
931
+ transformed ["srcNetworkScope" ] = transformedSrcNetworkScope
932
+ }
933
+
934
+ transformedSrcNetworks , err := expandComputeFirewallPolicyRuleMatchSrcNetworks (original ["src_networks" ], d , config )
935
+ if err != nil {
936
+ return nil , err
937
+ } else if val := reflect .ValueOf (transformedSrcNetworks ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
938
+ transformed ["srcNetworks" ] = transformedSrcNetworks
939
+ }
940
+
941
+ transformedDestNetworkScope , err := expandComputeFirewallPolicyRuleMatchDestNetworkScope (original ["dest_network_scope" ], d , config )
942
+ if err != nil {
943
+ return nil , err
944
+ } else if val := reflect .ValueOf (transformedDestNetworkScope ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
945
+ transformed ["destNetworkScope" ] = transformedDestNetworkScope
946
+ }
947
+
889
948
transformedLayer4Configs , err := expandComputeFirewallPolicyRuleMatchLayer4Configs (original ["layer4_configs" ], d , config )
890
949
if err != nil {
891
950
return nil , err
@@ -960,6 +1019,18 @@ func expandComputeFirewallPolicyRuleMatchDestIpRanges(v interface{}, d tpgresour
960
1019
return v , nil
961
1020
}
962
1021
1022
+ func expandComputeFirewallPolicyRuleMatchSrcNetworkScope (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1023
+ return v , nil
1024
+ }
1025
+
1026
+ func expandComputeFirewallPolicyRuleMatchSrcNetworks (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1027
+ return v , nil
1028
+ }
1029
+
1030
+ func expandComputeFirewallPolicyRuleMatchDestNetworkScope (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1031
+ return v , nil
1032
+ }
1033
+
963
1034
func expandComputeFirewallPolicyRuleMatchLayer4Configs (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
964
1035
l := v .([]interface {})
965
1036
req := make ([]interface {}, 0 , len (l ))
0 commit comments