Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Terraform in Yandex Cloud
  • Getting started
  • Solution library
    • Overview
    • Release notes
          • mdb_postgresql_cluster
          • mdb_postgresql_database
          • mdb_postgresql_user

In this article:

  • Example usage
  • Schema
  • Optional
  • Read-Only
  • Nested Schema for config
  • Nested Schema for config.access
  • Nested Schema for config.backup_window_start
  • Nested Schema for config.disk_size_autoscaling
  • Nested Schema for config.performance_diagnostics
  • Nested Schema for config.pooler_config
  • Nested Schema for config.resources
  • Nested Schema for database
  • Nested Schema for database.extension
  • Nested Schema for host
  • Nested Schema for maintenance_window
  • Nested Schema for user
  • Nested Schema for user.permission
  1. Terraform reference
  2. Resources
  3. Managed Service for PostgreSQL
  4. Data Sources
  5. mdb_postgresql_cluster

yandex_mdb_postgresql_cluster (Data Source)

Written by
Yandex Cloud
Updated at September 11, 2025
  • Example usage
  • Schema
    • Optional
    • Read-Only
    • Nested Schema for config
    • Nested Schema for config.access
    • Nested Schema for config.backup_window_start
    • Nested Schema for config.disk_size_autoscaling
    • Nested Schema for config.performance_diagnostics
    • Nested Schema for config.pooler_config
    • Nested Schema for config.resources
    • Nested Schema for database
    • Nested Schema for database.extension
    • Nested Schema for host
    • Nested Schema for maintenance_window
    • Nested Schema for user
    • Nested Schema for user.permission

Get information about a Yandex Managed PostgreSQL cluster. For more information, see the official documentation. How to connect to the DB. To connect, use port 6432. The port number is not configurable.

Warning

Either cluster_id or name should be specified.

Example usageExample usage

//
// Get information about existing MDB PostgreSQL Cluster.
//
data "yandex_mdb_postgresql_cluster" "my_cluster" {
  name = "test"
}

output "fqdn" {
  value = data.yandex_mdb_postgresql_cluster.my_cluster.host.0.fqdn
}

SchemaSchema

OptionalOptional

  • cluster_id (String) The ID of the PostgreSQL cluster.
  • deletion_protection (Boolean) The true value means that resource is protected from accidental deletion.
  • description (String) The resource description.
  • disk_encryption_key_id (String) ID of the KMS key for cluster disk encryption.
  • folder_id (String) The folder identifier that resource belongs to. If it is not provided, the default provider folder-id is used.
  • name (String) The name of the PostgreSQL cluster.

Read-OnlyRead-Only

  • config (List of Object) Configuration of the PostgreSQL cluster. (see below for nested schema)

  • created_at (String) The creation timestamp of the resource.

  • database (Set of Object)

    Warning

    Deprecated! To manage databases, please switch to using a separate resource type yandex_mdb_postgresql_database. (see below for nested schema)

  • environment (String) Deployment environment of the PostgreSQL cluster.

  • health (String) Aggregated health of the cluster.

  • host (List of Object) A host of the PostgreSQL cluster. (see below for nested schema)

  • host_group_ids (Set of String) Host Group IDs.

  • id (String) The ID of this resource.

  • labels (Map of String) A set of key/value label pairs which assigned to resource.

  • maintenance_window (List of Object) Maintenance policy of the PostgreSQL cluster. (see below for nested schema)

  • network_id (String) The VPC Network ID of subnets which resource attached to.

  • security_group_ids (Set of String) The list of security groups applied to resource or their components.

  • status (String) Status of the cluster.

  • user (List of Object)

    Warning

    Deprecated! To manage users, please switch to using a separate resource type yandex_mdb_postgresql_user. (see below for nested schema)

Nested Schema for Nested Schema for config

Read-Only:

  • access (Block List, Max: 1) Access policy to the PostgreSQL cluster. (see below for nested schema)

  • autofailover (Boolean) Configuration setting which enables/disables autofailover in cluster.

  • backup_retain_period_days (Number) The period in days during which backups are stored.

  • backup_window_start (Block List, Max: 1) Time to start the daily backup, in the UTC timezone. (see below for nested schema)

  • disk_size_autoscaling (Block List, Max: 1) Cluster disk size autoscaling settings. (see below for nested schema)

  • performance_diagnostics (Block List, Max: 1) Cluster performance diagnostics settings. YC Documentation. (see below for nested schema)

  • pooler_config (Block List, Max: 1) Configuration of the connection pooler. (see below for nested schema)

  • postgresql_config (Map of String) PostgreSQL cluster configuration. For detailed information specific to your PostgreSQL version, please refer to the API proto specifications.

  • resources (Block List, Min: 1, Max: 1) Resources allocated to hosts of the PostgreSQL cluster. (see below for nested schema)

  • version (String) Version of the PostgreSQL cluster. (allowed versions are: 13, 13-1c, 14, 14-1c, 15, 15-1c, 16, 17).

