Skip to content

Commit 64523dc

Browse files
Adds connectedProjects field to resource google_vpc_access_connector (#8071) (#14835)
* add_new_field * add unsorted * Update mmv1/products/vpcaccess/Connector.yaml --------- Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Sarah French <[email protected]>
1 parent 634a50c commit 64523dc

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.changelog/8071.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
vpcaccess: Added `connected_projects` attribute to resource `google_vpc_access_connector`.
3+
```

google/services/vpcaccess/resource_vpc_access_connector.go

+15
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/su
138138
},
139139
},
140140
},
141+
"connected_projects": {
142+
Type: schema.TypeList,
143+
Computed: true,
144+
Description: `List of projects using the connector.`,
145+
Elem: &schema.Schema{
146+
Type: schema.TypeString,
147+
},
148+
},
141149
"self_link": {
142150
Type: schema.TypeString,
143151
Computed: true,
@@ -387,6 +395,9 @@ func resourceVPCAccessConnectorRead(d *schema.ResourceData, meta interface{}) er
387395
if err := d.Set("max_throughput", flattenVPCAccessConnectorMaxThroughput(res["maxThroughput"], d, config)); err != nil {
388396
return fmt.Errorf("Error reading Connector: %s", err)
389397
}
398+
if err := d.Set("connected_projects", flattenVPCAccessConnectorConnectedProjects(res["connectedProjects"], d, config)); err != nil {
399+
return fmt.Errorf("Error reading Connector: %s", err)
400+
}
390401
if err := d.Set("subnet", flattenVPCAccessConnectorSubnet(res["subnet"], d, config)); err != nil {
391402
return fmt.Errorf("Error reading Connector: %s", err)
392403
}
@@ -562,6 +573,10 @@ func flattenVPCAccessConnectorMaxThroughput(v interface{}, d *schema.ResourceDat
562573
return v // let terraform core handle it otherwise
563574
}
564575

576+
func flattenVPCAccessConnectorConnectedProjects(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
577+
return v
578+
}
579+
565580
func flattenVPCAccessConnectorSubnet(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
566581
if v == nil {
567582
return nil

website/docs/r/vpc_access_connector.html.markdown

+3
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ In addition to the arguments listed above, the following computed attributes are
150150
* `self_link` -
151151
The fully qualified name of this VPC connector
152152

153+
* `connected_projects` -
154+
List of projects using the connector.
155+
153156

154157
## Timeouts
155158

0 commit comments

Comments
 (0)