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:

  1. Install Config Connector.

  2. Configure Config Connector to use a default project.

Installing config-connector

  1. Download the latest config-connector binary tar file:

    gsutil cp gs://cnrm/latest/cli.tar.gz .
    
  2. Extract the tar file:

    tar zxf cli.tar.gz
    
  3. 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
  4. Copy the binary to a location on your ${PATH}. For example, on Linux and MacOS, you might use mv to place it into /usr/local/bin.

    mv linux/amd64/config-connector /usr/local/bin
    
  5. 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 with gcloud.

    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