### PostgreSQL Connection Steps Source: https://github.com/terraform-yc-modules/terraform-yc-postgresql/blob/master/README.md Provides instructions on how to connect to a PostgreSQL cluster managed by Yandex Cloud. This involves installing a root certificate and then using a generated connection string with `psql`. ```bash mkdir --parents ~/.postgresql && \ curl -sfL "https://storage.yandexcloud.net/cloud-certs/CA.pem" -o ~/.postgresql/root.crt && \ chmod 0600 ~/.postgresql/root.crt ``` ```bash psql "host=rc1a-g2em5m3zc9dxxasn.mdb.yandexcloud.net \ port=6432 \ sslmode=verify-full \ dbname=db-b \ user=owner-b \ target_session_attrs=read-write" ``` -------------------------------- ### Run Pre-commit Hooks for Terraform Modules Source: https://github.com/terraform-yc-modules/terraform-yc-postgresql/blob/master/CONTRIBUTING.md Execute all pre-commit hooks to validate changes before submitting a pull request. This ensures code quality and adherence to project standards. It is a mandatory step in the contribution process. ```shell pre-commit run -a ``` -------------------------------- ### Configure PostgreSQL Performance Diagnostics (Terraform) Source: https://github.com/terraform-yc-modules/terraform-yc-postgresql/blob/master/README.md Sets up performance diagnostics for the PostgreSQL cluster. Includes options to enable diagnostics and configure sampling intervals for sessions and statements. Helps in monitoring and optimizing database performance. ```terraform performance_diagnostics = object({ enabled = optional(bool, null) sessions_sampling_interval = optional(number, 60) statements_sampling_interval = optional(number, 600) }) ``` -------------------------------- ### Configure Terraform Authentication for Yandex Cloud CLI Source: https://github.com/terraform-yc-modules/terraform-yc-postgresql/blob/master/README.md Sets environment variables required for Terraform to authenticate with Yandex Cloud using the Yandex Cloud CLI. This includes obtaining an IAM token and specifying the cloud and folder IDs. ```bash export YC_TOKEN=$(yc iam create-token) export YC_CLOUD_ID=$(yc config get cloud-id) export YC_FOLDER_ID=$(yc config get folder-id) export TF_VAR_network_id=_vpc id here_ ``` -------------------------------- ### Set PostgreSQL Cluster Restore Parameters (Terraform) Source: https://github.com/terraform-yc-modules/terraform-yc-postgresql/blob/master/README.md Specifies parameters for creating a PostgreSQL cluster from a backup. Requires 'backup_id' and optionally accepts 'time' and 'time_inclusive' for point-in-time recovery. Enables disaster recovery and data restoration. ```terraform restore_parameters = object({ backup_id = string time = optional(string, null) time_inclusive = optional(bool, null) }) ``` -------------------------------- ### Terraform PostgreSQL User Configuration Source: https://github.com/terraform-yc-modules/terraform-yc-postgresql/blob/master/README.md Defines the structure for configuring additional PostgreSQL users with specific permissions. This includes user name, password (optional), grants, login status, connection limits, database permissions, settings, and deletion protection. If a password is not provided, a random one is generated. ```terraform list(object({ name = string password = optional(string, null) grants = optional(list(string), []) login = optional(bool, null) conn_limit = optional(number, null) permissions = optional(list(string), []) settings = optional(map(any), {}) deletion_protection = optional(bool, null) })) ``` -------------------------------- ### Configure PostgreSQL Maintenance Window (Terraform) Source: https://github.com/terraform-yc-modules/terraform-yc-postgresql/blob/master/README.md Defines the maintenance window for the PostgreSQL cluster. Supports 'ANYTIME' or 'WEEKLY' types, with specific day and hour settings for weekly windows. Ensures cluster maintenance is performed during scheduled downtimes. ```terraform maintenance_window = object({ type = string day = optional(string, null) hour = optional(string, null) }) ``` -------------------------------- ### Configure PostgreSQL Connection Pooler (Terraform) Source: https://github.com/terraform-yc-modules/terraform-yc-postgresql/blob/master/README.md Configures the connection pooler for the PostgreSQL cluster. Options include setting 'pool_discard' and specifying the 'pooling_mode' (UNSPECIFIED, SESSION, TRANSACTION, STATEMENT). Optimizes database connection management. ```terraform pooler_config = object({ pool_discard = optional(bool, null) pooling_mode = optional(string, null) }) ``` -------------------------------- ### Define PostgreSQL Cluster Owners (Terraform) Source: https://github.com/terraform-yc-modules/terraform-yc-postgresql/blob/master/README.md Specifies a list of database owners for the PostgreSQL cluster. Each owner can have a name, password, grants, login privileges, connection limits, settings, and deletion protection enabled. Users are created first and assigned ownership. ```terraform owners = list(object({ name = string password = optional(string, null) grants = optional(list(string), []) login = optional(bool, null) conn_limit = optional(number, null) settings = optional(map(any), {}) deletion_protection = optional(bool, null) })) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.