Importing and exporting resources

Overview

You can use the config-connector tool to export your existing resources to Config Connector YAML. Once 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:

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
    

Obtain application-default access credentials

config-connector uses the Cloud SDK'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

Export resources to Config Connector YAML:

  • Perform an export on individual resource(s): export.

  • Perform a bulk export for all resources in your project, folder, or organization: bulk-export.