1
0
Fork 0

get rid of dashes in resource names

This commit is contained in:
Von Random 2024-09-25 13:50:17 +03:00
parent d024a3b04e
commit 495e8bd09c

28
main.tf
View file

@ -22,7 +22,7 @@ resource "yandex_compute_instance" "vm" {
}
network_interface {
subnet_id = yandex_vpc_subnet.subnet-1.id
subnet_id = yandex_vpc_subnet.subnet1.id
nat = true
}
@ -35,31 +35,31 @@ resource "yandex_compute_instance" "vm" {
metadata = { user-data = "${file("users.yml")}" }
}
resource "yandex_vpc_network" "network-1" {
name = "network-1"
resource "yandex_vpc_network" "network1" {
name = "network1"
}
resource "yandex_vpc_subnet" "subnet-1" {
name = "subnet-1"
resource "yandex_vpc_subnet" "subnet1" {
name = "subnet1"
v4_cidr_blocks = [ "172.24.8.0/24"]
network_id = yandex_vpc_network.network-1.id
network_id = yandex_vpc_network.network1.id
}
resource "yandex_lb_target_group" "demo-1" {
name = "demo-1"
resource "yandex_lb_target_group" "group1" {
name = "group1"
target {
subnet_id = yandex_vpc_subnet.subnet-1.id
subnet_id = yandex_vpc_subnet.subnet1.id
address = yandex_compute_instance.vm[0].network_interface.0.ip_address
}
target {
subnet_id = yandex_vpc_subnet.subnet-1.id
subnet_id = yandex_vpc_subnet.subnet1.id
address = yandex_compute_instance.vm[1].network_interface.0.ip_address
}
}
resource "yandex_lb_network_load_balancer" "lb-1" {
name = "lb-1"
resource "yandex_lb_network_load_balancer" "balancer1" {
name = "balancer1"
deletion_protection = "false"
listener {
name = "my-lb1"
@ -70,7 +70,7 @@ resource "yandex_lb_network_load_balancer" "lb-1" {
}
attached_target_group {
target_group_id = yandex_lb_target_group.demo-1.id
target_group_id = yandex_lb_target_group.group1.id
healthcheck {
name = "http"
http_options {
@ -82,7 +82,7 @@ resource "yandex_lb_network_load_balancer" "lb-1" {
}
output "lb-ip" {
value = yandex_lb_network_load_balancer.lb-1.listener
value = yandex_lb_network_load_balancer.balancer1.listener
}
output "vm-ips" {