@@ -113,11 +113,35 @@ Please refer to the field 'effective_labels' for all of the labels present on th
113113 Type : schema .TypeString ,
114114 },
115115 },
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+ },
116132 "limit" : {
117133 Type : schema .TypeString ,
118134 Optional : true ,
119135 Description : `Max number of PSC connections for this policy.` ,
120136 },
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+ },
121145 },
122146 },
123147 },
@@ -669,6 +693,10 @@ func flattenNetworkConnectivityServiceConnectionPolicyPscConfig(v interface{}, d
669693 transformed := make (map [string ]interface {})
670694 transformed ["subnetworks" ] =
671695 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 )
672700 transformed ["limit" ] =
673701 flattenNetworkConnectivityServiceConnectionPolicyPscConfigLimit (original ["limit" ], d , config )
674702 return []interface {}{transformed }
@@ -677,6 +705,14 @@ func flattenNetworkConnectivityServiceConnectionPolicyPscConfigSubnetworks(v int
677705 return v
678706}
679707
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+
680716func flattenNetworkConnectivityServiceConnectionPolicyPscConfigLimit (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
681717 return v
682718}
@@ -876,6 +912,20 @@ func expandNetworkConnectivityServiceConnectionPolicyPscConfig(v interface{}, d
876912 transformed ["subnetworks" ] = transformedSubnetworks
877913 }
878914
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+
879929 transformedLimit , err := expandNetworkConnectivityServiceConnectionPolicyPscConfigLimit (original ["limit" ], d , config )
880930 if err != nil {
881931 return nil , err
@@ -890,6 +940,14 @@ func expandNetworkConnectivityServiceConnectionPolicyPscConfigSubnetworks(v inte
890940 return v , nil
891941}
892942
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+
893951func expandNetworkConnectivityServiceConnectionPolicyPscConfigLimit (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
894952 return v , nil
895953}
0 commit comments