Importing and exporting resources
You can use the config-connector
tool to export your existing resources to
Config Connector YAML files. After you have done so, you can use kubectl
to apply the
resources and import them into Config Connector.
Before you begin
To complete the steps on this page:
Configure Config Connector to use a default project.
Installing config-connector
Download the latest
config-connector
binary tar file:gcloud storage cp gs://cnrm/latest/cli.tar.gz .
Extract the tar file:
tar zxf cli.tar.gz
The tar file includes a binary executable for Linux, MacOS, and Windows. Choose the appropriate binary for your operating system:
- Linux:
./linux/amd64/config-connector
- MacOS:
./darwin/amd64/config-connector
- Windows:
./windows/amd64/config-connector
- Linux:
Copy the binary to a location on your
${PATH}
. For example, on Linux and MacOS, you might usemv
to place it into/usr/local/bin
.mv linux/amd64/config-connector /usr/local/bin
If you want to use the
config-connector
tool to export directly from Cloud Asset Inventory, enable the Cloud Asset Inventory API on your Google Cloud Identity's project withgcloud
.gcloud services enable cloudasset.googleapis.com
Obtaining application-default access credentials
config-connector
uses the Google Cloud CLI's application-default
credentials to
authenticate with Google Cloud. Instead of application-default
, you can provide an
OAuth 2.0 token using the
oauth2-token option.
Obtain application-default
credentials with gcloud
:
gcloud auth application-default login
Upgrading config-connector
To upgrade config-connector
to the latest version, repeat the installation
steps and overwrite your config-connector
executable.
What's next
- Perform an export on individual resources.
- Perform a bulk export for all resources in your project, folder, or organization.
- Learn about the resources that Config Connector supports.