Skip to content

Instantly share code, notes, and snippets.

@Intelrunner
Created March 11, 2022 20:28
Show Gist options
  • Save Intelrunner/1b46309e6cd88e5f898cc0b6008918da to your computer and use it in GitHub Desktop.
Save Intelrunner/1b46309e6cd88e5f898cc0b6008918da to your computer and use it in GitHub Desktop.
This is is a simple set of shell commands that transfers an existing GCP Asset Inventory to Bigquery
#!/bin/sh
# more information: https://cloud.google.com/asset-inventory/docs/exporting-to-bigquery
# must have gcloud cli installed
gcloud asset export \
# must provide a dataset
--bigquery-dataset $DATASET \
# this is for a resource based output
--content-type resource \
--project $PROJECT \
--bigquery-table $DATASET_TABLE \
# if the above table does not exist, this command creates it
--output-bigquery-force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment