Skip to content

Commit

Permalink
fix GCP commands (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
misterpantz authored Apr 29, 2024
1 parent e891da7 commit dd75360
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
20 changes: 16 additions & 4 deletions docs/cnquery/cnquery-gcp/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
8 changes: 3 additions & 5 deletions docs/cnspec/cloud/gcp/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd75360

Please sign in to comment.