Skip to content

Commit

Permalink
add backend_ips tests
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-mzi committed Nov 13, 2024
1 parent 2b384d9 commit bb9c168
Show file tree
Hide file tree
Showing 12 changed files with 4,469 additions and 0 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
resource "outscale_keypair" "my_keypair" {
keypair_name = "KP-TF011"
}

resource "outscale_security_group" "security_groupTF011" {
description = "Terraform"
security_group_name = "terraform-TF011"
}


resource "outscale_vm" "vm011" {
count = 3
security_group_ids = [outscale_security_group.security_groupTF011.security_group_id]
image_id = var.image_id
vm_type = var.vm_type
keypair_name = outscale_keypair.my_keypair.keypair_name
tags {
key = "name"
value = "vm-TF011"
}
}


resource "outscale_load_balancer" "public_lbu11" {
load_balancer_name = "lbu-TF-011-${var.suffixe_lbu_name}"
subregion_names = ["${var.region}a"]
listeners {
backend_port = 80
backend_protocol = "TCP"
load_balancer_protocol = "TCP"
load_balancer_port = 80
}
listeners {
backend_port = 8080
backend_protocol = "HTTP"
load_balancer_protocol = "HTTP"
load_balancer_port = 8080
}
tags {
key = "name"
value = "public_lbu1"
}
}


resource "outscale_load_balancer_vms" "outscale_load_balancer_vms011" {
load_balancer_name = outscale_load_balancer.public_lbu11.load_balancer_name
backend_ips = [outscale_vm.vm011[0].public_ip,outscale_vm.vm011[1].public_ip]
}

data "outscale_load_balancer" "load_balancer_TF011" {
filter {
name = "load_balancer_names"
values = [outscale_load_balancer.public_lbu11.load_balancer_name]
}
depends_on =[outscale_load_balancer_vms.outscale_load_balancer_vms011]
}
Loading

0 comments on commit bb9c168

Please sign in to comment.