Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавил пример #20

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions examples/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
data "yandex_client_config" "client" {}

module "network" {
source = "git::https://github.com/terraform-yacloud-modules/terraform-yandex-vpc.git?ref=v1.0.0"

folder_id = data.yandex_client_config.client.folder_id

blank_name = "vpc-nat-gateway"
labels = {
repo = "terraform-yacloud-modules/terraform-yandex-vpc"
}

azs = ["ru-central1-a"]

private_subnets = [["10.4.0.0/24"]]

create_vpc = true
create_nat_gateway = true
}

module "mysql" {
source = "../"

# Общие настройки
name = "my-mysql-cluster"
description = "MySQL cluster created by Terraform"
environment = "PRODUCTION"
folder_id = data.yandex_client_config.client.folder_id
network_id = module.network.vpc_id
subnet_zones = ["ru-central1-a"]
subnet_id = [module.network.private_subnets_ids[0]]
labels = {
created_by = "terraform_mysql_module"
}
version_sql = "8.0"
resource_preset_id = "s1.micro"
disk_type_id = "network-ssd"
disk_size = 10

# Настройки безопасности
allow_ingress_v4_cidr_blocks = ["0.0.0.0/0"]

# Настройки MySQL
mysql_config = {
sql_mode = "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
max_connections = 100
default_authentication_plugin = "MYSQL_NATIVE_PASSWORD"
innodb_print_all_deadlocks = true
}

# Настройки обслуживания
maintenance_window = {
type = "ANYTIME"
}

# Настройки резервного копирования
backup_window_start = {
hours = 3
minutes = 0
}
backup_retain_period_days = 14

# Настройки доступа
access = {
data_lens = false
web_sql = true
data_transfer = false
}

# Настройки диагностики производительности
performance_diagnostics = {
enabled = true
sessions_sampling_interval = 3600
statements_sampling_interval = 7200
}

# Другие настройки
ha = false
deletion_protection = false
assign_public_ip = false
count_ha = 3

depends_on = [module.network]
}
Empty file added examples/outputs.tf
Empty file.
Empty file added examples/variables.tf
Empty file.
File renamed without changes.
10 changes: 10 additions & 0 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
terraform {
required_version = ">= 1.5.0"

required_providers {
yandex = {
source = "yandex-cloud/yandex"
version = ">= 0.110, < 1.0"
}
}
}
Loading