Terraform Quick Start
All resources created with Terraform are charged according to the service payment model. Charging for a resource starts after the resource is created.
The cost of resources created using Terraform does not differ from the cost of resources created using the dashboard.
1. Install Terraform
- Download the Terraform distribution for your operating system from the HashiCorp website. We recommend downloading Terraform 1.9.
- Install Terraform. For Linux and macOS, use the Install Terraform instructions in the HashiCorp documentation.
2. Create a service user
To work with the examples, you need to create a service user with two roles:
member
in the Account access area — the role is needed to initialize the Servercore provider and create resources;- и
iam_admin
— to create additional users and differentiate access in projects.
-
In the control panel, on the top menu, click Account.
-
Go to the Service Users section.
-
Click Add Service User.
-
In the Service User Data block:
4.1 Enter a user name. This will be used for authorization.
4.2 Enter a password for the user or generate one.Once a user is created, you cannot view the password — you can only change it.The password must be no shorter than 20 characters and include a minimum:
- one uppercase and one lowercase Latin letter
(A-Z
,a-z
); - one digit
(0-9
); - one special character from the ASCII Printable 7-Bit Special Characters list:
!"#$%&'()*+,-./:;<=>?@[]^_{|}~.
- one uppercase and one lowercase Latin letter
-
In the Account Access block:
5.1 Set the resolution by selecting:
- access area — Account;
- a role —
iam_admin
.
5.2 Optional: To assign another permission to the user, click Add Permission and repeat step 5.1.
5.3 Optional: select a group for the user.
-
Click Add User. It will be added to the list on the Service Users page . The account will be active immediately.