@@ -113,11 +113,35 @@ Please refer to the field 'effective_labels' for all of the labels present on th
113
113
Type : schema .TypeString ,
114
114
},
115
115
},
116
+ "allowed_google_producers_resource_hierarchy_level" : {
117
+ Type : schema .TypeList ,
118
+ Optional : true ,
119
+ Description : `List of Projects, Folders, or Organizations from where the Producer instance can be within. For example,
120
+ a network administrator can provide both 'organizations/foo' and 'projects/bar' as
121
+ allowed_google_producers_resource_hierarchy_levels. This allowlists this network to connect with any Producer
122
+ instance within the 'foo' organization or the 'bar' project. By default,
123
+ allowedGoogleProducersResourceHierarchyLevel is empty. The format for each
124
+ allowedGoogleProducersResourceHierarchyLevel is / where is one of 'projects', 'folders', or 'organizations'
125
+ and is either the ID or the number of the resource type. Format for each
126
+ allowedGoogleProducersResourceHierarchyLevel value: 'projects/' or 'folders/' or 'organizations/' Eg.
127
+ [projects/my-project-id, projects/567, folders/891, organizations/123]` ,
128
+ Elem : & schema.Schema {
129
+ Type : schema .TypeString ,
130
+ },
131
+ },
116
132
"limit" : {
117
133
Type : schema .TypeString ,
118
134
Optional : true ,
119
135
Description : `Max number of PSC connections for this policy.` ,
120
136
},
137
+ "producer_instance_location" : {
138
+ Type : schema .TypeString ,
139
+ Computed : true ,
140
+ Optional : true ,
141
+ ValidateFunc : verify .ValidateEnum ([]string {"PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" , "CUSTOM_RESOURCE_HIERARCHY_LEVELS" , "" }),
142
+ Description : `ProducerInstanceLocation is used to specify which authorization mechanism to use to determine which projects
143
+ the Producer instance can be within. Possible values: ["PRODUCER_INSTANCE_LOCATION_UNSPECIFIED", "CUSTOM_RESOURCE_HIERARCHY_LEVELS"]` ,
144
+ },
121
145
},
122
146
},
123
147
},
@@ -669,6 +693,10 @@ func flattenNetworkConnectivityServiceConnectionPolicyPscConfig(v interface{}, d
669
693
transformed := make (map [string ]interface {})
670
694
transformed ["subnetworks" ] =
671
695
flattenNetworkConnectivityServiceConnectionPolicyPscConfigSubnetworks (original ["subnetworks" ], d , config )
696
+ transformed ["producer_instance_location" ] =
697
+ flattenNetworkConnectivityServiceConnectionPolicyPscConfigProducerInstanceLocation (original ["producerInstanceLocation" ], d , config )
698
+ transformed ["allowed_google_producers_resource_hierarchy_level" ] =
699
+ flattenNetworkConnectivityServiceConnectionPolicyPscConfigAllowedGoogleProducersResourceHierarchyLevel (original ["allowedGoogleProducersResourceHierarchyLevel" ], d , config )
672
700
transformed ["limit" ] =
673
701
flattenNetworkConnectivityServiceConnectionPolicyPscConfigLimit (original ["limit" ], d , config )
674
702
return []interface {}{transformed }
@@ -677,6 +705,14 @@ func flattenNetworkConnectivityServiceConnectionPolicyPscConfigSubnetworks(v int
677
705
return v
678
706
}
679
707
708
+ func flattenNetworkConnectivityServiceConnectionPolicyPscConfigProducerInstanceLocation (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
709
+ return v
710
+ }
711
+
712
+ func flattenNetworkConnectivityServiceConnectionPolicyPscConfigAllowedGoogleProducersResourceHierarchyLevel (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
713
+ return v
714
+ }
715
+
680
716
func flattenNetworkConnectivityServiceConnectionPolicyPscConfigLimit (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
681
717
return v
682
718
}
@@ -876,6 +912,20 @@ func expandNetworkConnectivityServiceConnectionPolicyPscConfig(v interface{}, d
876
912
transformed ["subnetworks" ] = transformedSubnetworks
877
913
}
878
914
915
+ transformedProducerInstanceLocation , err := expandNetworkConnectivityServiceConnectionPolicyPscConfigProducerInstanceLocation (original ["producer_instance_location" ], d , config )
916
+ if err != nil {
917
+ return nil , err
918
+ } else if val := reflect .ValueOf (transformedProducerInstanceLocation ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
919
+ transformed ["producerInstanceLocation" ] = transformedProducerInstanceLocation
920
+ }
921
+
922
+ transformedAllowedGoogleProducersResourceHierarchyLevel , err := expandNetworkConnectivityServiceConnectionPolicyPscConfigAllowedGoogleProducersResourceHierarchyLevel (original ["allowed_google_producers_resource_hierarchy_level" ], d , config )
923
+ if err != nil {
924
+ return nil , err
925
+ } else if val := reflect .ValueOf (transformedAllowedGoogleProducersResourceHierarchyLevel ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
926
+ transformed ["allowedGoogleProducersResourceHierarchyLevel" ] = transformedAllowedGoogleProducersResourceHierarchyLevel
927
+ }
928
+
879
929
transformedLimit , err := expandNetworkConnectivityServiceConnectionPolicyPscConfigLimit (original ["limit" ], d , config )
880
930
if err != nil {
881
931
return nil , err
@@ -890,6 +940,14 @@ func expandNetworkConnectivityServiceConnectionPolicyPscConfigSubnetworks(v inte
890
940
return v , nil
891
941
}
892
942
943
+ func expandNetworkConnectivityServiceConnectionPolicyPscConfigProducerInstanceLocation (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
944
+ return v , nil
945
+ }
946
+
947
+ func expandNetworkConnectivityServiceConnectionPolicyPscConfigAllowedGoogleProducersResourceHierarchyLevel (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
948
+ return v , nil
949
+ }
950
+
893
951
func expandNetworkConnectivityServiceConnectionPolicyPscConfigLimit (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
894
952
return v , nil
895
953
}
0 commit comments