mirror of
https://github.com/Dannecron/netology-devops.git
synced 2025-12-26 07:42:36 +03:00
homework 7.3: add task 2
This commit is contained in:
@@ -9,16 +9,9 @@ resource "yandex_vpc_subnet" "subnet-1" {
|
||||
v4_cidr_blocks = ["192.168.10.0/24"]
|
||||
}
|
||||
|
||||
output "internal_ip_address_vm_1" {
|
||||
value = yandex_compute_instance.vm-1.network_interface.0.ip_address
|
||||
}
|
||||
|
||||
output "external_ip_address_vm_1" {
|
||||
value = yandex_compute_instance.vm-1.network_interface.0.nat_ip_address
|
||||
}
|
||||
|
||||
resource "yandex_compute_instance" "vm-1" {
|
||||
name = "test-vm-1"
|
||||
count = local.vm_count[terraform.workspace]
|
||||
|
||||
resources {
|
||||
cores = 2
|
||||
@@ -40,3 +33,15 @@ resource "yandex_compute_instance" "vm-1" {
|
||||
ssh-keys = "ubuntu:${file("~/.ssh/id_rsa.pub")}"
|
||||
}
|
||||
}
|
||||
|
||||
output "internal_ip_address_vm_1" {
|
||||
value = [
|
||||
for vm in yandex_compute_instance.vm-1 : vm.network_interface.0.ip_address
|
||||
]
|
||||
}
|
||||
|
||||
output "external_ip_address_vm_1" {
|
||||
value = [
|
||||
for vm in yandex_compute_instance.vm-1 : vm.network_interface.0.nat_ip_address
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user