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, and DataLens services from a paid account to a trial period account.
Requirements for linking a cloud
Before linking a cloud, make sure that the billing account has been activated (has the ACTIVE
or TRIAL_ACTIVE
status and the user has all of the following roles:
- resource-manager.clouds.owner for the cloud.
billing.accounts.owner
oreditor
for the billing account. To learn more about roles, see Access management.
Linking a cloud
To link a cloud to a billing account or change the billing account a cloud is linked to:
-
Go to Yandex Cloud Billing
. - Select the billing account you want to link the cloud to.
- Go to the Account info page.
- Under Clouds, click Link cloud.
- Select the cloud from the list.
- Click Link and the added cloud will appear on the list.
- If you are changing the billing account of the cloud, pay any outstanding charges on your previous billing account.
If you don't have Terraform, install it and configure the Yandex Cloud provider.
To link a cloud, a service account must have the billing.accounts.owner
editor
role for the billing account.
-
In the configuration file, describe the parameters 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 to link the billing account to.
For more information about the
yandex_billing_cloud_binding
resource parameters in Terraform, see the relevant provider documentation . -
Create resources:
-
In the terminal, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
-
After that, the cloud will be linked to the billing account. You can check that the cloud is linked to the account on the billing account page in Yandex Cloud Billing
To link a cloud, use the bindBillableObject REST API method for the BillingAccount resource or the BillingAccountService/BindBillableObject gRPC API call.
If you are migrating a cloud because you want to stop using the old billing account, make sure the free Basic service plan is activated in it. Otherwise, even though it has no linked clouds remaining, you will continue to be charged for the paid service plan.
Warning
Note that linking a cloud (or another container) to the blocked account will stop all your resources.
Resource management in organizations
-
After your billing account is added to an organization, only those clouds and DataSphere, Yandex DataLens, or Yandex Tracker instances that were created in your organization and those clouds and entities from other organizations you were granted access to will be available for linking in Yandex Cloud Billing
. -
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.