Linking a cloud to a billing account
You can link one or more clouds to your billing account. 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, you can link clouds from your own organization and those from other organizations you have been granted access 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, Tracker
Requirements for linking a cloud
Before linking a cloud, make sure the following conditions are met:
- Billing account has been successfully activated, i.e., its status is
ACTIVEorTRIAL_ACTIVE. - The user holds all these roles at once:
- resource-manager.clouds.owner for the cloud.
- billing.accounts.editor and higher for the billing account.
Linking a cloud
To link or re-link a cloud to a billing account:
-
Go to Yandex Cloud Billing
. -
Select the billing account you want to link the cloud to.
-
Proceed to linking your cloud or service using one of the following methods:
-
Click
Link under Linked clouds and services in the Account section. -
In the left-hand panel, select
Clouds and services. In the top-right corner of the page, click Link.
-
-
In the Type field, pick the entity type you need from the list and select the resource to link to the billing account.
-
Click Link; the cloud or service you added will appear in the list.
-
If you are re-linking the cloud, pay any outstanding charges on the old billing account.
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
To link a cloud, the service account must have the billing.accounts.editor role or higher for the billing account you are linking your cloud to.
To link a cloud to a billing account:
-
In the configuration file, specify the properties of the resources you want to create:
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_bindingresource in Terraform, see this provider guide. -
Create the resources:
-
In the terminal, navigate to the configuration file directory.
-
Make sure the configuration is correct using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou 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.
-
Apply the configuration changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
After that, the cloud will be linked to the billing account.
To link a cloud, use the bindBillableObject REST API method for the BillingAccount resource or the BillingAccountService/BindBillableObject gRPC API call.
Warning
Linking a cloud or another container to a suspended account will stop all your resources.
How to check the cloud's link
To check the cloud's or service's link to a billing account, use one of these methods:
-
Go to Yandex Cloud Billing
. -
Select the billing account the new cloud or service was linked to.
Under Linked clouds and services, you can see the type and number of your linked resources.
-
For detailed information about the linked resources, click a resource or
Show all.
You will see the list of all linked clouds and services.
-
Go to Yandex Cloud Billing
. - Select the billing account the new cloud or service was linked to.
- In the left-hand panel, select
Clouds and services.
You will see the list of all linked clouds and services.
Resource management in organizations
-
After you add your billing account to an organization, Yandex Cloud Billing
will allow you to associate it with:- Clouds and DataSphere, Yandex DataLens, or Yandex Tracker
instances created in your organization. - Clouds and entities from other organizations you were granted access to.
To access the billable Yandex Identity Hub features, associate your billing account with your Yandex Identity Hub instance.
- Clouds and DataSphere, Yandex DataLens, or Yandex Tracker
-
The technical support service plan 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.