What is the correct URL to export a config-connector config file for Google Cloud Storage?

670 views Asked by At

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!

2

There are 2 answers

0
Paul Biggar On BEST ANSWER

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

0
JMoore On

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