From dd75360ea78c24c1fd120924d2c7ad9b9fd8b2e6 Mon Sep 17 00:00:00 2001 From: Letha Date: Sun, 28 Apr 2024 17:29:40 -0700 Subject: [PATCH] fix GCP commands (#137) --- docs/cnquery/cnquery-gcp/README.mdx | 20 ++++++++++++++++---- docs/cnspec/cloud/gcp/README.mdx | 8 +++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/docs/cnquery/cnquery-gcp/README.mdx b/docs/cnquery/cnquery-gcp/README.mdx index baa21c980..2ab5a7d39 100644 --- a/docs/cnquery/cnquery-gcp/README.mdx +++ b/docs/cnquery/cnquery-gcp/README.mdx @@ -65,10 +65,10 @@ Your active configuration is: [default] ### Verify with a quick GCP query -To quickly confirm that cnquery has access to your GCP environment, run this query from your terminal: +To quickly confirm that cnquery has access to your GCP environment, run this query from your terminal, substituting your project ID for YOUR_PROJECT_ID: ```bash -cnquery run gcp -c gcp.project +cnquery run gcp project YOUR_PROJECT_ID -c gcp.project ``` cnquery returns the name of the project: @@ -85,10 +85,22 @@ You've successfully used cnquery to answer your first question about your GCP en To answer any question about your environment, use cnquery's interactive shell. It has auto-complete to guide you, which is especially helpful when you're new to cnquery and learning MQL. -To launch a shell into your GCP environment, enter: +To launch a shell into your GCP environment to run queries, substitute ORGANIZATION-ID with the ID of the organization you want to access and run: ```bash -cnquery shell gcp +cnquery shell gcp org ORGANIZATION-ID +``` + +To launch a shell into your GCP environment on the project level, substitute PROJECT-ID with the ID of the project you want to access and run: + +```bash +cnquery shell gcp project PROJECT-ID +``` + +To launch a shell into your GCP environment on the folder level, substitute FOLDER-ID with the ID of the folder you want to access and run: + +```bash +cnquery shell gcp folder FOLDER-ID ``` ### Discover capabilities with the `help` command diff --git a/docs/cnspec/cloud/gcp/README.mdx b/docs/cnspec/cloud/gcp/README.mdx index 34f4f3830..f2a2036ca 100644 --- a/docs/cnspec/cloud/gcp/README.mdx +++ b/docs/cnspec/cloud/gcp/README.mdx @@ -166,21 +166,19 @@ You can also create your own policies to meet your specific needs. To learn more The cnspec shell is handy for quick checks and tests, or for developing your MQL skills. Its auto-complete and help features guide you in writing checks. -To launch a shell into your GCP environment to run queries and checks, run: +To launch a shell into your GCP environment to run queries and checks, substitute ORGANIZATION-ID with the ID of the organization you want to access and run: ```bash cnspec shell gcp org ORGANIZATION-ID ``` -For `PROJECT-ID`, substitute the ID of the project you want to explore. - -To launch a shell into your GCP environment on the project level, substitute PROJECT-ID with the ID of the project you want to access and run the following command: +To launch a shell into your GCP environment on the project level, substitute PROJECT-ID with the ID of the project you want to access and run: ```bash cnspec shell gcp project PROJECT-ID ``` -To launch a shell into your GCP environment on the folder level, substitute FOLDER-ID with the ID of the folder you want to access and run the following command: +To launch a shell into your GCP environment on the folder level, substitute FOLDER-ID with the ID of the folder you want to access and run: ```bash cnspec shell gcp folder FOLDER-ID