0

I want to export the config-connect yaml for an existing Cloud Storage Bucket. The docs describe running config-connector export [URL], however it's not clear what the URL should be for a bucket.

The docs link to https://cloud.google.com/iam/docs/full-resource-names, which suggests //storage.googleapis.com/projects/_/buckets/bucket-id. I tried this with:

config-connector export //storage.googleapis.com/projects/_/buckets/config-connector-experiment

and got

error in 'config-connector' version '1.51.2': error getting unstructured: error getting next unstruct: error converting url '//storage.googleapis.com/projects/_/buckets/config-connector-experiment' to skeleton: error getting service mapping and resource config for url '//storage.googleapis.com/projects/_/buckets/config-connector-experiment': unable to find a matching resource config for uri path '/projects/_/buckets/config-connector-experiment'

The docs have a footnote that says "1 The format shown here is compatible with IAM. Some services use a different format for this resource type." Perhaps there's a different format for Config Connector? If so, what is it, and can it be added to docs?

thanks!

Nahuel
  • 158
  • 8
Paul Biggar
  • 27,579
  • 21
  • 99
  • 152
  • try without the full path, in some cases, like for example when creating aggregated sinks, the Cloud Storage bucket must be referenced as a Global resource just like: storage.googleapis.com/bucket-id . for my example: gcloud logging sinks create storage.googleapis.com/ --include-children --organization= --log-filter="logName:activity" – Jaime López Jun 07 '21 at 18:03
  • Thanks for the suggestion! I tried that (and added a new handful of variations) and they didn't work :( – Paul Biggar Jun 07 '21 at 21:35
  • did you try simply the `gs://bucket/path/to/file` format? – guillaume blaquiere Jun 08 '21 at 07:02
  • @guillaumeblaquiere yeah, i tried `gs://bucket`. There's no path though, by design, right? – Paul Biggar Jun 08 '21 at 13:25
  • @PaulBiggar With the intent to clarify, the correct format of the gsutil URI is: `gs://[nameOfTheBucket]/` – Nahuel Jun 08 '21 at 13:43
  • @nahuel yes, I was using gs://config-connector-experiment – Paul Biggar Jun 08 '21 at 16:04

2 Answers2

1

This is possible with the bulk-export functionality (tested 9/13/22).

BUCKET='{"name":"//storage.googleapis.com/buckets/<bucket-name>","asset_type":"storage.googleapis.com/Bucket"}' 
echo $BUCKET | config-connector bulk-export

JMoore
  • 45
  • 7
0

As of June 8th, 2021, it's not possible as config-connector's export functionality doesn't support cloud storage.

Paul Biggar
  • 27,579
  • 21
  • 99
  • 152