I cant create yandex_ydb_table with TTL in months (P2M).
However, if I change notation to days (P60D) table created.
Subsequent runs of terraform apply tries to change P2M in cloud on P60D as written in manifest.
If I change it to P2M there is no error (until I try to create new table with such manifest)
So, API accept only days notation, but store in internally in full ISO 8601 form.
1)
resource "yandex_ydb_table" "outbound" {
connection_string = yandex_ydb_database_serverless.this.ydb_full_endpoint
path = "${var.name}-table"
primary_key = ["event_id"]
ttl {
column_name = "_timestamp"
expire_interval = "P2M" # ISO 8601
}
column {
# our columns here
}
column {
name = "_timestamp"
type = "Timestamp"
not_null = false
}
column {
name = "_partition"
type = "String"
not_null = false
}
column {
name = "_offset"
type = "Uint64"
not_null = false
}
column {
name = "_idx"
type = "Uint32"
not_null = false
}
}
│ Error: failed to create table
│
│ with module.events.yandex_ydb_table.outbound,
│ on ../_modules/events-tracking/main.tf line 24, in resource "yandex_ydb_table" "outbound":
│ 24: resource "yandex_ydb_table" "outbound" {
│
│ non-retryable error occurred on attempt No.1 (idempotent=false): connError{node_id:0,address:'ru-central1-a.ydb.serverless.yandexcloud.net:2135'}: operation/GENERIC_ERROR (code = 400080, address =
│ ru-central1-a.ydb.serverless.yandexcloud.net:2135, issues = [{16:8 => 'Invalid value "P2M" for type Interval'}]) at `github.com/ydb-platform/ydb-go-sdk/v3/internal/conn.(*conn).Invoke(conn.go:373)`
│ at `github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.(*Balancer).wrapCall(balancer.go:358)` at
│ `github.com/ydb-platform/ydb-go-sdk/v3/internal/table.(*session).ExecuteSchemeQuery(session.go:841)` at `github.com/ydb-platform/ydb-go-sdk/v3/internal/table.do.func1(retry.go:54)` at
│ `github.com/ydb-platform/ydb-go-sdk/v3/internal/table.retryBackoff.func1(retry.go:85)` at `github.com/ydb-platform/ydb-go-sdk/v3/retry.Retry(retry.go:314)` at
│ `github.com/ydb-platform/ydb-go-sdk/v3/internal/table.(*Client).Do(client.go:658)`
yandex_ydb_table
with TTL in months (P2M
).P60D
) table created.terraform apply
tries to changeP2M
in cloud onP60D
as written in manifest.P2M
there is no error (until I try to create new table with such manifest)So, API accept only days notation, but store in internally in full ISO 8601 form.
1)
3)