homework 7.3: add task 2

This commit is contained in:
2022-06-23 15:16:53 +07:00
parent 55f07be3d0
commit bb13a1061e
5 changed files with 483 additions and 9 deletions

View File

@@ -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
]
}