> ## Documentation Index
> Fetch the complete documentation index at: https://docs.controlplane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# cloudaccount

> cpln cloudaccount — Manage cloud accounts that connect external cloud providers to Control Plane.

Manage cloud accounts

For a detailed overview, please visit the [cloud account's](/reference/cloudaccount) reference page.

```none theme={null}
cpln cloudaccount [SUBCOMMAND]
```

```text theme={null}
Commands:
  cpln cloudaccount access-report <ref>  Show the access report for the referenced cloud account
  cpln cloudaccount audit [ref]          Retrieve audit trail events for the referenced cloud account
  cpln cloudaccount create-aws           Create an AWS cloud account
  cpln cloudaccount create-azure         Create an Azure cloud account
  cpln cloudaccount create-gcp           Create a GCP cloud account
  cpln cloudaccount create-ngs           Create a NGS cloud account
  cpln cloudaccount delete <ref...>      Delete one or more referenced cloud accounts
  cpln cloudaccount edit <ref>           Edit the referenced cloud account, as YAML, within an editor
  cpln cloudaccount eventlog <ref>       Show the event log of the referenced cloud account  [aliases: log]
  cpln cloudaccount get [ref...]         Retrieve one or more referenced cloud accounts
  cpln cloudaccount patch <ref>          Update the referenced cloud account's metadata using an input file
  cpln cloudaccount permissions          Show the grantable permissions for a cloud account object type
  cpln cloudaccount query                Find all the cloud accounts based on the given query
  cpln cloudaccount tag <ref...>         Manage the tags belonging to one or more referenced cloud accounts

Options:
  --help  Show help  [boolean]
```

***

#### cloudaccount access-report

Show the access report for the referenced cloud account

**Usage**

```none theme={null}
cpln cloudaccount access-report <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount access-report demo-cloud-account-aws --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------+--------------------------------------------------------+--------+
    |PERMISSION |PRINCIPAL                                               |GRANTED |
    |-----------|--------------------------------------------------------|--------|
    |browse     |/org/demo-cpln-organization/group/superusers            |manage  |
    |browse     |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |create     |/org/demo-cpln-organization/group/superusers            |manage  |
    |create     |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |delete     |/org/demo-cpln-organization/group/superusers            |manage  |
    |delete     |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |edit       |/org/demo-cpln-organization/group/superusers            |manage  |
    |edit       |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |manage     |/org/demo-cpln-organization/group/superusers            |manage  |
    |manage     |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    |view       |/org/demo-cpln-organization/group/viewers               |view    |
    |view       |/org/demo-cpln-organization/group/superusers            |manage  |
    |view       |/org/demo-cpln-organization/serviceaccount/controlplane |manage  |
    +-----------+--------------------------------------------------------+--------+
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount audit

Retrieve audit trail events for the referenced cloud account

**Usage**

```none theme={null}
cpln cloudaccount audit [ref] [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.

  Command options:
    --subject  Filter by subject (serviceaccount name or user email)  [string]
    --context  Audit context name (the 'cpln' context displays Control Plane actions)  [string] [default: "cpln"]
    --since    Relative lookback window from now (e.g., 1h, 24h, 7d). Mutually exclusive with --from/--to  [string] [default: "7d"]
    --from     Start time for audit events (ISO 8601 format or relative duration, e.g., 2025-10-23T07:00:00Z, 7d, 1h). Cannot be used with --since  [string]
    --to       End time for audit events (ISO 8601 format or relative duration, e.g., 2025-10-23T07:00:00Z, 1d, 30m)  [string]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

***

#### cloudaccount create-aws

Create an AWS cloud account

**Usage**

```none theme={null}
cpln cloudaccount create-aws --name ACCOUNT_NAME --role-arn ROLE_ARN [OPTIONS]
```

<Info>
  By defining an AWS cloud account, you enable workloads to consume services from a specific AWS account.
  The Control Plane CLI (`cpln`) provides account-specific instructions for registering an AWS cloud account
  with Control Plane. Simply execute `cpln cloudaccount create-aws --how` to obtain step-by-step instructions.
  The instructions emitted are specific to the organization for the currently logged-on cpln user.
  To override the organization, pass the `--org ORG_NAME` option.
</Info>

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --name                 Name of the new account
    --description, --desc  Optional description, defaults to the name if not set
    --role-arn             ARN of the role used by Control Plane to manage the account, in format `arn:aws:iam::<account number>:role/<name>`
    --how                  Show the steps on how to create and configure your AWS account  [boolean]
    --tag                  Attach tags (e.g., --tag drink=water)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount create-aws --name demo-cloud-account-aws --role-arn arn:aws:iam::123412341234:role/cpln-demo-cpln-organization --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------+-----------------------+---------+-----------------------------------------------------------+--------+-----+
    |NAME                   |DESCRIPTION            |PROVIDER |INFO                                                       |CREATED |TAGS |
    |-----------------------|-----------------------|---------|-----------------------------------------------------------|--------|-----|
    |demo-cloud-account-aws |demo-cloud-account-aws |aws      |arn:aws:iam::123412341234:role/cpln-demo-cpln-organization |Now     |     |
    +-----------------------+-----------------------+---------+-----------------------------------------------------------+--------+-----+
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount create-azure

Create an Azure cloud account

**Usage**

```none theme={null}
cpln cloudaccount create-azure --name ACCOUNT_NAME --secret AZURE_SECRET [OPTIONS]
```

<Info>
  By defining an Azure cloud account, you enable workloads to consume services from a specific Azure account. The Control Plane CLI (`cpln`) provides account-specific instructions for registering an Azure cloud account with Control Plane. Simply execute `cpln cloudaccount create-azure --how` to obtain step-by-step instructions. The instructions emitted are specific to the organization for the currently logged-on cpln user. To override the organization, pass the `--org ORG_NAME` option.
</Info>

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --name                 Name of the new account
    --description, --desc  Optional description, defaults to the name if not set
    --secret               The name of the secret which will be created.
    --url                  The URL of the deployed function app.
    --code                 The URL of the deployed function app.
    --how                  Show the steps on how to create and configure your Azure subscription  [boolean]
    --tag                  Attach tags (e.g., --tag drink=water)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount create-azure --name demo-cloud-account-azure --secret azure-secret --url https://function.app.url --code code --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-------------------------+-------------------------+---------+-----+--------+-----+
    |NAME                     |DESCRIPTION              |PROVIDER |INFO |CREATED |TAGS |
    |-------------------------|-------------------------|---------|-----|--------|-----|
    |demo-cloud-account-azure |demo-cloud-account-azure |azure    |     |Now     |     |
    +-------------------------+-------------------------+---------+-----+--------+-----+
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount create-gcp

Create a GCP cloud account

**Usage**

```none theme={null}
cpln cloudaccount create-gcp --name ACCOUNT_NAME --project-id PROJECT_ID [OPTIONS]
```

<Info>
  By defining a GCP cloud account, you enable workloads to consume services from a specific GCP account.
  The Control Plane CLI (`cpln`) provides account-specific instructions for registering a GCP cloud account
  with Control Plane. Simply execute `cpln cloudaccount create-gcp --how` to obtain step-by-step instructions.
  The instructions emitted are specific to the organization for the currently logged-on cpln user.
  To override the organization, pass the `--org ORG_NAME` option.
</Info>

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --name                 Name of the new account
    --description, --desc  Optional description, defaults to the name if not set
    --project-id           The ID of the project that Control Plane will manage
    --how                  Show the steps on how to create and configure your GCP project  [boolean]
    --tag                  Attach tags (e.g., --tag drink=water)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount create-gcp --name demo-cloud-account-gcp --project-id 1234abc --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------+-----------------------+---------+--------+--------+-----+
    |NAME                   |DESCRIPTION            |PROVIDER |INFO    |CREATED |TAGS |
    |-----------------------|-----------------------|---------|--------|--------|-----|
    |demo-cloud-account-gcp |demo-cloud-account-gcp |gcp      |1234abc |Now     |     |
    +-----------------------+-----------------------+---------+--------+--------+-----+
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount create-ngs

Create a NGS cloud account

**Usage**

```none theme={null}
cpln cloudaccount create-ngs --name ACCOUNT_NAME --secret SECRET_REFERENCE [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Command options:
    --name                 Name of the new account  [required]
    --description, --desc  Optional description, defaults to the name if not set
    --secret               The secret used to authenticate to NGS  [required]
    --tag                  Attach tags (e.g., --tag drink=water)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

***

#### cloudaccount delete

Delete one or more referenced cloud accounts

**Usage**

```none theme={null}
cpln cloudaccount delete <ref...> [OPTIONS]
```

<Warning>
  Deleting a cloud account will not remove any configuration at the associated cloud provider
</Warning>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [required] [default: []]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount delete demo-cloud-account-aws --org demo-cpln-organization
    ```

    ```text Output theme={null}
    If the delete was successful, a new command prompt will be shown.
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount edit

Edit the referenced cloud account, as YAML, within an editor

**Usage**

```none theme={null}
cpln cloudaccount edit <ref> [OPTIONS]
```

<Note>
  The default editor can be set by using the EDITOR environment variable.
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --replace, -r  Replace instead of patch/merge  [boolean] [default: false]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount edit demo-cloud-account-aws --org demo-cpln-organization
    ```

    ```text Output theme={null}
    Your default editor will be launched.

    Once any modifications are saved, the updates will be sent to the API.
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount eventlog

Show the event log of the referenced cloud account

**Usage**

```none theme={null}
cpln cloudaccount eventlog <ref> [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount eventlog demo-cloud-account-aws --org demo-cpln-organization
    ```

    ```text Output theme={null}
    The event log for the referenced cloud account will be shown.
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount get

Retrieve one or more referenced cloud accounts

**Usage**

```none theme={null}
cpln cloudaccount get [ref...] [OPTIONS]
```

<Note>
  An empty reference will return all references
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [default: []]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Get all cloud accounts

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount get --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------------+-----------------------------+---------+-----------------------------------------------------------+-------------+-----+
    |NAME                         |DESCRIPTION                  |PROVIDER |INFO                                                       |CREATED      |TAGS |
    |-----------------------------|-----------------------------|---------|-----------------------------------------------------------|-------------|-----|
    |demo-cloud-account-aws       |demo-cloud-account-aws       |aws      |arn:aws:iam::123412341234:role/cpln-demo-cpln-organization |1 minute ago |     |
    |demo-cloud-account-aws-get-1 |demo-cloud-account-aws-get-1 |aws      |arn:aws:iam::123412341234:role/cpln-demo-cpln-organization |Now          |     |
    |demo-cloud-account-aws-get-2 |demo-cloud-account-aws-get-2 |aws      |arn:aws:iam::123412341234:role/cpln-demo-cpln-organization |Now          |     |
    |demo-cloud-account-azure     |demo-cloud-account-azure     |azure    |                                                           |1 minute ago |     |
    |demo-cloud-account-gcp       |demo-cloud-account-gcp       |gcp      |1234abc                                                    |1 minute ago |     |
    +-----------------------------+-----------------------------+---------+-----------------------------------------------------------+-------------+-----+
    ```
  </CodeGroup>

  * Get one cloud account

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount get demo-cloud-account-aws-get-1 --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------------+-----------------------------+---------+-----------------------------------------------------------+--------+-----+
    |NAME                         |DESCRIPTION                  |PROVIDER |INFO                                                       |CREATED |TAGS |
    |-----------------------------|-----------------------------|---------|-----------------------------------------------------------|--------|-----|
    |demo-cloud-account-aws-get-1 |demo-cloud-account-aws-get-1 |aws      |arn:aws:iam::123412341234:role/cpln-demo-cpln-organization |Now     |     |
    +-----------------------------+-----------------------------+---------+-----------------------------------------------------------+--------+-----+
    ```
  </CodeGroup>

  * Get multiple cloud accounts

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount get demo-cloud-account-aws-get-1 demo-cloud-account-aws-get-2 --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------------+-----------------------------+---------+-----------------------------------------------------------+--------+-----+
    |NAME                         |DESCRIPTION                  |PROVIDER |INFO                                                       |CREATED |TAGS |
    |-----------------------------|-----------------------------|---------|-----------------------------------------------------------|--------|-----|
    |demo-cloud-account-aws-get-1 |demo-cloud-account-aws-get-1 |aws      |arn:aws:iam::123412341234:role/cpln-demo-cpln-organization |Now     |     |
    |demo-cloud-account-aws-get-2 |demo-cloud-account-aws-get-2 |aws      |arn:aws:iam::123412341234:role/cpln-demo-cpln-organization |Now     |     |
    +-----------------------------+-----------------------------+---------+-----------------------------------------------------------+--------+-----+
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount patch

Update the referenced cloud account's metadata using an input file

**Usage**

```none theme={null}
cpln cloudaccount patch <ref> --file FILE_NAME [OPTIONS]
```

<Note>
  Running this command with the option **`--file -`** sets the input to stdin. The input is required to be a valid JSON or YAML string (e.g., `{"description": "My new description"}` or `description: My new description`). To complete the update, press Control-D (or Control-Z if you are using Windows).
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  The resource reference. Usually it is the name of the resource.  [required]

  Command options:
    --file, -f  File to load the patch from. Use `--file -` to enable input from stdin.  [required]

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount patch demo-cloud-account-aws --file update.json --org demo-cpln-organization
    ```

    ```text Output theme={null}
    The changes within the JSON file will be performed against the referenced cloud account.
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount permissions

Show the grantable permissions for a cloud account object type

**Usage**

```none theme={null}
cpln cloudaccount permissions [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount permissions --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-------+-------------------------------+-------------------------------------------+
    |NAME   |DESCRIPTION                    |IMPLIES                                    |
    |-------|-------------------------------|-------------------------------------------|
    |browse |Browse account contents        |view                                       |
    |create |Create new cloud accounts      |                                           |
    |delete |Delete existing cloud accounts |                                           |
    |edit   |Modify existing cloud accounts |view, browse                               |
    |manage |Full access                    |browse, create, delete, edit, manage, view |
    |view   |Read-only access               |                                           |
    +-------+-------------------------------+-------------------------------------------+
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount query

Find all the cloud accounts based on the given query

**Usage**

```none theme={null}
cpln cloudaccount query QUERY_OPTIONS [OPTIONS]
```

<Accordion title="Reference">
  ```text theme={null}
  Query options:
    --match             Query filter type  [choices: "all", "none", "any"] [default: "all"]
    --property, --prop  Property to query
    --tag               Tag to query
    --rel               Relation to query

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  <Note>
    Use the `--match` option to display **all**, **none**, or **any** of the results based on a given property or tag
  </Note>

  * Search for a cloud account based on the name property

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount query --match any --prop name=demo-cloud-account-aws --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------+-----------------------+---------+-----------------------------------------------------------+-------------+-----+
    |NAME                   |DESCRIPTION            |PROVIDER |INFO                                                       |CREATED      |TAGS |
    |-----------------------|-----------------------|---------|-----------------------------------------------------------|-------------|-----|
    |demo-cloud-account-aws |demo-cloud-account-aws |aws      |arn:aws:iam::123412341234:role/cpln-demo-cpln-organization |1 minute ago |     |
    +-----------------------+-----------------------+---------+-----------------------------------------------------------+-------------+-----+
    ```
  </CodeGroup>

  * Search for a cloud account based on the description property

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount query --match any --prop description="demo-cloud-account-aws" --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------+-----------------------+---------+-----------------------------------------------------------+-------------+-----+
    |NAME                   |DESCRIPTION            |PROVIDER |INFO                                                       |CREATED      |TAGS |
    |-----------------------|-----------------------|---------|-----------------------------------------------------------|-------------|-----|
    |demo-cloud-account-aws |demo-cloud-account-aws |aws      |arn:aws:iam::123412341234:role/cpln-demo-cpln-organization |1 minute ago |     |
    +-----------------------+-----------------------+---------+-----------------------------------------------------------+-------------+-----+
    ```
  </CodeGroup>

  * Search for a cloud account based on a tag

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount query --match any --tag drink=water --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----+------------+---------+-----+--------+-----+
    |NAME |DESCRIPTION |PROVIDER |INFO |CREATED |TAGS |
    +-----+------------+---------+-----+--------+-----+
    ```
  </CodeGroup>

  * Search for a cloud account based on a property and tag

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount query --match any --prop description="demo-cloud-account-aws" --tag drink=water --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-----------------------+-----------------------+---------+-----------------------------------------------------------+-------------+-----+
    |NAME                   |DESCRIPTION            |PROVIDER |INFO                                                       |CREATED      |TAGS |
    |-----------------------|-----------------------|---------|-----------------------------------------------------------|-------------|-----|
    |demo-cloud-account-aws |demo-cloud-account-aws |aws      |arn:aws:iam::123412341234:role/cpln-demo-cpln-organization |1 minute ago |     |
    +-----------------------+-----------------------+---------+-----------------------------------------------------------+-------------+-----+
    ```
  </CodeGroup>
</Accordion>

***

#### cloudaccount tag

Manage the tags belonging to one or more referenced cloud accounts

**Usage**

```none theme={null}
cpln cloudaccount tag <ref...> --tag KEY=VALUE [OPTIONS]
```

<Note>
  Built-in tags, which begin with cpln/\*, can't be modified.
</Note>

<Accordion title="Reference">
  ```text theme={null}
  Positionals:
    ref  One or more resource references. Usually it is the name of the resource.  [array] [required] [default: []]

  Command options:
    --tag         Attach tags (e.g., --tag drink=water)
    --remove-tag  Remove tags (e.g., --remove-tag tagname)

  Context options:
    --profile  Override the profile. The default profile can be set using the `cpln profile set-default` command or by setting the CPLN_PROFILE environment variable
    --org      Override the organization. The default organization can be set in your profile by using the `cpln profile update` command

  Format options:
    --output, -o  Set the output format  [choices: "text", "json", "yaml", "json-slim", "yaml-slim", "tf", "crd", "names"]
    --color       Colorize the output  [boolean] [default: true]
    --ts          Timestamp format if the output format is text (e.g., --output=text)  [choices: "iso", "local", "age"]
    --max         Maximum number of records to show. A value less than 1 will return all records.  [number] [default: 50]

  Request options:
    --token         Override the authorization token
    --endpoint      Override the API URL
    --insecure, -k  Ignore TLS errors  [boolean]

  Debug options:
    --verbose, -v  Enable verbose output to stderr  [boolean] [default: false]
    --debug, -d    Show all HTTP communications  [boolean] [default: false]

  Options:
    --help  Show help  [boolean]
  ```

  [Common Options Reference](/cli-reference/using-cli/common-options)
</Accordion>

<Accordion title="Example">
  * Add a tag to a cloud account

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount tag demo-cloud-account-azure --tag drink=water --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-------------------------+-------------------------+---------+-----+-------------+--------------+
    |NAME                     |DESCRIPTION              |PROVIDER |INFO |CREATED      |TAGS          |
    |-------------------------|-------------------------|---------|-----|-------------|--------------|
    |demo-cloud-account-azure |demo-cloud-account-azure |azure    |     |1 minute ago |drink="water" |
    +-------------------------+-------------------------+---------+-----+-------------+--------------+
    ```
  </CodeGroup>

  * Update same tag (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount tag demo-cloud-account-azure --tag drink=coffee --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-------------------------+-------------------------+---------+-----+-------------+---------------+
    |NAME                     |DESCRIPTION              |PROVIDER |INFO |CREATED      |TAGS           |
    |-------------------------|-------------------------|---------|-----|-------------|---------------|
    |demo-cloud-account-azure |demo-cloud-account-azure |azure    |     |1 minute ago |drink="coffee" |
    +-------------------------+-------------------------+---------+-----+-------------+---------------+
    ```
  </CodeGroup>

  * Remove tag (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount tag demo-cloud-account-azure --remove drink --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-------------------------+-------------------------+---------+-----+-------------+-----+
    |NAME                     |DESCRIPTION              |PROVIDER |INFO |CREATED      |TAGS |
    |-------------------------|-------------------------|---------|-----|-------------|-----|
    |demo-cloud-account-azure |demo-cloud-account-azure |azure    |     |1 minute ago |     |
    +-------------------------+-------------------------+---------+-----+-------------+-----+
    ```
  </CodeGroup>

  * Add same tag to multiple cloud accounts

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount tag demo-cloud-account-azure demo-cloud-account-gcp --tag multiple-cloudaccounts=true --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-------------------------+-------------------------+---------+--------+-------------+------------------------------+
    |NAME                     |DESCRIPTION              |PROVIDER |INFO    |CREATED      |TAGS                          |
    |-------------------------|-------------------------|---------|--------|-------------|------------------------------|
    |demo-cloud-account-azure |demo-cloud-account-azure |azure    |        |1 minute ago |multiple-cloudaccounts="true" |
    |demo-cloud-account-gcp   |demo-cloud-account-gcp   |gcp      |1234abc |1 minute ago |multiple-cloudaccounts="true" |
    +-------------------------+-------------------------+---------+--------+-------------+------------------------------+
    ```
  </CodeGroup>

  * Update same tag on multiple cloud accounts (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount tag demo-cloud-account-azure demo-cloud-account-gcp --tag multiple-cloudaccounts=demo-cloudaccount --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-------------------------+-------------------------+---------+--------+-------------+-------------------------------------------+
    |NAME                     |DESCRIPTION              |PROVIDER |INFO    |CREATED      |TAGS                                       |
    |-------------------------|-------------------------|---------|--------|-------------|-------------------------------------------|
    |demo-cloud-account-azure |demo-cloud-account-azure |azure    |        |1 minute ago |multiple-cloudaccounts="demo-cloudaccount" |
    |demo-cloud-account-gcp   |demo-cloud-account-gcp   |gcp      |1234abc |1 minute ago |multiple-cloudaccounts="demo-cloudaccount" |
    +-------------------------+-------------------------+---------+--------+-------------+-------------------------------------------+
    ```
  </CodeGroup>

  * Remove same tag from multiple cloud accounts (after running the example above)

  <CodeGroup>
    ```bash Command theme={null}
    cpln cloudaccount tag demo-cloud-account-azure demo-cloud-account-gcp --remove multiple-cloudaccounts --org demo-cpln-organization
    ```

    ```text Output theme={null}
    +-------------------------+-------------------------+---------+--------+-------------+-----+
    |NAME                     |DESCRIPTION              |PROVIDER |INFO    |CREATED      |TAGS |
    |-------------------------|-------------------------|---------|--------|-------------|-----|
    |demo-cloud-account-azure |demo-cloud-account-azure |azure    |        |1 minute ago |     |
    |demo-cloud-account-gcp   |demo-cloud-account-gcp   |gcp      |1234abc |1 minute ago |     |
    +-------------------------+-------------------------+---------+--------+-------------+-----+
    ```
  </CodeGroup>
</Accordion>

***
