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