[Yandex Cloud documentation](../../index.md) > [Yandex Cloud Billing](../index.md) > [Step-by-step guides](index.md) > Managing a billing account > Linking a cloud to a billing account

# Linking a cloud to a billing account

You can link one or more clouds to your [billing account](../concepts/billing-account.md). Both new and existing clouds can be linked. You cannot unlink a cloud from a billing account. Instead, you can relink it to a different billing account.

If a billing account is added to an [organization](../concepts/organization.md), you can link clouds from your own organization and those from other organizations you have been [granted access](../../resource-manager/security/index.md) to in Yandex Cloud Billing.


Each cloud in Yandex Cloud must be linked to a single billing account. If you relink an existing cloud, you are effectively transferring it between billing accounts. For legal entities, you cannot relink a cloud and your [DataSphere](../../datasphere/index.md), [Tracker](https://yandex.com/support/tracker/en), and [DataLens](../../datalens/index.md) services from a paid account to a trial period account.

![image](../../_assets/billing/clouds-and-accounts.svg)

## Requirements for linking a cloud {#bind-roles}

Before linking a [cloud](../../resource-manager/concepts/resources-hierarchy.md#cloud), make sure the following conditions are met:
1. [Billing account](../concepts/billing-account.md) has been successfully activated, i.e., its [status](../concepts/billing-account-statuses.md) is `ACTIVE` or `TRIAL_ACTIVE`.
1. The user holds all these [roles](../../iam/concepts/access-control/roles.md) at once:
   * [resource-manager.clouds.owner](../../resource-manager/security/index.md#resource-manager-clouds-owner) for the cloud.
   * [billing.accounts.editor](../security/index.md#billing-accounts-editor) and higher for the billing account.

## Linking a cloud {#bind-cloud}

To link or re-link a cloud to a billing account:

{% list tabs group=instructions %}

- Yandex Cloud Billing interface {#billing}

  1. Go to [**Yandex Cloud Billing**](https://center.yandex.cloud/billing/accounts).
  1. Select the billing account you want to link the cloud to.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/cloud.svg) **Clouds and services**.
  1. Click ![image](../../_assets/console-icons/link.svg) **Link** in the top-right corner.

     ![image](../../_assets/billing/billing-pin-cloud-1-4.png)

  1. In the **Type** field, pick the entity type you need from the list and select the resource to link to the billing account.
  1. Click **Link**; the cloud or service you added will appear in the list.
  1. If you are re-linking the cloud, pay any outstanding charges on the old billing account.

     ![image](../../_assets/billing/billing-pin-cloud-5-6.png) 

- Terraform {#tf}

  If you do not have Terraform yet, [install it and configure the Yandex Cloud provider](../../tutorials/infrastructure-management/terraform-quickstart.md#install-terraform).
  
  
  To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), [authenticate](../../terraform/authentication.md) using the appropriate method.

  To link a cloud, the [service account](../../iam/concepts/users/service-accounts.md) must have the `billing.accounts.editor` [role](../security/index.md#set-role) or higher for the billing account you are linking your cloud to.

  To link a cloud to a billing account:

  1. In the configuration file, describe the resources you want to create:

     ```hcl
     resource "yandex_billing_cloud_binding" "mycloud" {
       billing_account_id = "<billing_account_ID>"
       cloud_id           = "<cloud_ID>"
     }
     ```

     Where:
     * `billing_account_id`: ID of the billing account to link the cloud to.
     * `cloud_id`: ID of the cloud you want to link to the billing account.

     For more on the properties of the `yandex_billing_cloud_binding` resource in Terraform, see [this provider guide](../../terraform/resources/billing_cloud_binding.md).
  1. Create the resources:

     1. In the terminal, navigate to the configuration file directory.
     1. Make sure the configuration is correct using this command:
     
        ```bash
        terraform validate
        ```
     
        If the configuration is valid, you will get this message:
     
        ```bash
        Success! The configuration is valid.
        ```
     
     1. Run this command:
     
        ```bash
        terraform plan
        ```
     
        You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
     1. Apply the configuration changes:
     
        ```bash
        terraform apply
        ```
     
     1. Type `yes` and press **Enter** to confirm the changes.

  After that, the cloud will be linked to the billing account.

- API {#api}

  To link a cloud, use the [bindBillableObject](../api-ref/BillingAccount/bindBillableObject.md) REST API method for the [BillingAccount](../api-ref/BillingAccount/index.md) resource or the [BillingAccountService/BindBillableObject](../api-ref/grpc/BillingAccount/bindBillableObject.md) gRPC API call.

{% endlist %}

{% note warning %}

Linking a cloud or another container to a [suspended account](../concepts/billing-account-statuses.md) will stop all your resources.

{% endnote %}

## Checking a cloud's link {#check-binding}

To check a cloud's or service's link to a billing account:

{% list tabs group=instructions %}

- Yandex Cloud Billing interface {#billing}
  
  1. Go to [**Yandex Cloud Billing**](https://center.yandex.cloud/billing/accounts).
  1. Select the billing account the new cloud or service was linked to.
  1. In the left-hand panel, select ![image](../../_assets/console-icons/cloud.svg) **Clouds and services**.

  The list should include a new entry showing the ID of the linked cloud or service.

{% endlist %}

## Resource management in organizations {#bind-cloud-organization}

1. After you add your billing account to an [organization](../concepts/organization.md), [**Yandex Cloud Billing**](https://center.yandex.cloud/billing/accounts) will allow you to associate it with:
     * Clouds and [DataSphere](https://yandex.cloud/en/services#ml-ai), [Yandex DataLens](../../datalens/index.md), or [Yandex Tracker](https://yandex.com/support/tracker/en) instances created in your organization.
     * Clouds and entities from other organizations you were [granted access](../../resource-manager/security/index.md) to.
   
   To access the [billable](../../organization/pricing.md#pricing-management) [Yandex Identity Hub](../../organization/index.md) features, [associate](../../organization/operations/manage-billing.md#add-billing-account) your billing account with your Yandex Identity Hub instance.
1. The [technical support service plan](../../support/pricing.md) applies at the organization level and can only be changed by the organization owner. You can use a single billing account to pay the fixed support fees across multiple organizations that may have different support service plans activated.

If you want to stop using the old billing account, make sure it is on the free **Basic** service plan to avoid having your balance further debited. Otherwise, you will continue to be billed for the paid plan even if the account has no linked clouds.