Skip to content

Commit 52ef3f3

Browse files
sourcecdSergey Jblinkov
authored
add explicit link to resource in tf doc (#3129)
Co-authored-by: Sergey J <[email protected]> Co-authored-by: Ivan Blinkov <[email protected]>
1 parent 7983705 commit 52ef3f3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

ydb/docs/ru/core/db/terraform.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@
6868
6969
## Использование Terraform провайдера {{ ydb-short-name }} {#work-with-tf}
7070
71+
Для применения изменений в terraform ресурсах используются следующие команды:
72+
73+
1. `terraform init` - инициализация модуля terraform (выполняется в директории ресурсов terraform).
74+
2. `terraform validate` - проверка синтаксиса конфигурационных файлов ресурсов terraform.
75+
3. `terraform apply` - непосредственное применение конфигурации ресурсов terraform.
76+
77+
Для удобства использования файлы terraform рекомендуется именовать следующим образом:
78+
79+
1. `provider.tf` - содержит настройки самого terraform провайдера.
80+
2. `main.tf` - содержит набор ресурсов для создания.
81+
7182
### Соединение с базой данных (БД) {#connection_string}
7283
7384
Для всех ресурсов, описывающих объекты схемы данных, необходимо задать реквизиты БД, в которой они размещаются. Для этого укажите один из двух аргументов:
@@ -138,6 +149,8 @@ resource "ydb_table_index" "table_index" {
138149
name = "my_index"
139150
type = "global_sync" # "global_async"
140151
columns = ["a", "b"]
152+
153+
depends_on = [ydb_table.table] # ссылка на ресурс создания таблицы
141154
}
142155
143156
resource "ydb_table_changefeed" "table_changefeed" {
@@ -149,6 +162,8 @@ resource "ydb_table_changefeed" "table_changefeed" {
149162
name = "test"
150163
supported_codecs = ["raw", "gzip"]
151164
}
165+
166+
depends_on = [ydb_table.table] # ссылка на ресурс создания таблицы
152167
}
153168
154169
resource "ydb_topic" "test" {
@@ -507,6 +522,8 @@ resource "ydb_table_changefeed" "ydb_table_changefeed" {
507522
consumer {
508523
name = "test_consumer"
509524
}
525+
526+
depends_on = [ydb_table.ydb_table] # ссылка на ресурс создания таблицы
510527
}
511528
512529
resource "ydb_table_index" "ydb_table_index" {
@@ -515,6 +532,8 @@ resource "ydb_table_index" "ydb_table_index" {
515532
columns = ["c", "d"]
516533
cover = ["e"]
517534
type = "global_sync"
535+
536+
depends_on = [ydb_table.ydb_table] # ссылка на ресурс создания таблицы
518537
}
519538
```
520539

0 commit comments

Comments
 (0)