diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d5886a6..312d651 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.77.0 + rev: v1.92.1 hooks: - id: terraform_fmt - id: terraform_validate @@ -23,7 +23,7 @@ repos: - '--args=--only=terraform_standard_module_structure' - '--args=--only=terraform_workspace_remote' - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: check-merge-conflict - id: end-of-file-fixer diff --git a/examples/outputs.tf b/examples/outputs.tf index e69de29..43e4fd2 100644 --- a/examples/outputs.tf +++ b/examples/outputs.tf @@ -0,0 +1,69 @@ +output "id" { + description = "The ID of the MySQL cluster" + value = module.mysql.id +} + +output "name" { + description = "The name of the MySQL cluster" + value = module.mysql.name +} + +output "fqdn" { + description = "The fully qualified domain name of the MySQL cluster" + value = module.mysql.fqdn +} + +output "hosts" { + description = "List of host FQDNs in the MySQL cluster" + value = module.mysql.hosts +} + +output "network_id" { + description = "The ID of the network to which the MySQL cluster belongs" + value = module.mysql.network_id +} + +output "security_group_id" { + description = "The ID of the security group assigned to the MySQL cluster" + value = module.mysql.security_group_id +} + +output "environment" { + description = "The deployment environment of the MySQL cluster" + value = module.mysql.environment +} + +output "version" { + description = "The version of the MySQL cluster" + value = module.mysql.version +} + +output "resources" { + description = "The resources allocated to the MySQL cluster" + value = module.mysql.resources +} + +output "maintenance_window" { + description = "The maintenance window settings of the MySQL cluster" + value = module.mysql.maintenance_window +} + +output "backup_window_start" { + description = "The backup window start time of the MySQL cluster" + value = module.mysql.backup_window_start +} + +output "backup_retain_period_days" { + description = "The number of days to retain backups for the MySQL cluster" + value = module.mysql.backup_retain_period_days +} + +output "access" { + description = "The access settings of the MySQL cluster" + value = module.mysql.access +} + +output "performance_diagnostics" { + description = "The performance diagnostics settings of the MySQL cluster" + value = module.mysql.performance_diagnostics +} diff --git a/outputs.tf b/outputs.tf index ecfe599..e95253e 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,24 +1,88 @@ -output "db_info" { - value = yandex_mdb_mysql_cluster.mysql - description = "Full information about the cluster" +output "id" { + description = "The ID of the MySQL cluster" + value = yandex_mdb_mysql_cluster.mysql.id } -output "hosts_fqdn" { +output "name" { + description = "The name of the MySQL cluster" + value = yandex_mdb_mysql_cluster.mysql.name +} + +output "fqdn" { + description = "The fully qualified domain name of the MySQL cluster" + value = "c-${yandex_mdb_mysql_cluster.mysql.id}.rw.mdb.yandexcloud.net" +} + +output "hosts" { + description = "List of host FQDNs in the MySQL cluster" value = [for host in yandex_mdb_mysql_cluster.mysql.host : host.fqdn] - description = "List of server FQDN" } -output "hosts_name" { - value = [for host in yandex_mdb_mysql_cluster.mysql.host : host.name] - description = "List of server names" +output "network_id" { + description = "The ID of the network to which the MySQL cluster belongs" + value = yandex_mdb_mysql_cluster.mysql.network_id } -output "id" { - value = yandex_mdb_mysql_cluster.mysql.id - description = "cluster ID" +output "security_group_id" { + description = "The ID of the security group assigned to the MySQL cluster" + value = yandex_vpc_security_group.mysql.id } -output "name" { - value = yandex_mdb_mysql_cluster.mysql.name - description = "cluster name" +output "environment" { + description = "The deployment environment of the MySQL cluster" + value = yandex_mdb_mysql_cluster.mysql.environment +} + +output "version" { + description = "The version of the MySQL cluster" + value = yandex_mdb_mysql_cluster.mysql.version +} + +output "resources" { + description = "The resources allocated to the MySQL cluster" + value = { + resource_preset_id = yandex_mdb_mysql_cluster.mysql.resources[0].resource_preset_id + disk_type_id = yandex_mdb_mysql_cluster.mysql.resources[0].disk_type_id + disk_size = yandex_mdb_mysql_cluster.mysql.resources[0].disk_size + } +} + +output "maintenance_window" { + description = "The maintenance window settings of the MySQL cluster" + value = { + type = yandex_mdb_mysql_cluster.mysql.maintenance_window[0].type + day = yandex_mdb_mysql_cluster.mysql.maintenance_window[0].day + hour = yandex_mdb_mysql_cluster.mysql.maintenance_window[0].hour + } +} + +output "backup_window_start" { + description = "The backup window start time of the MySQL cluster" + value = { + hours = yandex_mdb_mysql_cluster.mysql.backup_window_start[0].hours + minutes = yandex_mdb_mysql_cluster.mysql.backup_window_start[0].minutes + } +} + +output "backup_retain_period_days" { + description = "The number of days to retain backups for the MySQL cluster" + value = yandex_mdb_mysql_cluster.mysql.backup_retain_period_days +} + +output "access" { + description = "The access settings of the MySQL cluster" + value = { + data_lens = yandex_mdb_mysql_cluster.mysql.access[0].data_lens + web_sql = yandex_mdb_mysql_cluster.mysql.access[0].web_sql + data_transfer = yandex_mdb_mysql_cluster.mysql.access[0].data_transfer + } +} + +output "performance_diagnostics" { + description = "The performance diagnostics settings of the MySQL cluster" + value = { + enabled = yandex_mdb_mysql_cluster.mysql.performance_diagnostics[0].enabled + sessions_sampling_interval = yandex_mdb_mysql_cluster.mysql.performance_diagnostics[0].sessions_sampling_interval + statements_sampling_interval = yandex_mdb_mysql_cluster.mysql.performance_diagnostics[0].statements_sampling_interval + } }