Creating a new cloud
At sign-up, the system automatically creates for you a cloud named cloud-<Yandex_ID>
. After you link a billing account, you can create an additional cloud.
To create an additional cloud:
-
On the Yandex Cloud Billing
page, make sure you have a billing account linked and it has theACTIVE
orTRIAL_ACTIVE
status. If you do not have a billing account, create one or ask your administrator to assign you thebilling.accounts.member
role for a billing account. -
Go to Yandex Cloud Organization
. -
In the left-hand panel, select
Clouds & services . -
Under Yandex Cloud management console, click
Create cloud. -
In the window that opens, enter a cloud name. The naming requirements are as follows:
- The name must be from 3 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter and the last character cannot be a hyphen.
-
Click Create.
If you don't have Terraform, install it and configure the Yandex Cloud provider.
To activate the cloud, make sure to link it to your billing account. To do this, use the yandex_billing_cloud_binding
resource and specify the cloud in the cloud_id
field.
-
In the configuration file, describe the parameters of the resources you want to create:
resource "yandex_resourcemanager_cloud" "cloud1" { name = "<cloud_name>" organization_id = "<organization_ID>" } resource "yandex_billing_cloud_binding" "mycloud" { billing_account_id = "<billing_account_ID>" cloud_id = yandex_resourcemanager_cloud.cloud1.id }
Where:
-
name
: Cloud name. The naming requirements are as follows:- The name must be from 3 to 63 characters long.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter and the last character cannot be a hyphen.
-
organization_id
: Organization ID. Terraform allows you to create a cloud only for an existing organization. You can get a list of organization IDs using the CLI command:yc organization-manager organization list
. -
billing_account_id
: Billing account ID. -
cloud_id
: ID of the cloud to link to the billing account.
For more information about the
yandex_resourcemanager_cloud
andyandex_billing_cloud_binding
resource parameters in Terraform, see the 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.
-
This will create a cloud linked to your billing account in the organization. You can check the new cloud and its parameters in the management console
yc resource-manager cloud list
To create a cloud, use the create REST API method for the Cloud resource or the CloudService/Create gRPC API call.
Note
When you create a cloud, you are automatically given the owner role in this cloud.