Nested Schema for Nested Schema for config.access

Read-Only:

  • data_lens (Boolean) Allow access for Yandex DataLens.

  • data_transfer (Boolean) Allow access for DataTransfer.

  • serverless (Boolean) Allow access for connection to managed databases from functions.

  • web_sql (Boolean) Allow access for SQL queries in the management console.

Nested Schema for Nested Schema for config.backup_window_start

Read-Only:

  • hours (Number) The hour at which backup will be started (UTC).

  • minutes (Number) The minute at which backup will be started.

Nested Schema for Nested Schema for config.disk_size_autoscaling

Read-Only:

  • disk_size_limit (Number) The overall maximum for disk size that limit all autoscaling iterations. See the documentation for details.

  • emergency_usage_threshold (Number) Threshold of storage usage (in percent) that triggers immediate automatic scaling of the storage. Zero value means disabled threshold.

  • planned_usage_threshold (Number) Threshold of storage usage (in percent) that triggers automatic scaling of the storage during the maintenance window. Zero value means disabled threshold.

Nested Schema for Nested Schema for config.performance_diagnostics

Read-Only:

  • enabled (Boolean) Enable performance diagnostics.

  • sessions_sampling_interval (Number) Interval (in seconds) for pg_stat_activity sampling. Acceptable values are 1 to 86400, inclusive.

  • statements_sampling_interval (Number) Interval (in seconds) for pg_stat_statements sampling. Acceptable values are 1 to 86400, inclusive.

Nested Schema for Nested Schema for config.pooler_config

Read-Only:

  • pool_discard (Boolean) Setting pool_discard parameter in Odyssey.

  • pooling_mode (String) Mode that the connection pooler is working in. See descriptions of all modes in the [documentation for Odyssey](https://github.com/yandex/odyssey/blob/master/documentation/configuration.md#pool-string.

Nested Schema for Nested Schema for config.resources

Read-Only:

  • disk_size (Number) Volume of the storage available to a PostgreSQL host, in gigabytes.

  • disk_type_id (String) Type of the storage of PostgreSQL hosts.

  • resource_preset_id (String) The ID of the preset for computational resources available to a PostgreSQL host (CPU, memory etc.). For more information, see the official documentation.

Nested Schema for Nested Schema for database

Read-Only:

  • extension (Block Set) Set of database extensions. (see below for nested schema)

  • lc_collate (String) POSIX locale for string sorting order. Forbidden to change in an existing database.

  • lc_type (String) POSIX locale for character classification. Forbidden to change in an existing database.

  • name (String) The resource name.

  • owner (String) Name of the user assigned as the owner of the database. Forbidden to change in an existing database.

  • template_db (String) Name of the template database.

Nested Schema for Nested Schema for database.extension

Read-Only:

  • name (String) Name of the database extension. For more information on available extensions see the official documentation.

  • version (String) Version of the extension.

Nested Schema for Nested Schema for host

Read-Only:

  • assign_public_ip (Boolean) Whether the host should get a public IP address.

  • fqdn (String) The fully qualified domain name of the host.

  • priority (Number) Host priority in HA group. It works only when name is set.

  • replication_source (String) Host replication source (fqdn), when replication_source is empty then host is in HA group.

  • role (String) Host's role (replica|primary), computed by server.

  • subnet_id (String) The ID of the subnet, to which the host belongs. The subnet must be a part of the network to which the cluster belongs.

  • zone (String) The availability zone where resource is located. If it is not provided, the default provider zone will be used.

Nested Schema for Nested Schema for maintenance_window

Read-Only:

  • day (String) Day of the week (in DDD format). Allowed values: MON, TUE, WED, THU, FRI, SAT, SUN

  • hour (Number) Hour of the day in UTC (in HH format). Allowed value is between 1 and 24.

  • type (String) Type of maintenance window. Can be either ANYTIME or WEEKLY. A day and hour of window need to be specified with weekly window.

Nested Schema for Nested Schema for user

Read-Only:

  • conn_limit (Number) The maximum number of connections per user. (Default 50).

  • grants (List of String) List of the user's grants.

  • login (Boolean) User's ability to login.

  • name (String) The name of the user.

  • permission (Block Set) Set of permissions granted to the user. (see below for nested schema)

  • settings (Map of String) Map of user settings. Full description.

Nested Schema for Nested Schema for user.permission

Read-Only:

  • database_name (String) The name of the database that the permission grants access to.

Was the article helpful?

Previous
mdb_opensearch_cluster
Next
mdb_postgresql_database
© 2025 Direct Cursus Technology L.L.C.