From bb9c1680f6cbf47a446d2bb21ff47af1624fc20b Mon Sep 17 00:00:00 2001 From: outscale-mzi Date: Wed, 13 Nov 2024 11:53:28 +0100 Subject: [PATCH] add backend_ips tests --- ...blic_load_balancer_vm_ip_attributes_ok.ref | 508 ++++++++++++ ...ublic_load_balancer_vm_ip_attributes_ok.tf | 57 ++ ...lic_load_balancer_update_backend_ip_ok.ref | 508 ++++++++++++ ...blic_load_balancer_update_backend_ip_ok.tf | 57 ++ ...oad_balancer_backend_ips_attributes_ok.ref | 753 +++++++++++++++++ ...load_balancer_backend_ips_attributes_ok.tf | 81 ++ ...ic_load_balancer_update_backend_ips_ok.ref | 754 +++++++++++++++++ ...lic_load_balancer_update_backend_ips_ok.tf | 82 ++ ...ic_load_balancer_update_backend_ips_ok.ref | 756 ++++++++++++++++++ ...lic_load_balancer_update_backend_ips_ok.tf | 82 ++ ..._balancer_add_backend_vm_attributes_ok.ref | 718 +++++++++++++++++ ...d_balancer_add_backend_vm_attributes_ok.tf | 113 +++ 12 files changed, 4469 insertions(+) create mode 100644 tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step1.public_load_balancer_vm_ip_attributes_ok.ref create mode 100644 tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step1.public_load_balancer_vm_ip_attributes_ok.tf create mode 100644 tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step2.public_load_balancer_update_backend_ip_ok.ref create mode 100644 tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step2.public_load_balancer_update_backend_ip_ok.tf create mode 100644 tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step1.public_load_balancer_backend_ips_attributes_ok.ref create mode 100644 tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step1.public_load_balancer_backend_ips_attributes_ok.tf create mode 100644 tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step2.public_load_balancer_update_backend_ips_ok.ref create mode 100644 tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step2.public_load_balancer_update_backend_ips_ok.tf create mode 100644 tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step3.public_load_balancer_update_backend_ips_ok.ref create mode 100644 tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step3.public_load_balancer_update_backend_ips_ok.tf create mode 100644 tests/qa_provider_oapi/data/nets/TF-02_internet_facing_lbu_update_backend_vms_ok/step1.private_internet_facing_load_balancer_add_backend_vm_attributes_ok.ref create mode 100644 tests/qa_provider_oapi/data/nets/TF-02_internet_facing_lbu_update_backend_vms_ok/step1.private_internet_facing_load_balancer_add_backend_vm_attributes_ok.tf diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step1.public_load_balancer_vm_ip_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step1.public_load_balancer_vm_ip_attributes_ok.ref new file mode 100644 index 000000000..1d1f71482 --- /dev/null +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step1.public_load_balancer_vm_ip_attributes_ok.ref @@ -0,0 +1,508 @@ +{ + "version": "########", + "terraform_version": "########", + "serial": "########", + "lineage": "########", + "outputs": {}, + "resources": [ + { + "mode": "data", + "type": "outscale_load_balancer", + "name": "load_balancer_TF011", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [ + "##id-0##", + "##id-1##" + ], + "dns_name": "########", + "filter": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-2##", + "listeners": [ + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [], + "source_security_group": [ + { + "security_group_account_id": "##id-3##", + "security_group_name": "outscale-elb-sg" + } + ], + "subnets": [], + "subregion_names": [ + "eu-west-2a" + ], + "tags": [ + { + "key": "name", + "value": "public_lbu1" + } + ] + }, + "sensitive_attributes": [] + } + ] + }, + { + "mode": "managed", + "type": "outscale_keypair", + "name": "my_keypair", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-4##", + "keypair_fingerprint": "########", + "keypair_name": "KP-TF011", + "private_key": "########", + "public_key": null, + "request_id": "########", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJyZWFkIjo2MDAwMDAwMDAwMDB9fQ==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer", + "name": "public_lbu11", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [], + "dns_name": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-2##", + "listeners": [ + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [], + "source_security_group": [ + { + "security_group_account_id": "##id-3##", + "security_group_name": "outscale-elb-sg" + } + ], + "subnets": [], + "subregion_names": [ + "eu-west-2a" + ], + "tags": [ + { + "key": "name", + "value": "public_lbu1" + } + ] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer_vms", + "name": "outscale_load_balancer_vms011", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "backend_ips": "########", + "backend_vm_ids": null, + "id": "##id-5##", + "load_balancer_name": "########", + "request_id": "########" + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_load_balancer.public_lbu11", + "outscale_security_group.security_groupTF011", + "outscale_vm.vm011" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_security_group", + "name": "security_groupTF011", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "account_id": "##id-6##", + "description": "Terraform", + "id": "##id-7##", + "inbound_rules": [], + "net_id": "", + "outbound_rules": [], + "remove_default_outbound_rule": false, + "request_id": "########", + "security_group_id": "##id-7##", + "security_group_name": "terraform-TF011", + "tag": null, + "tags": [] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_vm", + "name": "vm011", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-8##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-1##", + "image_id": "##id-9##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF011", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-10##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-7##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-7##", + "security_group_name": "terraform-TF011" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF011" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-1##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF011" + ] + }, + { + "index_key": 1, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-11##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-0##", + "image_id": "##id-9##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF011", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-12##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-7##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-7##", + "security_group_name": "terraform-TF011" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF011" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-0##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF011" + ] + }, + { + "index_key": 2, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-13##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-14##", + "image_id": "##id-9##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF011", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-15##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-7##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-7##", + "security_group_name": "terraform-TF011" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF011" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-14##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF011" + ] + } + ] + } + ], + "check_results": "########" +} \ No newline at end of file diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step1.public_load_balancer_vm_ip_attributes_ok.tf b/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step1.public_load_balancer_vm_ip_attributes_ok.tf new file mode 100644 index 000000000..02379e173 --- /dev/null +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step1.public_load_balancer_vm_ip_attributes_ok.tf @@ -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] +} diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step2.public_load_balancer_update_backend_ip_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step2.public_load_balancer_update_backend_ip_ok.ref new file mode 100644 index 000000000..04cfc0c4b --- /dev/null +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step2.public_load_balancer_update_backend_ip_ok.ref @@ -0,0 +1,508 @@ +{ + "version": "########", + "terraform_version": "########", + "serial": "########", + "lineage": "########", + "outputs": {}, + "resources": [ + { + "mode": "data", + "type": "outscale_load_balancer", + "name": "load_balancer_TF011", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [ + "##id-0##", + "##id-1##" + ], + "dns_name": "########", + "filter": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-2##", + "listeners": [ + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [], + "source_security_group": [ + { + "security_group_account_id": "##id-3##", + "security_group_name": "outscale-elb-sg" + } + ], + "subnets": [], + "subregion_names": [ + "eu-west-2a" + ], + "tags": [ + { + "key": "name", + "value": "public_lbu1" + } + ] + }, + "sensitive_attributes": [] + } + ] + }, + { + "mode": "managed", + "type": "outscale_keypair", + "name": "my_keypair", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-4##", + "keypair_fingerprint": "########", + "keypair_name": "KP-TF011", + "private_key": "########", + "public_key": null, + "request_id": "########", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJyZWFkIjo2MDAwMDAwMDAwMDB9fQ==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer", + "name": "public_lbu11", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [], + "dns_name": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-2##", + "listeners": [ + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [], + "source_security_group": [ + { + "security_group_account_id": "##id-3##", + "security_group_name": "outscale-elb-sg" + } + ], + "subnets": [], + "subregion_names": [ + "eu-west-2a" + ], + "tags": [ + { + "key": "name", + "value": "public_lbu1" + } + ] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer_vms", + "name": "outscale_load_balancer_vms011", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "backend_ips": "########", + "backend_vm_ids": null, + "id": "##id-5##", + "load_balancer_name": "########", + "request_id": "########" + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_load_balancer.public_lbu11", + "outscale_security_group.security_groupTF011", + "outscale_vm.vm011" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_security_group", + "name": "security_groupTF011", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "account_id": "##id-6##", + "description": "Terraform", + "id": "##id-7##", + "inbound_rules": [], + "net_id": "", + "outbound_rules": [], + "remove_default_outbound_rule": false, + "request_id": "########", + "security_group_id": "##id-7##", + "security_group_name": "terraform-TF011", + "tag": null, + "tags": [] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_vm", + "name": "vm011", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-8##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-1##", + "image_id": "##id-9##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF011", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-10##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-7##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-7##", + "security_group_name": "terraform-TF011" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF011" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-1##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF011" + ] + }, + { + "index_key": 1, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-11##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-12##", + "image_id": "##id-9##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF011", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-13##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-7##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-7##", + "security_group_name": "terraform-TF011" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF011" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-12##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF011" + ] + }, + { + "index_key": 2, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-14##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-0##", + "image_id": "##id-9##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF011", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-15##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-7##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-7##", + "security_group_name": "terraform-TF011" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF011" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-0##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF011" + ] + } + ] + } + ], + "check_results": "########" +} \ No newline at end of file diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step2.public_load_balancer_update_backend_ip_ok.tf b/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step2.public_load_balancer_update_backend_ip_ok.tf new file mode 100644 index 000000000..ba3921a16 --- /dev/null +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-011_public_load_balancer_vm_ip_attributes_ok/step2.public_load_balancer_update_backend_ip_ok.tf @@ -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[2].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] +} diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step1.public_load_balancer_backend_ips_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step1.public_load_balancer_backend_ips_attributes_ok.ref new file mode 100644 index 000000000..ac686c1fb --- /dev/null +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step1.public_load_balancer_backend_ips_attributes_ok.ref @@ -0,0 +1,753 @@ +{ + "version": "########", + "terraform_version": "########", + "serial": "########", + "lineage": "########", + "outputs": {}, + "resources": [ + { + "mode": "data", + "type": "outscale_load_balancer", + "name": "load_balancer_TF01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [ + "##id-0##" + ], + "dns_name": "########", + "filter": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-1##", + "listeners": [ + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [], + "source_security_group": [ + { + "security_group_account_id": "##id-2##", + "security_group_name": "outscale-elb-sg" + } + ], + "subnets": [], + "subregion_names": [ + "eu-west-2a" + ], + "tags": [ + { + "key": "name", + "value": "public_lbu1" + } + ] + }, + "sensitive_attributes": [] + } + ] + }, + { + "mode": "managed", + "type": "outscale_keypair", + "name": "my_keypair", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-3##", + "keypair_fingerprint": "########", + "keypair_name": "KP-TF01", + "private_key": "########", + "public_key": null, + "request_id": "########", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJyZWFkIjo2MDAwMDAwMDAwMDB9fQ==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer", + "name": "public_lbu1", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [], + "dns_name": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-1##", + "listeners": [ + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [], + "source_security_group": [ + { + "security_group_account_id": "##id-2##", + "security_group_name": "outscale-elb-sg" + } + ], + "subnets": [], + "subregion_names": [ + "eu-west-2a" + ], + "tags": [ + { + "key": "name", + "value": "public_lbu1" + } + ] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer_vms", + "name": "outscale_load_balancer_vms01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "backend_ips": "########", + "backend_vm_ids": null, + "id": "##id-4##", + "load_balancer_name": "########", + "request_id": "########" + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_load_balancer.public_lbu1", + "outscale_public_ip.public_ip01", + "outscale_public_ip_link.public_ip_link01", + "outscale_security_group.security_groupTF01", + "outscale_vm.vm01" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_public_ip", + "name": "public_ip01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-5##", + "link_public_ip_id": "", + "nic_account_id": "", + "nic_id": "", + "private_ip": "########", + "public_ip": "########", + "public_ip_id": "##id-5##", + "request_id": "########", + "tags": [ + { + "key": "name", + "value": "EIP-TF01" + } + ], + "timeouts": null, + "vm_id": "" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDB9fQ==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_public_ip_link", + "name": "public_ip_link01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "allow_relink": null, + "id": "##id-6##", + "link_public_ip_id": "##id-6##", + "nic_account_id": "##id-7##", + "nic_id": "##id-8##", + "private_ip": "########", + "public_ip": "########", + "public_ip_id": "##id-5##", + "request_id": "########", + "tags": [ + { + "key": "name", + "value": "EIP-TF01" + } + ], + "timeouts": null, + "vm_id": "##id-0##" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_public_ip.public_ip01", + "outscale_security_group.security_groupTF01", + "outscale_vm.vm01" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_security_group", + "name": "security_groupTF01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "account_id": "##id-7##", + "description": "Terraform", + "id": "##id-9##", + "inbound_rules": [], + "net_id": "", + "outbound_rules": [], + "remove_default_outbound_rule": false, + "request_id": "########", + "security_group_id": "##id-9##", + "security_group_name": "terraform-TF01", + "tag": null, + "tags": [] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_vm", + "name": "vm01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-10##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-0##", + "image_id": "##id-11##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-12##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-9##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-9##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-0##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_vm", + "name": "vm02", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-13##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-14##", + "image_id": "##id-11##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-15##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-9##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-9##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-0" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-14##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + }, + { + "index_key": 1, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-16##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-17##", + "image_id": "##id-11##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-18##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-9##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-9##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-1" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-17##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + }, + { + "index_key": 2, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-19##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-20##", + "image_id": "##id-11##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-21##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-9##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-9##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-2" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-20##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + }, + { + "index_key": 3, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-22##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-23##", + "image_id": "##id-11##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-24##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-9##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-9##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-3" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-23##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + } + ] + } + ], + "check_results": "########" +} \ No newline at end of file diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step1.public_load_balancer_backend_ips_attributes_ok.tf b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step1.public_load_balancer_backend_ips_attributes_ok.tf new file mode 100644 index 000000000..b793cf9d9 --- /dev/null +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step1.public_load_balancer_backend_ips_attributes_ok.tf @@ -0,0 +1,81 @@ +resource "outscale_keypair" "my_keypair" { + keypair_name = "KP-TF01" +} +resource "outscale_public_ip" "public_ip01" { +tags { + key = "name" + value = "EIP-TF01" + } +} + +resource "outscale_security_group" "security_groupTF01" { + description = "Terraform" + security_group_name = "terraform-TF01" +} + +resource "outscale_vm" "vm01" { + image_id = var.image_id + security_group_ids = [outscale_security_group.security_groupTF01.security_group_id] + vm_type = var.vm_type + keypair_name = outscale_keypair.my_keypair.keypair_name +tags { + key = "name" + value = "vm-TF01" + } +} + +resource "outscale_public_ip_link" "public_ip_link01" { + vm_id = outscale_vm.vm01.vm_id + public_ip = outscale_public_ip.public_ip01.public_ip +} + + +resource "outscale_load_balancer" "public_lbu1" { + load_balancer_name = "lbu-TF-01-${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_vms01" { + load_balancer_name = outscale_load_balancer.public_lbu1.load_balancer_name + backend_ips = [outscale_public_ip.public_ip01.public_ip] +depends_on =[outscale_public_ip_link.public_ip_link01] +} + + + +data "outscale_load_balancer" "load_balancer_TF01" { + filter { + name = "load_balancer_names" + values = [outscale_load_balancer.public_lbu1.load_balancer_name] + } +depends_on =[outscale_load_balancer_vms.outscale_load_balancer_vms01] +} + +resource "outscale_vm" "vm02" { ###Create VMs for next steps + count = 4 + image_id = var.image_id + vm_type = var.vm_type + security_group_ids = [outscale_security_group.security_groupTF01.security_group_id] + keypair_name = outscale_keypair.my_keypair.keypair_name +tags { + key = "name" + value = "vm-TF01-${count.index}" + } +} + diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step2.public_load_balancer_update_backend_ips_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step2.public_load_balancer_update_backend_ips_ok.ref new file mode 100644 index 000000000..0bbda438e --- /dev/null +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step2.public_load_balancer_update_backend_ips_ok.ref @@ -0,0 +1,754 @@ +{ + "version": "########", + "terraform_version": "########", + "serial": "########", + "lineage": "########", + "outputs": {}, + "resources": [ + { + "mode": "data", + "type": "outscale_load_balancer", + "name": "load_balancer_TF01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [ + "##id-0##", + "##id-1##" + ], + "dns_name": "########", + "filter": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-2##", + "listeners": [ + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [], + "source_security_group": [ + { + "security_group_account_id": "##id-3##", + "security_group_name": "outscale-elb-sg" + } + ], + "subnets": [], + "subregion_names": [ + "eu-west-2a" + ], + "tags": [ + { + "key": "name", + "value": "public_lbu1" + } + ] + }, + "sensitive_attributes": [] + } + ] + }, + { + "mode": "managed", + "type": "outscale_keypair", + "name": "my_keypair", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-4##", + "keypair_fingerprint": "########", + "keypair_name": "KP-TF01", + "private_key": "########", + "public_key": null, + "request_id": "########", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJyZWFkIjo2MDAwMDAwMDAwMDB9fQ==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer", + "name": "public_lbu1", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [], + "dns_name": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-2##", + "listeners": [ + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [], + "source_security_group": [ + { + "security_group_account_id": "##id-3##", + "security_group_name": "outscale-elb-sg" + } + ], + "subnets": [], + "subregion_names": [ + "eu-west-2a" + ], + "tags": [ + { + "key": "name", + "value": "public_lbu1" + } + ] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer_vms", + "name": "outscale_load_balancer_vms02", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "backend_ips": "########", + "backend_vm_ids": [ + "##id-0##" + ], + "id": "##id-5##", + "load_balancer_name": "########", + "request_id": "########" + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_load_balancer.public_lbu1", + "outscale_security_group.security_groupTF01", + "outscale_vm.vm02" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_public_ip", + "name": "public_ip01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-6##", + "link_public_ip_id": "##id-7##", + "nic_account_id": "##id-8##", + "nic_id": "##id-9##", + "private_ip": "########", + "public_ip": "########", + "public_ip_id": "##id-6##", + "request_id": "########", + "tags": [ + { + "key": "name", + "value": "EIP-TF01" + } + ], + "timeouts": null, + "vm_id": "##id-10##" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDB9fQ==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_public_ip_link", + "name": "public_ip_link01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "allow_relink": null, + "id": "##id-7##", + "link_public_ip_id": "##id-7##", + "nic_account_id": "##id-8##", + "nic_id": "##id-9##", + "private_ip": "########", + "public_ip": "########", + "public_ip_id": "##id-6##", + "request_id": "########", + "tags": [ + { + "key": "name", + "value": "EIP-TF01" + } + ], + "timeouts": null, + "vm_id": "##id-10##" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_public_ip.public_ip01", + "outscale_security_group.security_groupTF01", + "outscale_vm.vm01" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_security_group", + "name": "security_groupTF01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "account_id": "##id-8##", + "description": "Terraform", + "id": "##id-11##", + "inbound_rules": [], + "net_id": "", + "outbound_rules": [], + "remove_default_outbound_rule": false, + "request_id": "########", + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01", + "tag": null, + "tags": [] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_vm", + "name": "vm01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-12##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-10##", + "image_id": "##id-13##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-14##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-11##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-10##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_vm", + "name": "vm02", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-15##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-0##", + "image_id": "##id-13##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-16##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-11##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-0" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-0##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + }, + { + "index_key": 1, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-17##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-1##", + "image_id": "##id-13##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-18##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-11##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-1" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-1##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + }, + { + "index_key": 2, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-19##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-20##", + "image_id": "##id-13##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-21##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-11##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-2" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-20##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + }, + { + "index_key": 3, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-22##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-23##", + "image_id": "##id-13##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-24##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-11##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-3" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-23##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + } + ] + } + ], + "check_results": "########" +} \ No newline at end of file diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step2.public_load_balancer_update_backend_ips_ok.tf b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step2.public_load_balancer_update_backend_ips_ok.tf new file mode 100644 index 000000000..f9a04019e --- /dev/null +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step2.public_load_balancer_update_backend_ips_ok.tf @@ -0,0 +1,82 @@ +resource "outscale_keypair" "my_keypair" { + keypair_name = "KP-TF01" +} +resource "outscale_public_ip" "public_ip01" { +tags { + key = "name" + value = "EIP-TF01" + } +} + +resource "outscale_security_group" "security_groupTF01" { + description = "Terraform" + security_group_name = "terraform-TF01" +} + +resource "outscale_vm" "vm01" { + image_id = var.image_id + security_group_ids = [outscale_security_group.security_groupTF01.security_group_id] + vm_type = var.vm_type + keypair_name = outscale_keypair.my_keypair.keypair_name +tags { + key = "name" + value = "vm-TF01" + } +} + +resource "outscale_public_ip_link" "public_ip_link01" { + vm_id = outscale_vm.vm01.vm_id + public_ip = outscale_public_ip.public_ip01.public_ip +} + + +resource "outscale_load_balancer" "public_lbu1" { + load_balancer_name = "lbu-TF-01-${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_vm" "vm02" { ###Create VMs for next steps + count = 4 + image_id = var.image_id + vm_type = var.vm_type + security_group_ids = [outscale_security_group.security_groupTF01.security_group_id] + keypair_name = outscale_keypair.my_keypair.keypair_name +tags { + key = "name" + value = "vm-TF01-${count.index}" + } +} + +resource "outscale_load_balancer_vms" "outscale_load_balancer_vms02" { + load_balancer_name = outscale_load_balancer.public_lbu1.load_balancer_name + backend_vm_ids = [outscale_vm.vm02[0].vm_id] + backend_ips = [outscale_vm.vm02[1].public_ip] +} + + + +data "outscale_load_balancer" "load_balancer_TF01" { + filter { + name = "load_balancer_names" + values = [outscale_load_balancer.public_lbu1.load_balancer_name] + } +depends_on =[outscale_load_balancer_vms.outscale_load_balancer_vms02] +} + diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step3.public_load_balancer_update_backend_ips_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step3.public_load_balancer_update_backend_ips_ok.ref new file mode 100644 index 000000000..db88d037c --- /dev/null +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step3.public_load_balancer_update_backend_ips_ok.ref @@ -0,0 +1,756 @@ +{ + "version": "########", + "terraform_version": "########", + "serial": "########", + "lineage": "########", + "outputs": {}, + "resources": [ + { + "mode": "data", + "type": "outscale_load_balancer", + "name": "load_balancer_TF01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [ + "##id-0##", + "##id-1##", + "##id-2##" + ], + "dns_name": "########", + "filter": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-3##", + "listeners": [ + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [], + "source_security_group": [ + { + "security_group_account_id": "##id-4##", + "security_group_name": "outscale-elb-sg" + } + ], + "subnets": [], + "subregion_names": [ + "eu-west-2a" + ], + "tags": [ + { + "key": "name", + "value": "public_lbu1" + } + ] + }, + "sensitive_attributes": [] + } + ] + }, + { + "mode": "managed", + "type": "outscale_keypair", + "name": "my_keypair", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-5##", + "keypair_fingerprint": "########", + "keypair_name": "KP-TF01", + "private_key": "########", + "public_key": null, + "request_id": "########", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwLCJyZWFkIjo2MDAwMDAwMDAwMDB9fQ==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer", + "name": "public_lbu1", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [], + "dns_name": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-3##", + "listeners": [ + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [], + "source_security_group": [ + { + "security_group_account_id": "##id-4##", + "security_group_name": "outscale-elb-sg" + } + ], + "subnets": [], + "subregion_names": [ + "eu-west-2a" + ], + "tags": [ + { + "key": "name", + "value": "public_lbu1" + } + ] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer_vms", + "name": "outscale_load_balancer_vms02", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "backend_ips": "########", + "backend_vm_ids": [ + "##id-0##" + ], + "id": "##id-6##", + "load_balancer_name": "########", + "request_id": "########" + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_load_balancer.public_lbu1", + "outscale_security_group.security_groupTF01", + "outscale_vm.vm01", + "outscale_vm.vm02" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_public_ip", + "name": "public_ip01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-7##", + "link_public_ip_id": "##id-8##", + "nic_account_id": "##id-9##", + "nic_id": "##id-10##", + "private_ip": "########", + "public_ip": "########", + "public_ip_id": "##id-7##", + "request_id": "########", + "tags": [ + { + "key": "name", + "value": "EIP-TF01" + } + ], + "timeouts": null, + "vm_id": "##id-0##" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDB9fQ==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_public_ip_link", + "name": "public_ip_link01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "allow_relink": null, + "id": "##id-8##", + "link_public_ip_id": "##id-8##", + "nic_account_id": "##id-9##", + "nic_id": "##id-10##", + "private_ip": "########", + "public_ip": "########", + "public_ip_id": "##id-7##", + "request_id": "########", + "tags": [ + { + "key": "name", + "value": "EIP-TF01" + } + ], + "timeouts": null, + "vm_id": "##id-0##" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_public_ip.public_ip01", + "outscale_security_group.security_groupTF01", + "outscale_vm.vm01" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_security_group", + "name": "security_groupTF01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "account_id": "##id-9##", + "description": "Terraform", + "id": "##id-11##", + "inbound_rules": [], + "net_id": "", + "outbound_rules": [], + "remove_default_outbound_rule": false, + "request_id": "########", + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01", + "tag": null, + "tags": [] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_vm", + "name": "vm01", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-12##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-0##", + "image_id": "##id-13##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-14##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-11##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-0##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_vm", + "name": "vm02", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "index_key": 0, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-15##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-16##", + "image_id": "##id-13##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-17##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-11##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-0" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-16##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + }, + { + "index_key": 1, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-18##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-19##", + "image_id": "##id-13##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-20##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-11##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-1" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-19##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + }, + { + "index_key": 2, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-21##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-1##", + "image_id": "##id-13##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-22##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-11##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-2" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-1##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + }, + { + "index_key": 3, + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-23##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-2##", + "image_id": "##id-13##", + "is_source_dest_checked": false, + "keypair_name": "KP-TF01", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "", + "nics": [], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "eu-west-2a", + "placement_tenancy": "default", + "primary_nic": [], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-24##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-11##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-11##", + "security_group_name": "terraform-TF01" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "", + "tags": [ + { + "key": "name", + "value": "vm-TF01-3" + } + ], + "timeouts": null, + "user_data": "", + "vm_id": "##id-2##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_keypair.my_keypair", + "outscale_security_group.security_groupTF01" + ] + } + ] + } + ], + "check_results": "########" +} \ No newline at end of file diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step3.public_load_balancer_update_backend_ips_ok.tf b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step3.public_load_balancer_update_backend_ips_ok.tf new file mode 100644 index 000000000..742de153d --- /dev/null +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-01_public_load_balancer_backend_ips_attributes_ok/step3.public_load_balancer_update_backend_ips_ok.tf @@ -0,0 +1,82 @@ +resource "outscale_keypair" "my_keypair" { + keypair_name = "KP-TF01" +} +resource "outscale_public_ip" "public_ip01" { +tags { + key = "name" + value = "EIP-TF01" + } +} + +resource "outscale_security_group" "security_groupTF01" { + description = "Terraform" + security_group_name = "terraform-TF01" +} + +resource "outscale_vm" "vm01" { + image_id = var.image_id + security_group_ids = [outscale_security_group.security_groupTF01.security_group_id] + vm_type = var.vm_type + keypair_name = outscale_keypair.my_keypair.keypair_name +tags { + key = "name" + value = "vm-TF01" + } +} + +resource "outscale_public_ip_link" "public_ip_link01" { + vm_id = outscale_vm.vm01.vm_id + public_ip = outscale_public_ip.public_ip01.public_ip +} + + +resource "outscale_load_balancer" "public_lbu1" { + load_balancer_name = "lbu-TF-01-${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_vm" "vm02" { ###Create VMs for next steps + count = 4 + image_id = var.image_id + vm_type = var.vm_type + security_group_ids = [outscale_security_group.security_groupTF01.security_group_id] + keypair_name = outscale_keypair.my_keypair.keypair_name +tags { + key = "name" + value = "vm-TF01-${count.index}" + } +} + +resource "outscale_load_balancer_vms" "outscale_load_balancer_vms02" { + load_balancer_name = outscale_load_balancer.public_lbu1.load_balancer_name + backend_vm_ids = [outscale_vm.vm01.vm_id] + backend_ips = [outscale_vm.vm02[2].public_ip,outscale_vm.vm02[3].public_ip] +} + + + +data "outscale_load_balancer" "load_balancer_TF01" { + filter { + name = "load_balancer_names" + values = [outscale_load_balancer.public_lbu1.load_balancer_name] + } +depends_on =[outscale_load_balancer_vms.outscale_load_balancer_vms02] +} + diff --git a/tests/qa_provider_oapi/data/nets/TF-02_internet_facing_lbu_update_backend_vms_ok/step1.private_internet_facing_load_balancer_add_backend_vm_attributes_ok.ref b/tests/qa_provider_oapi/data/nets/TF-02_internet_facing_lbu_update_backend_vms_ok/step1.private_internet_facing_load_balancer_add_backend_vm_attributes_ok.ref new file mode 100644 index 000000000..50ade5b13 --- /dev/null +++ b/tests/qa_provider_oapi/data/nets/TF-02_internet_facing_lbu_update_backend_vms_ok/step1.private_internet_facing_load_balancer_add_backend_vm_attributes_ok.ref @@ -0,0 +1,718 @@ +{ + "version": "########", + "terraform_version": "########", + "serial": "########", + "lineage": "########", + "outputs": {}, + "resources": [ + { + "mode": "data", + "type": "outscale_load_balancer", + "name": "load_balancer_TF02", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [ + "##id-0##" + ], + "dns_name": "########", + "filter": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-1##", + "listeners": [ + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "##id-2##", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [ + "##id-3##" + ], + "source_security_group": [ + { + "security_group_account_id": "##id-4##", + "security_group_name": "TF02-lbu-1" + } + ], + "subnets": [ + "##id-5##" + ], + "subregion_names": [ + "us-east-2a" + ], + "tags": [ + { + "key": "name", + "value": "lbu-internet-facing-TF02" + } + ] + }, + "sensitive_attributes": [] + } + ] + }, + { + "mode": "managed", + "type": "outscale_internet_service", + "name": "outscale_internet_service", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-6##", + "internet_service_id": "##id-6##", + "net_id": "", + "request_id": "########", + "state": "", + "tags": [] + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_internet_service_link", + "name": "outscale_internet_service_link", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-6##", + "internet_service_id": "##id-6##", + "net_id": "##id-2##", + "request_id": "########", + "state": "available", + "tags": [] + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_internet_service.outscale_internet_service", + "outscale_net.outscale_net" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer", + "name": "internet_facing_lbu_1", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], + "application_sticky_cookie_policies": [], + "backend_vm_ids": [], + "dns_name": "########", + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], + "id": "##id-1##", + "listeners": [ + { + "backend_port": 8080, + "backend_protocol": "HTTP", + "load_balancer_port": 8080, + "load_balancer_protocol": "HTTP", + "policy_names": [], + "server_certificate_id": "" + }, + { + "backend_port": 80, + "backend_protocol": "TCP", + "load_balancer_port": 80, + "load_balancer_protocol": "TCP", + "policy_names": [], + "server_certificate_id": "" + } + ], + "load_balancer_name": "########", + "load_balancer_sticky_cookie_policies": [], + "load_balancer_type": "internet-facing", + "net_id": "##id-2##", + "public_ip": "########", + "request_id": "########", + "secured_cookies": false, + "security_groups": [ + "##id-3##" + ], + "source_security_group": [ + { + "security_group_account_id": "##id-4##", + "security_group_name": "TF02-lbu-1" + } + ], + "subnets": [ + "##id-5##" + ], + "subregion_names": [ + "us-east-2a" + ], + "tags": [ + { + "key": "name", + "value": "lbu-internet-facing-TF02" + } + ] + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_internet_service.outscale_internet_service", + "outscale_net.outscale_net", + "outscale_route.outscale_route", + "outscale_route_table.outscale_route_table", + "outscale_route_table_link.outscale_route_table_link", + "outscale_security_group.outscale_security_group", + "outscale_subnet.subnet-1" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_load_balancer_vms", + "name": "outscale_load_balancer_vms02", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "backend_ips": "########", + "backend_vm_ids": null, + "id": "##id-7##", + "load_balancer_name": "########", + "request_id": "########" + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_internet_service.outscale_internet_service", + "outscale_load_balancer.internet_facing_lbu_1", + "outscale_net.outscale_net", + "outscale_public_ip.public_ip02", + "outscale_public_ip_link.public_ip_link02", + "outscale_route.outscale_route", + "outscale_route_table.outscale_route_table", + "outscale_route_table_link.outscale_route_table_link", + "outscale_security_group.outscale_security_group", + "outscale_subnet.subnet-1", + "outscale_vm.vm03" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_net", + "name": "outscale_net", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "dhcp_options_set_id": "##id-8##", + "id": "##id-2##", + "ip_range": "10.0.0.0/16", + "net_id": "##id-2##", + "request_id": "########", + "state": "available", + "tags": [ + { + "key": "name", + "value": "TF02-NET" + } + ], + "tenancy": "default" + }, + "sensitive_attributes": [], + "private": "bnVsbA==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_public_ip", + "name": "public_ip02", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-9##", + "link_public_ip_id": "", + "nic_account_id": "", + "nic_id": "", + "private_ip": "########", + "public_ip": "########", + "public_ip_id": "##id-9##", + "request_id": "########", + "tags": [ + { + "key": "name", + "value": "EIP-TF02" + } + ], + "timeouts": null, + "vm_id": "" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDB9fQ==" + } + ] + }, + { + "mode": "managed", + "type": "outscale_public_ip_link", + "name": "public_ip_link02", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "allow_relink": null, + "id": "##id-10##", + "link_public_ip_id": "##id-10##", + "nic_account_id": "##id-4##", + "nic_id": "##id-11##", + "private_ip": "########", + "public_ip": "########", + "public_ip_id": "##id-9##", + "request_id": "########", + "tags": [ + { + "key": "name", + "value": "EIP-TF02" + } + ], + "timeouts": null, + "vm_id": "##id-0##" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_net.outscale_net", + "outscale_public_ip.public_ip02", + "outscale_security_group.outscale_security_group", + "outscale_subnet.subnet-1", + "outscale_vm.vm03" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_route", + "name": "outscale_route", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "await_active_state": true, + "creation_method": "CreateRoute", + "destination_ip_range": "0.0.0.0/0", + "destination_service_id": "", + "gateway_id": "##id-6##", + "id": "##id-12##", + "nat_access_point": "", + "nat_service_id": "", + "net_peering_id": "", + "nic_id": "", + "request_id": "########", + "route_table_id": "##id-13##", + "state": "active", + "vm_account_id": "", + "vm_id": "" + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_internet_service.outscale_internet_service", + "outscale_net.outscale_net", + "outscale_route_table.outscale_route_table" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_route_table", + "name": "outscale_route_table", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-13##", + "link_route_tables": [], + "net_id": "##id-2##", + "request_id": "########", + "route_propagating_virtual_gateways": [], + "route_table_id": "##id-13##", + "routes": [ + { + "creation_method": "CreateRouteTable", + "destination_ip_range": "10.0.0.0/16", + "destination_service_id": "", + "gateway_id": "##id-14##", + "nat_service_id": "", + "net_access_point_id": "", + "net_peering_id": "", + "nic_id": "", + "state": "active", + "vm_account_id": "", + "vm_id": "" + } + ], + "tags": [ + { + "key": "name", + "value": "terraform-RT-lbu" + } + ] + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_net.outscale_net" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_route_table_link", + "name": "outscale_route_table_link", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "id": "##id-15##", + "link_route_table_id": "##id-15##", + "main": false, + "request_id": "########", + "route_table_id": "##id-13##", + "subnet_id": "##id-5##" + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_net.outscale_net", + "outscale_route_table.outscale_route_table", + "outscale_subnet.subnet-1" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_security_group", + "name": "outscale_security_group", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "account_id": "##id-4##", + "description": "test lbu-2", + "id": "##id-3##", + "inbound_rules": [], + "net_id": "##id-2##", + "outbound_rules": [ + { + "from_port_range": -1, + "ip_protocol": "-1", + "ip_ranges": "########", + "security_groups_members": [], + "to_port_range": -1 + } + ], + "remove_default_outbound_rule": false, + "request_id": "########", + "security_group_id": "##id-3##", + "security_group_name": "TF02-lbu-1", + "tag": null, + "tags": [ + { + "key": "Name", + "value": "outscale_terraform_lbu_sg" + } + ] + }, + "sensitive_attributes": [], + "private": "bnVsbA==", + "dependencies": [ + "outscale_net.outscale_net" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_subnet", + "name": "subnet-1", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "available_ips_count": "########", + "id": "##id-5##", + "ip_range": "10.0.0.0/24", + "map_public_ip_on_launch": false, + "net_id": "##id-2##", + "request_id": "########", + "state": "available", + "subnet_id": "##id-5##", + "subregion_name": "us-east-2a", + "tags": [ + { + "key": "Name", + "value": "outscale_terraform_lbu_subnet" + } + ], + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6NjAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_net.outscale_net" + ] + } + ] + }, + { + "mode": "managed", + "type": "outscale_vm", + "name": "vm03", + "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "admin_password": "", + "architecture": "x86_64", + "block_device_mappings": [], + "block_device_mappings_created": [ + { + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "tags": [], + "volume_id": "##id-16##" + } + ], + "device_name": "/dev/sda1" + } + ], + "bsu_optimized": false, + "client_token": "", + "creation_date": "########", + "deletion_protection": false, + "get_admin_password": null, + "hypervisor": "xen", + "id": "##id-0##", + "image_id": "##id-17##", + "is_source_dest_checked": true, + "keypair_name": "", + "launch_number": 0, + "nested_virtualization": false, + "net_id": "##id-2##", + "nics": [ + { + "account_id": "##id-4##", + "delete_on_vm_deletion": true, + "description": "Primary network interface", + "device_number": 0, + "is_source_dest_checked": true, + "link_nic": [ + { + "delete_on_vm_deletion": true, + "device_number": "0", + "link_nic_id": "##id-18##", + "state": "attached" + } + ], + "link_public_ip": [], + "mac_address": "########", + "net_id": "##id-2##", + "nic_id": "##id-11##", + "private_dns_name": "########", + "private_ips": [ + { + "is_primary": true, + "link_public_ip": [], + "private_dns_name": "########", + "private_ip": "########" + } + ], + "secondary_private_ip_count": 0, + "security_group_ids": [ + "##id-3##" + ], + "security_groups": [ + { + "security_group_id": "##id-3##", + "security_group_name": "TF02-lbu-1" + } + ], + "state": "in-use", + "subnet_id": "##id-5##" + } + ], + "os_family": "", + "performance": "medium", + "placement_subregion_name": "us-east-2a", + "placement_tenancy": "default", + "primary_nic": [ + { + "account_id": "##id-4##", + "delete_on_vm_deletion": true, + "description": "Primary network interface", + "device_number": 0, + "is_source_dest_checked": true, + "link_nic": [ + { + "delete_on_vm_deletion": true, + "device_number": "0", + "link_nic_id": "##id-18##", + "state": "attached" + } + ], + "link_public_ip": [], + "mac_address": "########", + "net_id": "##id-2##", + "nic_id": "##id-11##", + "private_dns_name": "########", + "private_ips": [ + { + "is_primary": true, + "link_public_ip": [], + "private_dns_name": "########", + "private_ip": "########" + } + ], + "secondary_private_ip_count": 0, + "security_group_ids": [ + "##id-3##" + ], + "security_groups": [ + { + "security_group_id": "##id-3##", + "security_group_name": "TF02-lbu-1" + } + ], + "state": "in-use", + "subnet_id": "##id-5##" + } + ], + "private_dns_name": "########", + "private_ip": "########", + "private_ips": null, + "product_codes": [ + "0001" + ], + "public_dns_name": "########", + "public_ip": "########", + "request_id": "########", + "reservation_id": "##id-19##", + "root_device_name": "/dev/sda1", + "root_device_type": "ebs", + "security_group_ids": [ + "##id-3##" + ], + "security_group_names": null, + "security_groups": [ + { + "security_group_id": "##id-3##", + "security_group_name": "TF02-lbu-1" + } + ], + "state": "running", + "state_reason": "", + "subnet_id": "##id-5##", + "tags": [], + "timeouts": null, + "user_data": "", + "vm_id": "##id-0##", + "vm_initiated_shutdown_behavior": "stop", + "vm_type": "###vm_type###" + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjo2MDAwMDAwMDAwMDAsImRlbGV0ZSI6MzAwMDAwMDAwMDAwLCJyZWFkIjozMDAwMDAwMDAwMDAsInVwZGF0ZSI6MzAwMDAwMDAwMDAwfX0=", + "dependencies": [ + "outscale_net.outscale_net", + "outscale_security_group.outscale_security_group", + "outscale_subnet.subnet-1" + ] + } + ] + } + ], + "check_results": "########" +} \ No newline at end of file diff --git a/tests/qa_provider_oapi/data/nets/TF-02_internet_facing_lbu_update_backend_vms_ok/step1.private_internet_facing_load_balancer_add_backend_vm_attributes_ok.tf b/tests/qa_provider_oapi/data/nets/TF-02_internet_facing_lbu_update_backend_vms_ok/step1.private_internet_facing_load_balancer_add_backend_vm_attributes_ok.tf new file mode 100644 index 000000000..0a1371ab3 --- /dev/null +++ b/tests/qa_provider_oapi/data/nets/TF-02_internet_facing_lbu_update_backend_vms_ok/step1.private_internet_facing_load_balancer_add_backend_vm_attributes_ok.tf @@ -0,0 +1,113 @@ +######Step1:Create the needed resources### +resource "outscale_net" "outscale_net" { + ip_range = "10.0.0.0/16" + tenancy = "default" + tags { + key = "name" + value = "TF02-NET" + } +} + +resource "outscale_route_table" "outscale_route_table" { + net_id = outscale_net.outscale_net.net_id + tags { + key = "name" + value = "terraform-RT-lbu" + } +} +resource "outscale_security_group" "outscale_security_group" { + description = "test lbu-2" + security_group_name = "TF02-lbu-1" + net_id = outscale_net.outscale_net.net_id + tags { + key = "Name" + value = "outscale_terraform_lbu_sg" + } +} + +resource "outscale_subnet" "subnet-1" { + net_id = outscale_net.outscale_net.net_id + ip_range = "10.0.0.0/24" + tags { + key = "Name" + value = "outscale_terraform_lbu_subnet" + } +} + + +resource "outscale_internet_service" "outscale_internet_service" { +} + +resource "outscale_internet_service_link" "outscale_internet_service_link" { + internet_service_id = outscale_internet_service.outscale_internet_service.internet_service_id + net_id = outscale_net.outscale_net.net_id +} + +resource "outscale_route" "outscale_route" { + gateway_id = outscale_internet_service.outscale_internet_service.id + destination_ip_range = "0.0.0.0/0" + route_table_id = outscale_route_table.outscale_route_table.route_table_id +} + +resource "outscale_route_table_link" "outscale_route_table_link" { + route_table_id = outscale_route_table.outscale_route_table.route_table_id + subnet_id = outscale_subnet.subnet-1.subnet_id +} + + +resource "outscale_load_balancer" "internet_facing_lbu_1" { + load_balancer_name ="lbu-TF-02-${var.suffixe_lbu_name}" + 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 + } + subnets = [outscale_subnet.subnet-1.subnet_id] + security_groups = [outscale_security_group.outscale_security_group.id] + load_balancer_type = "internet-facing" + tags { + key = "name" + value = "lbu-internet-facing-TF02" + } + depends_on = [outscale_route.outscale_route,outscale_route_table_link.outscale_route_table_link] +} + +resource "outscale_vm" "vm03" { + image_id = var.image_id + vm_type = var.vm_type + security_group_ids = [outscale_security_group.outscale_security_group.id] + subnet_id = outscale_subnet.subnet-1.subnet_id +} + +resource "outscale_public_ip" "public_ip02" { +tags { + key = "name" + value = "EIP-TF02" + } +} + +resource "outscale_public_ip_link" "public_ip_link02" { + vm_id = outscale_vm.vm03.vm_id + public_ip = outscale_public_ip.public_ip02.public_ip +} + +resource "outscale_load_balancer_vms" "outscale_load_balancer_vms02" { + load_balancer_name = outscale_load_balancer.internet_facing_lbu_1.load_balancer_name + backend_ips = [outscale_public_ip.public_ip02.public_ip] +depends_on = [outscale_public_ip_link.public_ip_link02] +} + +data "outscale_load_balancer" "load_balancer_TF02" { + filter { + name = "load_balancer_names" + values = [outscale_load_balancer.internet_facing_lbu_1.load_balancer_name] + } +depends_on=[outscale_load_balancer_vms.outscale_load_balancer_vms02] +}