Creating a new cloud
After you sign up with Yandex Cloud and create an organization, you will create your first cloud. If you need an additional cloud, follow the same guide to create it.
To create a cloud:
-
On the Yandex Cloud Billing
page, make sure your billing account isACTIVEorTRIAL_ACTIVE. If you do not have a billing account, create one or ask your administrator to assign you thebilling.accounts.memberrole for a billing account. -
Navigate to the management console
. -
In the upper left corner next to the Search field, click
. In the window that opens:-
Enter a name for the cloud. The naming requirements are as follows:
- It must be from 2 to 63 characters long.
- It can only contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
-
If you have multiple organizations, select the one you need.
-
Click Create.
-
Note
To create a new cloud using the Yandex Cloud CLI, link the organization to a CLI profile.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
-
View the description of the create cloud command:
yc resource-manager cloud create --help -
If you do not have a linked organization yet, link the one you want to create the cloud in to the CLI profile.
yc config set organization-id <organization_ID>Where
<organization_ID>is the ID of the organization to create the cloud in. -
To create the cloud, run this command:
yc resource-manager cloud create \ --name <cloud_name> \ --billing-account-id <billing_account_ID>Where:
-
--name: Name of the cloud you are creating. The naming requirements are as follows:- It must be from 2 to 63 characters long.
- It can only contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
-
--billing-account-id: ID of the billing account to link the new cloud to.You can get the billing account ID in the Yandex Cloud Billing interface
under Account information on the billing account page.
Result:
done (4s) id: b1gbi30tq0m9******** created_at: "2024-12-10T09:25:22Z" name: my-new-cloud organization_id: bpfaidqca8vd******** -
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
Warning
To activate the cloud, make sure to link it to your billing account. Until then, the new cloud will remain in the Creating status. To link the cloud to your billing account, use the yandex_billing_cloud_binding resource and specify the cloud ID in the cloud_id field.
-
In the Terraform configuration file, describe the resources you want to create:
# Creating a cloud resource "yandex_resourcemanager_cloud" "cloud1" { name = "<cloud_name>" organization_id = "<organization_ID>" } # Linking the cloud to the billing account 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:- It must be from 2 to 63 characters long.
- It can only contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
-
organization_id: Organization ID. Terraform allows you to create a cloud only for an existing organization. -
billing_account_id: ID of the billing account to link the new cloud to.You can get the billing account ID in the Yandex Cloud Billing
interface under Account information on the billing account page. -
cloud_id: ID of the cloud to link to the billing account.
For more information about the
yandex_resourcemanager_cloudandyandex_billing_cloud_bindingresource parameters in Terraform, see the relevant provider documentation. -
-
Create the resources:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
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.