1.1 KiB
1.1 KiB
Resource nubes_postgres_database — Example
Service: nubes_postgres (ID: 90)
PostgreSQL (основной) | Operations | Database | Example
Copy-ready manifest (postgres_database_main.tf)
terraform {
required_providers {
nubes = {
source = "terra.k8c.ru/nubes-test/nubes"
version = "5.0.57"
}
}
}
provider "nubes" {
api_token = "ваш_токен"
api_endpoint = "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc"
}
# Родительский ресурс — nubes_postgres должен быть создан заранее
# resource "nubes_postgres" "baza" { ... }
# Пользователь должен быть создан заранее
# resource "nubes_postgres_user" "myapp" { ... }
resource "nubes_postgres_database" "example" {
postgres_id = nubes_postgres.baza.id
db_name = "myappdb" # только A-Z, a-z, 0-9, без подчёркиваний!
db_owner = nubes_postgres_user.myapp.username
}
}