> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/ibm-cloud-cloud-onboarding/edit-an-ibm-cloud-cloud-instance.md).

# Edit an IBM Cloud cloud instance

Edit the settings of an IBM Cloud cloud instance in Cortex XDR, and apply the edits that require an updated Terraform template.

After you onboard an IBM Cloud account, you can change the instance name, the regions in scope, and the tags. Some edits take effect as soon as you save them. Other edits change resources in your IBM Cloud account, so you run an updated Terraform template and then apply the edit manually in Cortex XDR.

## Edits that require a Terraform run

When you save an edit, Cortex XDR determines whether it requires an updated Terraform template.

| Edit                                  | Requires a Terraform run | Reason                                                                                                                                                                                                                                                                          |
| ------------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Instance name                         | No                       | The name is stored only in Cortex XDR.                                                                                                                                                                                                                                          |
| Regions (**Modify Scope by Regions**) | No                       | The region scope controls only which regions Cortex XDR scans.                                                                                                                                                                                                                  |
| Cloud tags                            | Yes                      | Terraform updates the tags on the service ID in your IBM Cloud account.                                                                                                                                                                                                         |
| API key                               | Yes                      | Only Terraform can create a new API key. See [Rotate the IBM Cloud API key](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/ibm-cloud-cloud-onboarding/rotate-the-ibm-cloud-api-key.md). |

If one edit includes a tags change and other changes, the whole edit requires a Terraform run.

## Edit the cloud instance

Change the settings of the cloud instance in Cortex XDR.

1. In Cortex XDR, select **Settings → Data Sources & Integrations**, and then open the **IBM Cloud** cloud instances.
2. Right-click the cloud instance and select **Configuration**.
3. Make your changes. The edit form has the following fields:
   * **Scope:** Read-only. IBM Cloud supports Account scope only.
   * **Instance Name:** Editable.
   * **Account ID:** Read-only. To monitor a different IBM Cloud account, onboard a new cloud instance.
   * **API Key:** Turn on to rotate the API key. For the full procedure, see [Rotate the IBM Cloud API key](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/ibm-cloud-cloud-onboarding/rotate-the-ibm-cloud-api-key.md).
   * **Show advanced settings:** Edit **Scope Modifications** and **Cloud Tags**.
4. Click **Save**.
   * If the edit doesn't require a Terraform run, Cortex XDR applies it immediately, and you're done.
   * If the edit requires a Terraform run, Cortex XDR generates an updated Terraform template, and the cloud instance shows pending changes. Click **Download Terraform**, and then apply the edit.

## Apply a tags edit

Run the updated template in the same directory as the original deployment, so Terraform uses the existing state file. Then apply the edit in Cortex XDR.

1. Navigate to the original Terraform directory and extract the updated template files there. Overwrite the existing template files, but keep the Terraform state file.

   ```bash
   cd ~/terraform/ibm-cloud-connector-1
   tar -xzvf <your_updated_template>.tar.gz
   ```
2. Set your IBM Cloud administrator API key as an environment variable:

   ```bash
   export IC_API_KEY="<your IBM Cloud administrator API key>"
   ```
3. Apply the updated configuration:

   ```bash
   terraform init
   terraform apply --var-file=template_params.tfvars
   ```
4. Review the plan, and then enter `yes` to approve it. A tags edit changes only the tags resource (`ibm_resource_tag`) on the service ID. It doesn't create, replace, or destroy any API key, custom role, or access policy. The `api_key` output is empty, because a tags edit doesn't create a key.
5. In Cortex XDR, on the **Cloud Instances** page, right-click the cloud instance and select **Manually apply edit**.
6. Leave the masked value in the **API Key** field. The **IBM Cloud Account ID** and **Service ID** fields are read-only.
7. Click **Connect**. The cloud instance exits the pending changes state.

{% hint style="warning" %}
**Important:** Terraform can show the previous `api_key` value in clear text in the plan and apply output. Don't share, log, or paste Terraform output without removing the key.
{% endhint %}

## Cancel a pending edit

If you saved an edit but you don't want to apply it, revoke the pending changes. On the **Cloud Instances** page, click the **Configuration** pencil icon for the cloud instance, and under **Manage unsaved changes**, select **Revoke pending changes**. For more information, see [Edit your onboarded CSP configuration](https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/edit-your-onboarded-csp-configuration.md).

If you already ran the updated template, complete the edit with **Manually apply edit** instead of revoking it.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-xdr/configure-cortex-xdr/cortex-xdr-data-sources/cloud-service-provider-csp-onboarding/ibm-cloud-cloud-onboarding/edit-an-ibm-cloud-cloud-instance.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
