From fa6acfe01d910086c5e110dd0a6eb2809eb68037 Mon Sep 17 00:00:00 2001 From: Thiery Ouattara Date: Tue, 19 Dec 2023 17:20:37 +0000 Subject: [PATCH] fix tests --- .github/workflows/others_testacc.yml | 1 + ...ta_source_outscale_api_access_rule_test.go | 11 +- outscale/data_source_outscale_ca_test.go | 11 +- outscale/data_source_outscale_cas_test.go | 13 +- ...source_outscale_load_balancer_tags_test.go | 5 +- ...ata_source_outscale_load_balancers_test.go | 6 +- outscale/data_source_outscale_nics.go | 2 +- ...ata_source_outscale_vpn_connection_test.go | 22 +- outscale/instance_set_set.go | 11 +- .../resource_outscale_api_access_rule_test.go | 11 +- outscale/resource_outscale_ca_test.go | 20 +- ...esource_outscale_flexible_gpu_link_test.go | 4 +- ..._outscale_load_balancer_attributes_test.go | 4 +- .../resource_outscale_load_balancer_test.go | 8 +- ...esource_outscale_load_balancer_vms_test.go | 24 +- outscale/resource_outscale_vm_test.go | 48 +- scripts/generate-certificate.sh | 4 +- ....flexible_gpu_datasource_attributes_ok.ref | 28 +- ...1.flexible_gpu_datasource_attributes_ok.tf | 2 +- ...cer_vm_health_datasource_attributes_ok.ref | 70 +-- ...ad_balancer_vms_resource_attributes_ok.ref | 72 +-- ...oad_balancer_vms_resource_remove_vm_ok.ref | 72 +-- ....net_peerings_datasource_attributes_ok.ref | 189 ++++--- ...1.net_peerings_datasource_attributes_ok.tf | 33 +- .../step1.nic_link_resource_attributes_ok.ref | 43 +- .../step1.nic_link_resource_attributes_ok.tf | 4 +- .../step1.nics_datasource_attributes_ok.ref | 481 +++++------------- .../step1.nics_datasource_attributes_ok.tf | 2 - .../step1.vm_resource_centos_ok.ref | 42 +- .../step1.test_destroy_igw.ref | 2 +- ...m_resource_public_with_multiple_BDM_ok.ref | 42 +- ...m_resource_public_with_multiple_BDM_ok.ref | 46 +- .../step1.vm_resource_with_user_data_ok_2.ref | 14 +- ...3.vm_resource_update_security_group_ok.ref | 14 +- ...p3.vm_resource_update_security_group_ok.tf | 2 +- ...resource_update_deletion_protection_ok.ref | 12 +- .../step5.vm_resource_update_bdm_ok.ref | 14 +- .../step5.vm_resource_update_bdm_ok.tf | 2 +- ...tep6.vm_resource_update_performance_ok.ref | 14 +- ...step6.vm_resource_update_performance_ok.tf | 2 +- .../step7.vm_resource_update_vm_type_ok.ref | 12 +- .../step8.vm_resource_update_user_data_ok.ref | 14 +- .../step8.vm_resource_update_user_data_ok.tf | 2 +- ...m_resource_update_shtdown_behaviour_ok.ref | 36 +- ...tep1.volumes_datasource_attributes_ok4.ref | 58 +-- ...tep2.volumes_datasource_attributes_ok4.ref | 58 +-- ...p1.volumes_link_resource_attributes_ok.ref | 14 +- 47 files changed, 723 insertions(+), 878 deletions(-) diff --git a/.github/workflows/others_testacc.yml b/.github/workflows/others_testacc.yml index 9af48025e..c386ef20b 100644 --- a/.github/workflows/others_testacc.yml +++ b/.github/workflows/others_testacc.yml @@ -50,3 +50,4 @@ jobs: OUTSCALE_REGION: ${{ secrets.OSC_REGION }} OUTSCALE_ACCOUNT: ${{ secrets.OSC_ACCOUNT_ID }} OUTSCALE_IMAGEID: ${{ secrets.OUTSCALE_IMAGEID }} + CA_PATH: ${{ secrets.CA_PATH }} diff --git a/outscale/data_source_outscale_api_access_rule_test.go b/outscale/data_source_outscale_api_access_rule_test.go index 3e422d6a7..51b68e549 100644 --- a/outscale/data_source_outscale_api_access_rule_test.go +++ b/outscale/data_source_outscale_api_access_rule_test.go @@ -3,6 +3,7 @@ package outscale import ( "context" "fmt" + "os" "testing" "time" @@ -15,6 +16,7 @@ import ( func TestAccOthers_DataOutscaleOAPIApiAccessRule_basic(t *testing.T) { t.Parallel() resourceName := "outscale_api_access_rule.rule_data" + ca_path := os.Getenv("CA_PATH") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -22,7 +24,7 @@ func TestAccOthers_DataOutscaleOAPIApiAccessRule_basic(t *testing.T) { CheckDestroy: testAccDataCheckOutscaleApiAccessRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccDataOutscaleOAPIApiAccessRuleConfig(), + Config: testAccDataOutscaleOAPIApiAccessRuleConfig(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleApiAccessRuleExists(resourceName), ), @@ -69,10 +71,10 @@ func testAccDataCheckOutscaleApiAccessRuleDestroy(s *terraform.State) error { return nil } -func testAccDataOutscaleOAPIApiAccessRuleConfig() string { +func testAccDataOutscaleOAPIApiAccessRuleConfig(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_rule" { - ca_pem = file("./test-cert.pem") + ca_pem = file(%q) description = "Ca data test create" } @@ -97,6 +99,5 @@ data "outscale_api_access_rule" "api_access_rule" { name = "descriptions" values = ["test api access rule"] } -} - `) +}`, path) } diff --git a/outscale/data_source_outscale_ca_test.go b/outscale/data_source_outscale_ca_test.go index 66b2355d0..4e59813a4 100644 --- a/outscale/data_source_outscale_ca_test.go +++ b/outscale/data_source_outscale_ca_test.go @@ -3,6 +3,7 @@ package outscale import ( "context" "fmt" + "os" "testing" "time" @@ -14,6 +15,7 @@ import ( func TestAccOthers_DataOutscaleCa_basic(t *testing.T) { resourceName := "outscale_ca.ca_test" + ca_path := os.Getenv("CA_PATH") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -21,7 +23,7 @@ func TestAccOthers_DataOutscaleCa_basic(t *testing.T) { CheckDestroy: testAccDataCheckOutscaleCaDestroy, Steps: []resource.TestStep{ { - Config: testAccDataOutscaleOAPICaConfig(), + Config: testAccDataOutscaleOAPICaConfig(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleCaExists(resourceName), ), @@ -70,10 +72,10 @@ func testAccDataCheckOutscaleCaDestroy(s *terraform.State) error { return nil } -func testAccDataOutscaleOAPICaConfig() string { +func testAccDataOutscaleOAPICaConfig(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_test" { - ca_pem = file("./test-cert.pem") + ca_pem = file(%q) description = "Ca testacc create" } @@ -82,6 +84,5 @@ data "outscale_ca" "ca_data" { name = "ca_ids" values = [outscale_ca.ca_test.id] } -} -`) +}`, path) } diff --git a/outscale/data_source_outscale_cas_test.go b/outscale/data_source_outscale_cas_test.go index 6f829a09a..ace8b0495 100644 --- a/outscale/data_source_outscale_cas_test.go +++ b/outscale/data_source_outscale_cas_test.go @@ -3,6 +3,7 @@ package outscale import ( "context" "fmt" + "os" "testing" "time" @@ -14,6 +15,7 @@ import ( func TestAccOthers_DataOutscaleCas_basic(t *testing.T) { resName := "outscale_ca.ca_test" + ca_path := os.Getenv("CA_PATH") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -21,7 +23,7 @@ func TestAccOthers_DataOutscaleCas_basic(t *testing.T) { CheckDestroy: testAccDataCheckOutscaleCasDestroy, Steps: []resource.TestStep{ { - Config: testAccDataOutscaleOAPICasConfig(), + Config: testAccDataOutscaleOAPICasConfig(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleCaExists(resName), ), @@ -70,15 +72,15 @@ func testAccDataCheckOutscaleCasDestroy(s *terraform.State) error { return nil } -func testAccDataOutscaleOAPICasConfig() string { +func testAccDataOutscaleOAPICasConfig(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_test" { - ca_pem = file("./test-cert.pem") + ca_pem = file(%[1]q) description = "Ca testacc create" } resource "outscale_ca" "ca_test2" { - ca_pem = file("./test-cert.pem") + ca_pem = file(%[1]q) description = "Ca testacc create2" } @@ -91,6 +93,5 @@ data "outscale_cas" "cas_data" { name = "description" values = ["Ca testacc create2"] } -} -`) +}`, path) } diff --git a/outscale/data_source_outscale_load_balancer_tags_test.go b/outscale/data_source_outscale_load_balancer_tags_test.go index 5410b1bdc..9ce181a8b 100644 --- a/outscale/data_source_outscale_load_balancer_tags_test.go +++ b/outscale/data_source_outscale_load_balancer_tags_test.go @@ -48,7 +48,7 @@ func testAccCheckODSutscaleOAPILBUDSTagsExists(n string) resource.TestCheckFunc func getTestAccDSODSutscaleOAPILBUDSTagsConfig(r string, zone string) string { return fmt.Sprintf(` - resource "outscale_load_balancer" "bar" { + resource "outscale_load_balancer" "barTags" { subregion_names = ["%sa"] load_balancer_name = "foobar-terraform-elb-%s" @@ -65,9 +65,8 @@ func getTestAccDSODSutscaleOAPILBUDSTagsConfig(r string, zone string) string { } } - data "outscale_load_balancer_tags" "testds" { - load_balancer_names = ["${outscale_load_balancer.bar.id}"] + load_balancer_names = [outscale_load_balancer.barTags.id] } `, zone, r) } diff --git a/outscale/data_source_outscale_load_balancers_test.go b/outscale/data_source_outscale_load_balancers_test.go index b3c6bda0d..775d9ca57 100644 --- a/outscale/data_source_outscale_load_balancers_test.go +++ b/outscale/data_source_outscale_load_balancers_test.go @@ -17,7 +17,7 @@ func TestAccOthers_LBUs_basic(t *testing.T) { PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "outscale_load_balancer.bar", + IDRefreshName: "outscale_load_balancer.bars", Providers: testAccProviders, CheckDestroy: testAccCheckOutscaleOAPILBUDestroy, Steps: []resource.TestStep{ @@ -32,7 +32,7 @@ func TestAccOthers_LBUs_basic(t *testing.T) { func testAccDSOutscaleOAPILBsUConfig(region string, numLbu int) string { return fmt.Sprintf(` - resource "outscale_load_balancer" "bar" { + resource "outscale_load_balancer" "bars" { subregion_names = ["%s"] load_balancer_name = "foobar-terraform-elb%d" @@ -52,7 +52,7 @@ func testAccDSOutscaleOAPILBsUConfig(region string, numLbu int) string { } data "outscale_load_balancers" "test" { - load_balancer_name = [outscale_load_balancer.bar.id] + load_balancer_name = [outscale_load_balancer.bars.id] } `, region, numLbu) } diff --git a/outscale/data_source_outscale_nics.go b/outscale/data_source_outscale_nics.go index 36fcef8d7..12080ab8b 100644 --- a/outscale/data_source_outscale_nics.go +++ b/outscale/data_source_outscale_nics.go @@ -54,7 +54,7 @@ func getDSOAPINicsSchema() map[string]*schema.Schema { Type: schema.TypeInt, Computed: true, }, - "nic_link_id": { + "link_nic_id": { Type: schema.TypeString, Computed: true, }, diff --git a/outscale/data_source_outscale_vpn_connection_test.go b/outscale/data_source_outscale_vpn_connection_test.go index 3673aecb1..7be9d0fd7 100644 --- a/outscale/data_source_outscale_vpn_connection_test.go +++ b/outscale/data_source_outscale_vpn_connection_test.go @@ -40,30 +40,30 @@ func TestAccOthers_VPNConnectionDataSource_withFilters(t *testing.T) { func testAccOutscaleVPNConnectionDataSourceConfigBasic(publicIP string) string { return fmt.Sprintf(` - resource "outscale_virtual_gateway" "virtual_gateway" { + resource "outscale_virtual_gateway" "virtual_gateway1" { connection_type = "ipsec.1" } - resource "outscale_client_gateway" "customer_gateway" { + resource "outscale_client_gateway" "customer_gateway1" { bgp_asn = 3 public_ip = "%s" connection_type = "ipsec.1" } - resource "outscale_vpn_connection" "foo" { - client_gateway_id = "${outscale_client_gateway.customer_gateway.id}" - virtual_gateway_id = "${outscale_virtual_gateway.virtual_gateway.id}" + resource "outscale_vpn_connection" "foo1" { + client_gateway_id = outscale_client_gateway.customer_gateway1.id + virtual_gateway_id = outscale_virtual_gateway.virtual_gateway1.id connection_type = "ipsec.1" static_routes_only = true tags { - key = "Name" - value = "test-VPN" + key = "Name" + value = "test-VPN" } } data "outscale_vpn_connection" "test" { - vpn_connection_id = "${outscale_vpn_connection.foo.id}" + vpn_connection_id = outscale_vpn_connection.foo1.id } `, publicIP) } @@ -81,8 +81,8 @@ func testAccOutscaleVPNConnectionDataSourceConfigWithFilters(publicIP string) st } resource "outscale_vpn_connection" "foo" { - client_gateway_id = "${outscale_client_gateway.customer_gateway.id}" - virtual_gateway_id = "${outscale_virtual_gateway.virtual_gateway.id}" + client_gateway_id = outscale_client_gateway.customer_gateway.id + virtual_gateway_id = outscale_virtual_gateway.virtual_gateway.id connection_type = "ipsec.1" static_routes_only = true } @@ -90,7 +90,7 @@ func testAccOutscaleVPNConnectionDataSourceConfigWithFilters(publicIP string) st data "outscale_vpn_connection" "test" { filter { name = "vpn_connection_ids" - values = ["${outscale_vpn_connection.foo.id}"] + values = [outscale_vpn_connection.foo.id] } } `, publicIP) diff --git a/outscale/instance_set_set.go b/outscale/instance_set_set.go index 829b16a87..899a1d233 100644 --- a/outscale/instance_set_set.go +++ b/outscale/instance_set_set.go @@ -3,7 +3,6 @@ package outscale import ( "bytes" "fmt" - "strconv" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oscgo "github.com/outscale/osc-sdk-go/v2" @@ -30,15 +29,15 @@ func getOAPILinkNicLight(l oscgo.LinkNicLight) []map[string]interface{} { }} } -func getOAPILinkNic(l oscgo.LinkNic) map[string]interface{} { - return map[string]interface{}{ - "delete_on_vm_deletion": strconv.FormatBool(l.GetDeleteOnVmDeletion()), - "device_number": fmt.Sprintf("%d", l.GetDeviceNumber()), +func getOAPILinkNic(l oscgo.LinkNic) []map[string]interface{} { + return []map[string]interface{}{{ + "delete_on_vm_deletion": l.GetDeleteOnVmDeletion(), + "device_number": l.GetDeviceNumber(), "link_nic_id": l.GetLinkNicId(), "state": l.GetState(), "vm_account_id": l.GetVmAccountId(), "vm_id": l.GetVmId(), - } + }} } func getOAPIBsuSet(bsu oscgo.BsuCreated) []map[string]interface{} { diff --git a/outscale/resource_outscale_api_access_rule_test.go b/outscale/resource_outscale_api_access_rule_test.go index 528c591d7..83f11377a 100644 --- a/outscale/resource_outscale_api_access_rule_test.go +++ b/outscale/resource_outscale_api_access_rule_test.go @@ -3,6 +3,7 @@ package outscale import ( "context" "fmt" + "os" "testing" "time" @@ -15,6 +16,7 @@ import ( func TestAccOthers_AccessRule_basic(t *testing.T) { t.Parallel() resourceName := "outscale_api_access_rule.rule_test" + ca_path := os.Getenv("CA_PATH") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -22,7 +24,7 @@ func TestAccOthers_AccessRule_basic(t *testing.T) { CheckDestroy: testAccCheckOutscaleApiAccessRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPIApiAccessRuleConfig(), + Config: testAccOutscaleOAPIApiAccessRuleConfig(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleApiAccessRuleExists(resourceName), ), @@ -115,10 +117,10 @@ func testAccCheckOutscaleApiAccessRuleDestroy(s *terraform.State) error { return nil } -func testAccOutscaleOAPIApiAccessRuleConfig() string { +func testAccOutscaleOAPIApiAccessRuleConfig(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_rule" { - ca_pem = file("./test-cert.pem") + ca_pem = file(%q) description = "Ca testacc create" } @@ -126,6 +128,5 @@ resource "outscale_api_access_rule" "rule_test" { ca_ids = [outscale_ca.ca_rule.id] ip_ranges = ["192.0.2.0/16"] description = "testing api access rule" -} - `) +}`, path) } diff --git a/outscale/resource_outscale_ca_test.go b/outscale/resource_outscale_ca_test.go index f66442530..e0f223047 100644 --- a/outscale/resource_outscale_ca_test.go +++ b/outscale/resource_outscale_ca_test.go @@ -3,6 +3,7 @@ package outscale import ( "context" "fmt" + "os" "testing" "time" @@ -15,6 +16,7 @@ import ( func TestAccOthers_Ca_basic(t *testing.T) { t.Parallel() resourceName := "outscale_ca.ca_test" + ca_path := os.Getenv("CA_PATH") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -22,13 +24,13 @@ func TestAccOthers_Ca_basic(t *testing.T) { CheckDestroy: testAccCheckOutscaleCaDestroy, Steps: []resource.TestStep{ { - Config: testAccOutscaleOAPICaConfig(), + Config: testAccOutscaleOAPICaConfig(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleCaExists(resourceName), ), }, { - Config: testAccOutscaleOAPICaConfigUpdateDescription(), + Config: testAccOutscaleOAPICaConfigUpdateDescription(ca_path), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleCaExists(resourceName), ), @@ -120,20 +122,18 @@ func testAccCheckOutscaleCaDestroy(s *terraform.State) error { return nil } -func testAccOutscaleOAPICaConfig() string { +func testAccOutscaleOAPICaConfig(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_test" { - ca_pem = file("./test-cert.pem") + ca_pem = file(%q) description = "Ca testacc create" -} - `) +}`, path) } -func testAccOutscaleOAPICaConfigUpdateDescription() string { +func testAccOutscaleOAPICaConfigUpdateDescription(path string) string { return fmt.Sprintf(` resource "outscale_ca" "ca_test" { - ca_pem = file("./test-cert.pem") + ca_pem = file(%q) description = "Ca testacc update" -} - `) +}`, path) } diff --git a/outscale/resource_outscale_flexible_gpu_link_test.go b/outscale/resource_outscale_flexible_gpu_link_test.go index c47366ceb..b1c4403bc 100644 --- a/outscale/resource_outscale_flexible_gpu_link_test.go +++ b/outscale/resource_outscale_flexible_gpu_link_test.go @@ -38,13 +38,13 @@ func testAccOutscaleOAPIFlexibleGpuLinkConfig(omi, vmType, region string) string resource "outscale_flexible_gpu" "fGPU-1" { model_name = "nvidia-p6" generation = "v5" - subregion_name = "%[3]s" + subregion_name = "%[3]sa" delete_on_vm_deletion = true } resource "outscale_flexible_gpu" "fGPU-2" { model_name = "nvidia-p6" generation = "v5" - subregion_name = "%[3]s" + subregion_name = "%[3]sa" delete_on_vm_deletion = true } resource "outscale_flexible_gpu_link" "link_fGPU" { diff --git a/outscale/resource_outscale_load_balancer_attributes_test.go b/outscale/resource_outscale_load_balancer_attributes_test.go index 2e7cc2997..b7fc85407 100644 --- a/outscale/resource_outscale_load_balancer_attributes_test.go +++ b/outscale/resource_outscale_load_balancer_attributes_test.go @@ -50,7 +50,7 @@ func testAccCheckOutscaleOAPILBUAttrExists(n string, res *oscgo.AccessLog) resou func testAccOutscaleOAPILBUAttrConfig(region string, r int) string { return fmt.Sprintf(` -resource "outscale_load_balancer" "bar" { +resource "outscale_load_balancer" "barAtt" { subregion_names = ["%sa"] load_balancer_name = "foobar-terraform-elb-%d" listeners { @@ -70,7 +70,7 @@ resource "outscale_load_balancer_attributes" "bar2" { is_enabled = "false" osu_bucket_prefix = "donustestbucket" } - load_balancer_name = outscale_load_balancer.bar.id + load_balancer_name = outscale_load_balancer.barAtt.id } `, region, r) } diff --git a/outscale/resource_outscale_load_balancer_test.go b/outscale/resource_outscale_load_balancer_test.go index dee44f528..b4abc6b70 100644 --- a/outscale/resource_outscale_load_balancer_test.go +++ b/outscale/resource_outscale_load_balancer_test.go @@ -19,7 +19,7 @@ func TestAccOthers_LBUBasic(t *testing.T) { t.Parallel() var conf oscgo.LoadBalancer - resourceName := "outscale_load_balancer.bar" + resourceName := "outscale_load_balancer.barRes" r := utils.RandIntRange(0, 10) zone := fmt.Sprintf("%sa", utils.GetRegion()) @@ -49,7 +49,7 @@ func TestAccOthers_LBUPublicIp(t *testing.T) { t.Parallel() var conf oscgo.LoadBalancer - resourceName := "outscale_load_balancer.bar" + resourceName := "outscale_load_balancer.barIp" r := utils.RandIntRange(10, 20) @@ -179,7 +179,7 @@ func testAccCheckOutscaleOAPILBUExists(n string, res *oscgo.LoadBalancer) resour func testAccOutscaleOAPILBUConfig(r int) string { return fmt.Sprintf(` -resource "outscale_load_balancer" "bar" { +resource "outscale_load_balancer" "barRes" { subregion_names = ["%sa"] load_balancer_name = "foobar-terraform-elb-%d" @@ -207,7 +207,7 @@ func testAccOutscaleOAPILBUPublicIpConfig(r int) string { resource "outscale_public_ip" "my_public_ip" { } - resource "outscale_load_balancer" "bar" { + resource "outscale_load_balancer" "barIp" { subregion_names = ["%[1]sa"] load_balancer_name = "foobar-terraform-elb-%[2]d" diff --git a/outscale/resource_outscale_load_balancer_vms_test.go b/outscale/resource_outscale_load_balancer_vms_test.go index c6b7a0afe..4d6819195 100644 --- a/outscale/resource_outscale_load_balancer_vms_test.go +++ b/outscale/resource_outscale_load_balancer_vms_test.go @@ -32,14 +32,14 @@ func TestAccVM_WithLBUAttachment_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "outscale_load_balancer.bar", + IDRefreshName: "outscale_load_balancer.barTach", Providers: testAccProviders, CheckDestroy: testAccCheckOutscaleOAPILBUDestroy, Steps: []resource.TestStep{ { Config: testAccOutscaleOAPILBUAttachmentConfig1(rand, omi, utils.GetRegion()), Check: resource.ComposeTestCheckFunc( - testAccCheckOutscaleOAPILBUExists("outscale_load_balancer.bar", &conf), + testAccCheckOutscaleOAPILBUExists("outscale_load_balancer.barTach", &conf), testCheckInstanceAttached(1), ), }, @@ -50,9 +50,9 @@ func TestAccVM_WithLBUAttachment_basic(t *testing.T) { // add one attachment func testAccOutscaleOAPILBUAttachmentConfig1(num int, omi, region string) string { return fmt.Sprintf(` -resource "outscale_load_balancer" "bar" { +resource "outscale_load_balancer" "barTach" { load_balancer_name = "load-test-%d" - subregion_names = ["%sa"] + subregion_names = ["%[2]sa"] listeners { backend_port = 8000 backend_protocol = "HTTP" @@ -62,17 +62,17 @@ resource "outscale_load_balancer" "bar" { } resource "outscale_vm" "foo1" { - image_id = "%[2]s" + image_id = "%[3]s" vm_type = "tinav4.c1r1p1" } resource "outscale_vm" "foo2" { - image_id = "%[2]s" + image_id = "%[3]s" vm_type = "tinav4.c1r1p1" } resource "outscale_load_balancer_vms" "foo1" { - load_balancer_name = outscale_load_balancer.bar.id + load_balancer_name = outscale_load_balancer.barTach.id backend_vm_ids = [outscale_vm.foo1.id] } `, num, region, omi) @@ -80,9 +80,9 @@ resource "outscale_load_balancer_vms" "foo1" { func testAcc_ConfigLBUAttachmentAddUpdate(omi, region string) string { return fmt.Sprintf(` -resource "outscale_load_balancer" "bar" { +resource "outscale_load_balancer" "barTach" { load_balancer_name = "load-test12" - subregion_names = ["%sa"] + subregion_names = ["%[1]sa"] listeners { backend_port = 8000 backend_protocol = "HTTP" @@ -102,7 +102,7 @@ resource "outscale_vm" "foo2" { } resource "outscale_load_balancer_vms" "foo1" { - load_balancer_name = outscale_load_balancer.bar.id + load_balancer_name = outscale_load_balancer.barTach.id backend_vm_ids = [outscale_vm.foo1.id, outscale_vm.foo2.id] } `, region, omi) @@ -110,7 +110,7 @@ resource "outscale_load_balancer_vms" "foo1" { func testAcc_ConfigLBUAttachmentRemoveUpdate(omi, region string) string { return fmt.Sprintf(` -resource "outscale_load_balancer" "bar" { +resource "outscale_load_balancer" "barTach" { load_balancer_name = "load-test12" subregion_names = ["%sa"] listeners { @@ -132,7 +132,7 @@ resource "outscale_vm" "foo2" { } resource "outscale_load_balancer_vms" "foo1" { - load_balancer_name = outscale_load_balancer.bar.id + load_balancer_name = outscale_load_balancer.barTach.id backend_vm_ids = [outscale_vm.foo2.id] } `, region, omi) diff --git a/outscale/resource_outscale_vm_test.go b/outscale/resource_outscale_vm_test.go index 6d84ca9b1..31440718b 100644 --- a/outscale/resource_outscale_vm_test.go +++ b/outscale/resource_outscale_vm_test.go @@ -133,7 +133,7 @@ func testAccCheckOutscaleVMImportStateIDFunc(resourceName string) resource.Impor func TestAccNet_VM_withNicAttached(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" resourceName := "outscale_vm.basic" resource.Test(t, resource.TestCase{ @@ -158,7 +158,7 @@ func TestAccVM_withTags(t *testing.T) { t.Parallel() var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" tagsValue := "test_tags1" resource.Test(t, resource.TestCase{ @@ -167,7 +167,7 @@ func TestAccVM_withTags(t *testing.T) { CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, Steps: []resource.TestStep{ { - Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, "Terraform-VM", keypair), + Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, keypair), Check: resource.ComposeTestCheckFunc( testAccCheckOutscaleOAPIVMExists("outscale_vm.basic", &server), testAccCheckOutscaleOAPIVMAttributes(t, &server, omi), @@ -184,7 +184,7 @@ func TestAccVM_withTags(t *testing.T) { func TestAccNet_VM_withNics(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -209,7 +209,7 @@ func TestAccNet_VM_withNics(t *testing.T) { func TestAccOutscaleOAPIVM_WithSubnet(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -234,7 +234,7 @@ func TestAccOutscaleOAPIVM_WithSubnet(t *testing.T) { func TestAccVM_UpdateDeletionProtection(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -260,7 +260,7 @@ func TestAccVM_UpdateDeletionProtection(t *testing.T) { func TestAccVM_UpdateTags(t *testing.T) { t.Parallel() omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" tagsValue := "test_tags1" //TODO: check tags @@ -270,11 +270,11 @@ func TestAccVM_UpdateTags(t *testing.T) { CheckDestroy: testAccCheckOutscaleOAPIVMDestroy, Steps: []resource.TestStep{ { - Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, "Terraform-VM", keypair), + Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, keypair), //Check: resource.ComposeTestCheckFunc(), }, { - Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), tagsValue, "Terraform-VM2", keypair), + Config: testAccVmsConfigUpdateOAPIVMTags(omi, "tinav4.c2r2p2", utils.GetRegion(), "Terraform-VM2", keypair), //Check: resource.ComposeTestCheckFunc(), }, }, @@ -284,7 +284,7 @@ func TestAccVM_UpdateTags(t *testing.T) { func TestAccNet_WithVM_PublicIp_Link(t *testing.T) { var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" vmType := "tinav4.c2r2p2" resource.Test(t, resource.TestCase{ @@ -311,7 +311,7 @@ func TestAccVM_multiBlockDeviceMapping(t *testing.T) { t.Parallel() var server oscgo.Vm omi := os.Getenv("OUTSCALE_IMAGEID") - keypair := os.Getenv("OUTSCALE_KEYPAIR") + keypair := "terraform-basic" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -602,12 +602,6 @@ func testAccCheckOutscaleOAPIVMConfigBasic(omi, vmType, region, keypair string) vm_type = "%[2]s" keypair_name = "%[4]s" placement_subregion_name = "%[3]s" - #placement_tenancy = "dedicated" - #nested_virtualization = true - tags { - key = "name" - value = "Terraform-VM" - } }`, omi, vmType, region, keypair) } @@ -722,26 +716,8 @@ func testAccCheckOutscaleOAPIVMConfigBasicWithNics(omi, vmType, keypair, region }`, omi, vmType, keypair, region) } -func testAccVmsConfigUpdateOAPIVMTags(omi, vmType, region, value, keypair, sgId string) string { +func testAccVmsConfigUpdateOAPIVMTags(omi, vmType, region, value, keypair string) string { return fmt.Sprintf(` - resource "outscale_net" "net" { - ip_range = "10.0.0.0/16" - tags { - key = "Name" - value = "testacc-security-group-rs" - } - } - - resource "outscale_security_group" "sg" { - security_group_name = "%[5]s" - description = "Used in the terraform acceptance tests" - tags { - key = "Name" - value = "tf-acc-test" - } - net_id = outscale_net.net.id - } - resource "outscale_vm" "basic" { image_id = "%[1]s" vm_type = "%[2]s" diff --git a/scripts/generate-certificate.sh b/scripts/generate-certificate.sh index 3eb977ed5..9d34e2ee3 100755 --- a/scripts/generate-certificate.sh +++ b/scripts/generate-certificate.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -e -x project_dir=$(cd "$(dirname $0)" && pwd) project_root=$(cd $project_dir/.. && pwd) @@ -27,7 +27,7 @@ EOF EOF delete = "" } - working_directory = "${path.module}/." + working_directory = path.module } ' > "outscale/$tf_file" diff --git a/tests/qa_provider_oapi/data/flexible_gpu/TF-177_flexible_gpu_datasource_attributes_ok/step1.flexible_gpu_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/flexible_gpu/TF-177_flexible_gpu_datasource_attributes_ok/step1.flexible_gpu_datasource_attributes_ok.ref index 7c5b773f5..afdafc6a0 100644 --- a/tests/qa_provider_oapi/data/flexible_gpu/TF-177_flexible_gpu_datasource_attributes_ok/step1.flexible_gpu_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/flexible_gpu/TF-177_flexible_gpu_datasource_attributes_ok/step1.flexible_gpu_datasource_attributes_ok.ref @@ -110,8 +110,10 @@ { "schema_version": 0, "attributes": { - "flexible_gpu_id": "##id-0##", - "id": "##id-0##", + "flexible_gpu_ids": [ + "##id-0##" + ], + "id": "##id-2##", "request_id": "########", "timeouts": null, "vm_id": "##id-1##" @@ -135,7 +137,7 @@ { "schema_version": 0, "attributes": { - "id": "##id-2##", + "id": "##id-3##", "keypair_fingerprint": "########", "keypair_name": "KP-TF177", "private_key": "########", @@ -162,12 +164,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-3##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-4##" + } + ], "device_name": "/dev/sda1" } ], @@ -178,7 +182,7 @@ "get_admin_password": null, "hypervisor": "xen", "id": "##id-1##", - "image_id": "##id-4##", + "image_id": "##id-5##", "is_source_dest_checked": true, "keypair_name": "KP-TF177", "launch_number": 0, @@ -199,14 +203,14 @@ "public_dns_name": "########", "public_ip": "########", "request_id": "########", - "reservation_id": "##id-5##", + "reservation_id": "##id-6##", "root_device_name": "/dev/sda1", "root_device_type": "ebs", "security_group_ids": null, "security_group_names": null, "security_groups": [ { - "security_group_id": "##id-6##", + "security_group_id": "##id-7##", "security_group_name": "default" } ], diff --git a/tests/qa_provider_oapi/data/flexible_gpu/TF-177_flexible_gpu_datasource_attributes_ok/step1.flexible_gpu_datasource_attributes_ok.tf b/tests/qa_provider_oapi/data/flexible_gpu/TF-177_flexible_gpu_datasource_attributes_ok/step1.flexible_gpu_datasource_attributes_ok.tf index c51abaf17..c93dd98e5 100644 --- a/tests/qa_provider_oapi/data/flexible_gpu/TF-177_flexible_gpu_datasource_attributes_ok/step1.flexible_gpu_datasource_attributes_ok.tf +++ b/tests/qa_provider_oapi/data/flexible_gpu/TF-177_flexible_gpu_datasource_attributes_ok/step1.flexible_gpu_datasource_attributes_ok.tf @@ -20,7 +20,7 @@ resource "outscale_flexible_gpu" "fGPU-1" { resource "outscale_flexible_gpu_link" "link_fGPU" { - flexible_gpu_id = outscale_flexible_gpu.fGPU-1.flexible_gpu_id + flexible_gpu_ids = [outscale_flexible_gpu.fGPU-1.flexible_gpu_id] vm_id = outscale_vm.MaVM.vm_id } diff --git a/tests/qa_provider_oapi/data/load_balancer_vm_health/TF-92_load_balancer_vm_health_datasource_attributes_ok/step1.load_balancer_vm_health_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vm_health/TF-92_load_balancer_vm_health_datasource_attributes_ok/step1.load_balancer_vm_health_datasource_attributes_ok.ref index 2e941a8b9..3a3acb1e5 100644 --- a/tests/qa_provider_oapi/data/load_balancer_vm_health/TF-92_load_balancer_vm_health_datasource_attributes_ok/step1.load_balancer_vm_health_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_vm_health/TF-92_load_balancer_vm_health_datasource_attributes_ok/step1.load_balancer_vm_health_datasource_attributes_ok.ref @@ -65,24 +65,28 @@ { "schema_version": 0, "attributes": { - "access_log": { - "is_enabled": "false", - "osu_bucket_name": "", - "osu_bucket_prefix": "", - "publication_interval": "60" - }, + "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" - }, + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], "id": "##id-3##", "listeners": [ { @@ -102,10 +106,12 @@ "request_id": "########", "secured_cookies": false, "security_groups": [], - "source_security_group": { - "security_group_account_id": "##id-4##", - "security_group_name": "outscale-elb-sg" - }, + "source_security_group": [ + { + "security_group_account_id": "##id-4##", + "security_group_name": "outscale-elb-sg" + } + ], "subnets": [], "subregion_names": [ "eu-west-2a" @@ -146,7 +152,7 @@ { "check_interval": 30, "healthy_threshold": 10, - "path": "", + "path": "/", "port": 8080, "protocol": "HTTP", "timeout": 5, @@ -172,10 +178,12 @@ "request_id": "########", "security_groups": [], "server_certificate_id": null, - "source_security_group": { - "security_group_account_id": "##id-4##", - "security_group_name": "outscale-elb-sg" - }, + "source_security_group": [ + { + "security_group_account_id": "##id-4##", + "security_group_name": "outscale-elb-sg" + } + ], "subnets": [], "subregion_names": [ "eu-west-2a" @@ -294,12 +302,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-8##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-8##" + } + ], "device_name": "/dev/sda1" } ], diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step1.load_balancer_vms_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step1.load_balancer_vms_resource_attributes_ok.ref index 5ee6d3b50..81a5dbe6b 100644 --- a/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step1.load_balancer_vms_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step1.load_balancer_vms_resource_attributes_ok.ref @@ -36,24 +36,28 @@ { "schema_version": 0, "attributes": { - "access_log": { - "is_enabled": "false", - "osu_bucket_name": "", - "osu_bucket_prefix": "", - "publication_interval": "60" - }, + "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" - }, + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], "id": "##id-1##", "listeners": [ { @@ -81,10 +85,12 @@ "request_id": "########", "secured_cookies": false, "security_groups": [], - "source_security_group": { - "security_group_account_id": "##id-2##", - "security_group_name": "outscale-elb-sg" - }, + "source_security_group": [ + { + "security_group_account_id": "##id-2##", + "security_group_name": "outscale-elb-sg" + } + ], "subnets": [], "subregion_names": [ "eu-west-2a" @@ -143,12 +149,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-6##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-6##" + } + ], "device_name": "/dev/sda1" } ], @@ -221,12 +229,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-10##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-10##" + } + ], "device_name": "/dev/sda1" } ], diff --git a/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step2.load_balancer_vms_resource_remove_vm_ok.ref b/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step2.load_balancer_vms_resource_remove_vm_ok.ref index 7d1b1bc1a..338cc1bc0 100644 --- a/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step2.load_balancer_vms_resource_remove_vm_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_vms/TF-93_load_balancer_vms_resource_attributes_ok/step2.load_balancer_vms_resource_remove_vm_ok.ref @@ -36,27 +36,31 @@ { "schema_version": 0, "attributes": { - "access_log": { - "is_enabled": "false", - "osu_bucket_name": "", - "osu_bucket_prefix": "", - "publication_interval": "60" - }, + "access_log": [ + { + "is_enabled": false, + "osu_bucket_name": "", + "osu_bucket_prefix": "", + "publication_interval": 60 + } + ], "application_sticky_cookie_policies": [], "backend_vm_ids": [ "##id-1##", "##id-2##" ], "dns_name": "########", - "health_check": { - "check_interval": "30", - "healthy_threshold": "10", - "path": "", - "port": "8080", - "protocol": "TCP", - "timeout": "5", - "unhealthy_threshold": "2" - }, + "health_check": [ + { + "check_interval": 30, + "healthy_threshold": 10, + "path": "", + "port": 8080, + "protocol": "TCP", + "timeout": 5, + "unhealthy_threshold": 2 + } + ], "id": "##id-3##", "listeners": [ { @@ -84,10 +88,12 @@ "request_id": "########", "secured_cookies": false, "security_groups": [], - "source_security_group": { - "security_group_account_id": "##id-4##", - "security_group_name": "outscale-elb-sg" - }, + "source_security_group": [ + { + "security_group_account_id": "##id-4##", + "security_group_name": "outscale-elb-sg" + } + ], "subnets": [], "subregion_names": [ "eu-west-2a" @@ -145,12 +151,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-6##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-6##" + } + ], "device_name": "/dev/sda1" } ], @@ -223,12 +231,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-10##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-10##" + } + ], "device_name": "/dev/sda1" } ], diff --git a/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.ref index 871e5b292..62a4729cf 100644 --- a/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.ref @@ -18,39 +18,60 @@ "id": "##id-0##", "net_peerings": [ { - "accepter_net": { - "account_id": "##id-1##", - "ip_range": "10.10.0.0/24", - "net_id": "##id-2##" - }, + "accepter_net": [ + { + "account_id": "##id-1##", + "ip_range": "10.10.0.0/24", + "net_id": "##id-2##" + } + ], "net_peering_id": "##id-3##", - "source_net": { - "account_id": "##id-1##", - "ip_range": "10.20.0.0/16", - "net_id": "##id-4##" - }, - "state": { - "message": "########", - "name": "pending-acceptance" - }, - "tags": [] + "source_net": [ + { + "account_id": "##id-1##", + "ip_range": "10.31.0.0/16", + "net_id": "##id-4##" + } + ], + "state": [ + { + "message": "########", + "name": "pending-acceptance" + } + ], + "tags": [ + { + "key": "Key", + "value": "value-tags" + }, + { + "key": "Key-2", + "value": "value-tags-2" + } + ] }, { - "accepter_net": { - "account_id": "##id-1##", - "ip_range": "10.10.0.0/24", - "net_id": "##id-2##" - }, + "accepter_net": [ + { + "account_id": "##id-1##", + "ip_range": "10.10.0.0/24", + "net_id": "##id-2##" + } + ], "net_peering_id": "##id-5##", - "source_net": { - "account_id": "##id-1##", - "ip_range": "10.31.0.0/16", - "net_id": "##id-6##" - }, - "state": { - "message": "########", - "name": "pending-acceptance" - }, + "source_net": [ + { + "account_id": "##id-1##", + "ip_range": "10.20.0.0/16", + "net_id": "##id-6##" + } + ], + "state": [ + { + "message": "########", + "name": "pending-acceptance" + } + ], "tags": [] } ], @@ -67,6 +88,7 @@ "provider": "provider[\"registry.terraform.io/outscale/outscale\"]", "instances": [ { + "index_key": 0, "schema_version": 0, "attributes": { "dhcp_options_set_id": "##id-7##", @@ -75,7 +97,12 @@ "net_id": "##id-2##", "request_id": "########", "state": "available", - "tags": [], + "tags": [ + { + "key": "name", + "value": "net-1" + } + ], "tenancy": "default" }, "sensitive_attributes": [], @@ -93,12 +120,17 @@ "schema_version": 0, "attributes": { "dhcp_options_set_id": "##id-7##", - "id": "##id-6##", + "id": "##id-4##", "ip_range": "10.31.0.0/16", - "net_id": "##id-6##", + "net_id": "##id-4##", "request_id": "########", "state": "available", - "tags": [], + "tags": [ + { + "key": "name", + "value": "net-2" + } + ], "tenancy": "default" }, "sensitive_attributes": [], @@ -116,12 +148,17 @@ "schema_version": 0, "attributes": { "dhcp_options_set_id": "##id-7##", - "id": "##id-4##", + "id": "##id-6##", "ip_range": "10.20.0.0/16", - "net_id": "##id-4##", + "net_id": "##id-6##", "request_id": "########", "state": "available", - "tags": [], + "tags": [ + { + "key": "name", + "value": "net-3" + } + ], "tenancy": "default" }, "sensitive_attributes": [], @@ -138,26 +175,32 @@ { "schema_version": 0, "attributes": { - "accepter_net": { - "account_id": "##id-1##", - "ip_range": "10.10.0.0/24", - "net_id": "##id-2##" - }, + "accepter_net": [ + { + "account_id": "##id-1##", + "ip_range": "10.10.0.0/24", + "net_id": "##id-2##" + } + ], "accepter_net_id": "##id-2##", - "id": "##id-5##", - "net_peering_id": "##id-5##", + "id": "##id-3##", + "net_peering_id": "##id-3##", "request_id": "########", - "source_net": { - "account_id": "##id-1##", - "ip_range": "10.31.0.0/16", - "net_id": "##id-6##" - }, + "source_net": [ + { + "account_id": "##id-1##", + "ip_range": "10.31.0.0/16", + "net_id": "##id-4##" + } + ], "source_net_account_id": null, - "source_net_id": "##id-6##", - "state": { - "message": "########", - "name": "pending-acceptance" - }, + "source_net_id": "##id-4##", + "state": [ + { + "message": "########", + "name": "pending-acceptance" + } + ], "tags": [ { "key": "Key", @@ -187,26 +230,32 @@ { "schema_version": 0, "attributes": { - "accepter_net": { - "account_id": "##id-1##", - "ip_range": "10.10.0.0/24", - "net_id": "##id-2##" - }, + "accepter_net": [ + { + "account_id": "##id-1##", + "ip_range": "10.10.0.0/24", + "net_id": "##id-2##" + } + ], "accepter_net_id": "##id-2##", - "id": "##id-3##", - "net_peering_id": "##id-3##", + "id": "##id-5##", + "net_peering_id": "##id-5##", "request_id": "########", - "source_net": { - "account_id": "##id-1##", - "ip_range": "10.20.0.0/16", - "net_id": "##id-4##" - }, + "source_net": [ + { + "account_id": "##id-1##", + "ip_range": "10.20.0.0/16", + "net_id": "##id-6##" + } + ], "source_net_account_id": null, - "source_net_id": "##id-4##", - "state": { - "message": "########", - "name": "pending-acceptance" - }, + "source_net_id": "##id-6##", + "state": [ + { + "message": "########", + "name": "pending-acceptance" + } + ], "tags": [] }, "sensitive_attributes": [], diff --git a/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.tf b/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.tf index 1b25b5341..3a7fbbec0 100644 --- a/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.tf +++ b/tests/qa_provider_oapi/data/nets/TF-107_net_peerings_datasource_attributes_ok/step1.net_peerings_datasource_attributes_ok.tf @@ -1,34 +1,31 @@ resource "outscale_net" "outscale_net" { - #count = 1 + count = 1 ip_range = "10.10.0.0/24" - # tags { - # key = "name" - # value = "net-1" - #} + tags { + key = "name" + value = "net-1" + } } resource "outscale_net" "outscale_net2" { - #count = 1 - ip_range = "10.31.0.0/16" - # tags { - # key = "name" - # value = "net-2" - # } + tags { + key = "name" + value = "net-2" + } } resource "outscale_net" "outscale_net3" { - #count = 1 ip_range = "10.20.0.0/16" - # tags { - # key = "name" - # value = "net-3" - # } + tags { + key = "name" + value = "net-3" + } } resource "outscale_net_peering" "outscale_net_peering" { - accepter_net_id = outscale_net.outscale_net.net_id + accepter_net_id = outscale_net.outscale_net[0].net_id source_net_id = outscale_net.outscale_net2.net_id tags { key = "Key" @@ -41,7 +38,7 @@ tags { } resource "outscale_net_peering" "outscale_net_peering2" { - accepter_net_id = outscale_net.outscale_net.net_id + accepter_net_id = outscale_net.outscale_net[0].net_id source_net_id = outscale_net.outscale_net3.net_id } diff --git a/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.ref index 2434b704d..bdc625a4a 100644 --- a/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.ref @@ -38,7 +38,7 @@ "attributes": { "dhcp_options_set_id": "##id-1##", "id": "##id-2##", - "ip_range": "10.0.0.0/16", + "ip_range": "10.10.0.0/16", "net_id": "##id-2##", "request_id": "########", "state": "available", @@ -63,21 +63,8 @@ "description": "", "id": "##id-4##", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "0", - "link_nic_id": "", - "state": "", - "vm_account_id": "", - "vm_id": "" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-2##", "nic_id": "##id-4##", @@ -86,13 +73,7 @@ "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -202,7 +183,7 @@ "attributes": { "available_ips_count": "########", "id": "##id-6##", - "ip_range": "10.0.0.0/16", + "ip_range": "10.10.0.0/16", "map_public_ip_on_launch": false, "net_id": "##id-2##", "request_id": "########", @@ -234,12 +215,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-10##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-10##" + } + ], "device_name": "/dev/sda1" } ], diff --git a/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.tf b/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.tf index 0526bc29d..259e8bf99 100644 --- a/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.tf +++ b/tests/qa_provider_oapi/data/nets/TF-111_nic_link_resource_attributes_ok/step1.nic_link_resource_attributes_ok.tf @@ -11,7 +11,7 @@ resource "outscale_vm" "outscale_vm" { resource "outscale_net" "outscale_net" { - ip_range = "10.0.3.0/16" + ip_range = "10.10.0.0/16" } resource "outscale_security_group" "outscale_security_group" { @@ -22,7 +22,7 @@ resource "outscale_security_group" "outscale_security_group" { resource "outscale_subnet" "outscale_subnet" { subregion_name = "${var.region}a" - ip_range = "10.0.3.0/16" + ip_range = "10.10.0.0/16" net_id = outscale_net.outscale_net.net_id } diff --git a/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.ref index aaf59bb5f..83341ce0d 100644 --- a/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.ref @@ -21,21 +21,17 @@ "account_id": "##id-1##", "description": "TF-109", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "1", - "link_nic_id": "##id-2##", - "state": "attached", - "vm_account_id": "##id-1##", - "vm_id": "##id-3##" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [ + { + "delete_on_vm_deletion": false, + "device_number": 1, + "link_nic_id": "##id-2##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", "nic_id": "##id-5##", @@ -43,25 +39,13 @@ "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" }, { "is_primary": false, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -109,21 +93,17 @@ "account_id": "##id-1##", "description": "Primary network interface", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "true", - "device_number": "0", - "link_nic_id": "##id-9##", - "state": "attached", - "vm_account_id": "##id-1##", - "vm_id": "##id-3##" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [ + { + "delete_on_vm_deletion": true, + "device_number": 0, + "link_nic_id": "##id-9##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", "nic_id": "##id-10##", @@ -131,13 +111,7 @@ "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -176,47 +150,31 @@ "account_id": "##id-1##", "description": "", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "2", - "link_nic_id": "##id-13##", - "state": "attached", - "vm_account_id": "##id-1##", - "vm_id": "##id-3##" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [ + { + "delete_on_vm_deletion": false, + "device_number": 2, + "link_nic_id": "##id-13##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-13##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" }, { "is_primary": false, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -241,35 +199,16 @@ "account_id": "##id-1##", "description": "", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "0", - "link_nic_id": "", - "state": "", - "vm_account_id": "", - "vm_id": "" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-16##", + "nic_id": "##id-15##", "private_dns_name": "########", "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -317,35 +256,16 @@ "account_id": "##id-1##", "description": "", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "0", - "link_nic_id": "", - "state": "", - "vm_account_id": "", - "vm_id": "" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-5##", + "nic_id": "##id-15##", "private_dns_name": "########", "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -374,47 +294,31 @@ "account_id": "##id-1##", "description": "TF-109", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "1", - "link_nic_id": "##id-2##", - "state": "attached", - "vm_account_id": "##id-1##", - "vm_id": "##id-3##" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [ + { + "delete_on_vm_deletion": false, + "device_number": 1, + "link_nic_id": "##id-2##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-13##", + "nic_id": "##id-5##", "private_dns_name": "########", "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" }, { "is_primary": false, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -460,23 +364,19 @@ "nics": [ { "account_id": "##id-1##", - "description": "", + "description": "TF-109", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "0", - "link_nic_id": "", - "state": "", - "vm_account_id": "", - "vm_id": "" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [ + { + "delete_on_vm_deletion": false, + "device_number": 1, + "link_nic_id": "##id-2##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", "nic_id": "##id-5##", @@ -484,13 +384,13 @@ "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], + "private_dns_name": "########", + "private_ip": "########" + }, + { + "is_primary": false, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -501,9 +401,9 @@ "security_group_name": "Terraform-SG" } ], - "state": "available", - "subnet_id": "##id-16##", - "subregion_name": "us-east-2b", + "state": "in-use", + "subnet_id": "##id-7##", + "subregion_name": "us-east-2a", "tags": [ { "key": "Key:", @@ -517,49 +417,18 @@ }, { "account_id": "##id-1##", - "description": "TF-109", + "description": "", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "1", - "link_nic_id": "##id-2##", - "state": "attached", - "vm_account_id": "##id-1##", - "vm_id": "##id-3##" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-13##", + "nic_id": "##id-15##", "private_dns_name": "########", "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, - "private_dns_name": "########", - "private_ip": "########" - }, - { - "is_primary": false, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -570,9 +439,9 @@ "security_group_name": "Terraform-SG" } ], - "state": "in-use", - "subnet_id": "##id-7##", - "subregion_name": "us-east-2a", + "state": "available", + "subnet_id": "##id-16##", + "subregion_name": "us-east-2b", "tags": [ { "key": "Key:", @@ -607,35 +476,16 @@ "account_id": "##id-1##", "description": "", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "0", - "link_nic_id": "", - "state": "", - "vm_account_id": "", - "vm_id": "" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-13##", + "nic_id": "##id-15##", "private_dns_name": "########", "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -647,7 +497,7 @@ } ], "state": "available", - "subnet_id": "##id-14##", + "subnet_id": "##id-16##", "subregion_name": "us-east-2b", "tags": [ { @@ -678,7 +528,7 @@ "attributes": { "dhcp_options_set_id": "##id-20##", "id": "##id-4##", - "ip_range": "10.0.0.0/16", + "ip_range": "10.5.0.0/16", "net_id": "##id-4##", "request_id": "########", "state": "available", @@ -703,21 +553,8 @@ "description": "TF-109", "id": "##id-5##", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "0", - "link_nic_id": "", - "state": "", - "vm_account_id": "", - "vm_id": "" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", "nic_id": "##id-5##", @@ -725,26 +562,14 @@ "private_ip": "########", "private_ips": [ { - "is_primary": false, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "is_primary": true, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" }, { - "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "is_primary": false, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -796,50 +621,25 @@ "attributes": { "account_id": "##id-1##", "description": "", - "id": "##id-16##", + "id": "##id-14##", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "0", - "link_nic_id": "", - "state": "", - "vm_account_id": "", - "vm_id": "" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-16##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ip": "########", "private_ips": [ { - "is_primary": false, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "is_primary": true, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" }, { - "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "is_primary": false, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -884,38 +684,19 @@ "attributes": { "account_id": "##id-1##", "description": "", - "id": "##id-13##", + "id": "##id-15##", "is_source_dest_checked": true, - "link_nic": { - "delete_on_vm_deletion": "false", - "device_number": "0", - "link_nic_id": "", - "state": "", - "vm_account_id": "", - "vm_id": "" - }, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_nic": [], + "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-13##", + "nic_id": "##id-15##", "private_dns_name": "########", "private_ip": "########", "private_ips": [ { "is_primary": true, - "link_public_ip": { - "link_public_ip_id": "", - "public_dns_name": "########", - "public_ip": "########", - "public_ip_account_id": "", - "public_ip_id": "" - }, + "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" } @@ -932,7 +713,7 @@ } ], "state": "available", - "subnet_id": "##id-14##", + "subnet_id": "##id-16##", "subregion_name": "us-east-2b", "tags": [ { @@ -998,9 +779,9 @@ "attributes": { "delete_on_vm_deletion": false, "device_number": 2, - "id": "##id-15##", - "link_nic_id": "##id-15##", - "nic_id": "##id-16##", + "id": "##id-13##", + "link_nic_id": "##id-13##", + "nic_id": "##id-14##", "request_id": "########", "state": null, "vm_account_id": null, @@ -1066,7 +847,7 @@ "attributes": { "available_ips_count": "########", "id": "##id-7##", - "ip_range": "10.0.0.0/24", + "ip_range": "10.5.0.0/24", "map_public_ip_on_launch": false, "net_id": "##id-4##", "request_id": "########", @@ -1094,13 +875,13 @@ "schema_version": 0, "attributes": { "available_ips_count": "########", - "id": "##id-14##", - "ip_range": "10.0.2.0/24", + "id": "##id-16##", + "ip_range": "10.5.2.0/24", "map_public_ip_on_launch": false, "net_id": "##id-4##", "request_id": "########", "state": "available", - "subnet_id": "##id-14##", + "subnet_id": "##id-16##", "subregion_name": "us-east-2b", "tags": [], "timeouts": null @@ -1127,12 +908,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-21##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-21##" + } + ], "device_name": "/dev/sda1" } ], diff --git a/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.tf b/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.tf index e6d98cb48..3cedabcf4 100644 --- a/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.tf +++ b/tests/qa_provider_oapi/data/nets/TF-113_nics_datasource_attributes_ok/step1.nics_datasource_attributes_ok.tf @@ -117,8 +117,6 @@ data "outscale_nics" "nic-2-main" { depends_on =[outscale_nic_link.nic_link01,outscale_nic_link.nic_link02] } - - data "outscale_nics" "nic-4" { filter { name = "private_ips_private_ips" diff --git a/tests/qa_provider_oapi/data/nets/TF-144_vm_resource_centos_attributes_ok/step1.vm_resource_centos_ok.ref b/tests/qa_provider_oapi/data/nets/TF-144_vm_resource_centos_attributes_ok/step1.vm_resource_centos_ok.ref index 438911b91..60e5ceb48 100644 --- a/tests/qa_provider_oapi/data/nets/TF-144_vm_resource_centos_attributes_ok/step1.vm_resource_centos_ok.ref +++ b/tests/qa_provider_oapi/data/nets/TF-144_vm_resource_centos_attributes_ok/step1.vm_resource_centos_ok.ref @@ -409,12 +409,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-15##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-15##" + } + ], "device_name": "/dev/sda1" } ], @@ -497,12 +499,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-19##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-19##" + } + ], "device_name": "/dev/sda1" } ], @@ -585,12 +589,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-22##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-22##" + } + ], "device_name": "/dev/sda1" } ], diff --git a/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref b/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref index 56cfeed7b..de8abed57 100644 --- a/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref +++ b/tests/qa_provider_oapi/data/nets/TF-65_Check_IGW_Destroy/step1.test_destroy_igw.ref @@ -786,7 +786,7 @@ "request_id": "########", "state": "available", "subnet_id": "##id-21##", - "subregion_name": "###region###a", + "subregion_name": "us-east-2a", "tags": [ { "key": "name", diff --git a/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step1.vm_resource_public_with_multiple_BDM_ok.ref b/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step1.vm_resource_public_with_multiple_BDM_ok.ref index 300c596c3..60c229cee 100644 --- a/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step1.vm_resource_public_with_multiple_BDM_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step1.vm_resource_public_with_multiple_BDM_ok.ref @@ -119,30 +119,36 @@ ], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "false", - "link_date": "########", - "state": "attached", - "volume_id": "##id-4##" - }, + "bsu": [ + { + "delete_on_vm_deletion": false, + "link_date": "########", + "state": "attached", + "volume_id": "##id-4##" + } + ], "device_name": "/dev/sda1" }, { - "bsu": { - "delete_on_vm_deletion": "false", - "link_date": "########", - "state": "attached", - "volume_id": "##id-5##" - }, + "bsu": [ + { + "delete_on_vm_deletion": false, + "link_date": "########", + "state": "attached", + "volume_id": "##id-5##" + } + ], "device_name": "/dev/sdb" }, { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-6##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-6##" + } + ], "device_name": "/dev/sdc" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step2.vm_resource_public_with_multiple_BDM_ok.ref b/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step2.vm_resource_public_with_multiple_BDM_ok.ref index 9d8418fc6..262c071bc 100644 --- a/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step2.vm_resource_public_with_multiple_BDM_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-146_vm_resource_public_with_BDM_attributes_ok/step2.vm_resource_public_with_multiple_BDM_ok.ref @@ -78,7 +78,7 @@ "bsu": [ { "delete_on_vm_deletion": true, - "iops": 0, + "iops": null, "snapshot_id": "", "volume_size": 100, "volume_type": "standard" @@ -92,7 +92,7 @@ "bsu": [ { "delete_on_vm_deletion": false, - "iops": 0, + "iops": null, "snapshot_id": "", "volume_size": 15, "volume_type": "standard" @@ -119,30 +119,36 @@ ], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-4##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-4##" + } + ], "device_name": "/dev/sda1" }, { - "bsu": { - "delete_on_vm_deletion": "false", - "link_date": "########", - "state": "attached", - "volume_id": "##id-5##" - }, + "bsu": [ + { + "delete_on_vm_deletion": false, + "link_date": "########", + "state": "attached", + "volume_id": "##id-5##" + } + ], "device_name": "/dev/sdb" }, { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-6##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-6##" + } + ], "device_name": "/dev/sdc" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-148_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok_2.ref b/tests/qa_provider_oapi/data/vm/TF-148_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok_2.ref index 1424a2d26..d0e7dac45 100644 --- a/tests/qa_provider_oapi/data/vm/TF-148_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok_2.ref +++ b/tests/qa_provider_oapi/data/vm/TF-148_vm_resource_with_user_data_attributes_ok/step1.vm_resource_with_user_data_ok_2.ref @@ -41,12 +41,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-1##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-1##" + } + ], "device_name": "/dev/sda1" } ], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.ref index 20f31591a..fa4a601a8 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.ref @@ -145,7 +145,7 @@ "bsu_optimized": false, "client_token": "", "creation_date": "########", - "deletion_protection": true, + "deletion_protection": false, "get_admin_password": null, "hypervisor": "xen", "id": "##id-7##", @@ -174,18 +174,18 @@ "root_device_name": "/dev/sda1", "root_device_type": "ebs", "security_group_ids": [ - "##id-4##", - "##id-3##" + "##id-3##", + "##id-4##" ], "security_group_names": null, "security_groups": [ - { - "security_group_id": "##id-4##", - "security_group_name": "terraform-sg-TF66-1" - }, { "security_group_id": "##id-3##", "security_group_name": "terraform-sg-TF66-0" + }, + { + "security_group_id": "##id-4##", + "security_group_name": "terraform-sg-TF66-1" } ], "state": "running", diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.tf b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.tf index 35251d083..c1200f9b1 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.tf +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step3.vm_resource_update_security_group_ok.tf @@ -20,7 +20,7 @@ resource "outscale_vm" "outscale_vm-TF66" { image_id = var.image_id vm_type = "tinav4.c2r2p3" performance = "medium" - deletion_protection = true + deletion_protection = false vm_initiated_shutdown_behavior = "restart" security_group_ids = [outscale_security_group.security_group_TF66[0].security_group_id,outscale_security_group.security_group_TF66[1].security_group_id] keypair_name = outscale_keypair.keypair-TF66[1].keypair_name diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step4.vm_resource_update_deletion_protection_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step4.vm_resource_update_deletion_protection_ok.ref index d58903b6b..fa4a601a8 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step4.vm_resource_update_deletion_protection_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step4.vm_resource_update_deletion_protection_ok.ref @@ -174,18 +174,18 @@ "root_device_name": "/dev/sda1", "root_device_type": "ebs", "security_group_ids": [ - "##id-4##", - "##id-3##" + "##id-3##", + "##id-4##" ], "security_group_names": null, "security_groups": [ - { - "security_group_id": "##id-4##", - "security_group_name": "terraform-sg-TF66-1" - }, { "security_group_id": "##id-3##", "security_group_name": "terraform-sg-TF66-0" + }, + { + "security_group_id": "##id-4##", + "security_group_name": "terraform-sg-TF66-1" } ], "state": "running", diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.ref index d23c42932..b2dad41f5 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.ref @@ -174,18 +174,18 @@ "root_device_name": "/dev/sda1", "root_device_type": "ebs", "security_group_ids": [ - "##id-4##", - "##id-3##" + "##id-3##", + "##id-4##" ], "security_group_names": null, "security_groups": [ - { - "security_group_id": "##id-4##", - "security_group_name": "terraform-sg-TF66-1" - }, { "security_group_id": "##id-3##", "security_group_name": "terraform-sg-TF66-0" + }, + { + "security_group_id": "##id-4##", + "security_group_name": "terraform-sg-TF66-1" } ], "state": "running", @@ -195,7 +195,7 @@ "timeouts": null, "user_data": "", "vm_id": "##id-7##", - "vm_initiated_shutdown_behavior": "restart", + "vm_initiated_shutdown_behavior": "stop", "vm_type": "tinav4.c2r2p3" }, "sensitive_attributes": [], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.tf b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.tf index 95ec316c5..fc96f16dd 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.tf +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step5.vm_resource_update_bdm_ok.tf @@ -22,7 +22,7 @@ resource "outscale_vm" "outscale_vm-TF66" { vm_type = "tinav4.c2r2p3" performance = "medium" deletion_protection = false - vm_initiated_shutdown_behavior = "restart" + vm_initiated_shutdown_behavior = "stop" security_group_ids = [outscale_security_group.security_group_TF66[0].security_group_id,outscale_security_group.security_group_TF66[1].security_group_id] keypair_name = outscale_keypair.keypair-TF66[1].keypair_name } diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.ref index a0b870647..75f9cbb52 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.ref @@ -174,18 +174,18 @@ "root_device_name": "/dev/sda1", "root_device_type": "ebs", "security_group_ids": [ - "##id-4##", - "##id-3##" + "##id-3##", + "##id-4##" ], "security_group_names": null, "security_groups": [ - { - "security_group_id": "##id-4##", - "security_group_name": "terraform-sg-TF66-1" - }, { "security_group_id": "##id-3##", "security_group_name": "terraform-sg-TF66-0" + }, + { + "security_group_id": "##id-4##", + "security_group_name": "terraform-sg-TF66-1" } ], "state": "stopped", @@ -195,7 +195,7 @@ "timeouts": null, "user_data": "", "vm_id": "##id-7##", - "vm_initiated_shutdown_behavior": "restart", + "vm_initiated_shutdown_behavior": "stop", "vm_type": "###vm_type###" }, "sensitive_attributes": [], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.tf b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.tf index ec6deda51..e69f0bfce 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.tf +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step6.vm_resource_update_performance_ok.tf @@ -22,7 +22,7 @@ resource "outscale_vm" "outscale_vm-TF66" { vm_type = "tinav4.c2r2p2" performance = "high" deletion_protection = false - vm_initiated_shutdown_behavior = "restart" + vm_initiated_shutdown_behavior = "stop" security_group_ids = [outscale_security_group.security_group_TF66[0].security_group_id,outscale_security_group.security_group_TF66[1].security_group_id] keypair_name = outscale_keypair.keypair-TF66[1].keypair_name } diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step7.vm_resource_update_vm_type_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step7.vm_resource_update_vm_type_ok.ref index 6c1f5c7d5..649b37ab3 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step7.vm_resource_update_vm_type_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step7.vm_resource_update_vm_type_ok.ref @@ -174,18 +174,18 @@ "root_device_name": "/dev/sda1", "root_device_type": "ebs", "security_group_ids": [ - "##id-4##", - "##id-3##" + "##id-3##", + "##id-4##" ], "security_group_names": null, "security_groups": [ - { - "security_group_id": "##id-4##", - "security_group_name": "terraform-sg-TF66-1" - }, { "security_group_id": "##id-3##", "security_group_name": "terraform-sg-TF66-0" + }, + { + "security_group_id": "##id-4##", + "security_group_name": "terraform-sg-TF66-1" } ], "state": "running", diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.ref index b4618c07d..67c9775df 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.ref @@ -174,18 +174,18 @@ "root_device_name": "/dev/sda1", "root_device_type": "ebs", "security_group_ids": [ - "##id-4##", - "##id-3##" + "##id-3##", + "##id-4##" ], "security_group_names": null, "security_groups": [ - { - "security_group_id": "##id-4##", - "security_group_name": "terraform-sg-TF66-1" - }, { "security_group_id": "##id-3##", "security_group_name": "terraform-sg-TF66-0" + }, + { + "security_group_id": "##id-4##", + "security_group_name": "terraform-sg-TF66-1" } ], "state": "stopped", @@ -195,7 +195,7 @@ "timeouts": null, "user_data": "LS0tLS1CRUdJTiBPVVRTQ0FMRSBTRUNUSU9OLS0tLS0KCnByaXZhdGVfb25seT10cnVlCgotLS0tLUVORCBPVVRTQ0FMRSBTRUNUSU9OLS0tLS0=", "vm_id": "##id-7##", - "vm_initiated_shutdown_behavior": "restart", + "vm_initiated_shutdown_behavior": "stop", "vm_type": "tinav4.c3r3p2" }, "sensitive_attributes": [], diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.tf b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.tf index a3192cb46..c53d827f4 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.tf +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step8.vm_resource_update_user_data_ok.tf @@ -22,7 +22,7 @@ resource "outscale_vm" "outscale_vm-TF66" { vm_type = "tinav4.c3r3p2" performance = "high" deletion_protection = false - vm_initiated_shutdown_behavior = "restart" + vm_initiated_shutdown_behavior = "stop" security_group_ids = [outscale_security_group.security_group_TF66[0].security_group_id,outscale_security_group.security_group_TF66[1].security_group_id] keypair_name = outscale_keypair.keypair-TF66[1].keypair_name user_data = "LS0tLS1CRUdJTiBPVVRTQ0FMRSBTRUNUSU9OLS0tLS0KCnByaXZhdGVfb25seT10cnVlCgotLS0tLUVORCBPVVRTQ0FMRSBTRUNUSU9OLS0tLS0=" diff --git a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step9.vm_resource_update_shtdown_behaviour_ok.ref b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step9.vm_resource_update_shtdown_behaviour_ok.ref index b982e7d99..8261f2882 100644 --- a/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step9.vm_resource_update_shtdown_behaviour_ok.ref +++ b/tests/qa_provider_oapi/data/vm/TF-178_vm_resource_update_attributes_ok/step9.vm_resource_update_shtdown_behaviour_ok.ref @@ -185,17 +185,17 @@ ], "secondary_private_ip_count": 0, "security_group_ids": [ - "##id-4##", - "##id-3##" + "##id-3##", + "##id-4##" ], "security_groups": [ - { - "security_group_id": "##id-4##", - "security_group_name": "terraform-sg-TF66-1" - }, { "security_group_id": "##id-3##", "security_group_name": "terraform-sg-TF66-0" + }, + { + "security_group_id": "##id-4##", + "security_group_name": "terraform-sg-TF66-1" } ], "state": "in-use", @@ -236,17 +236,17 @@ ], "secondary_private_ip_count": 0, "security_group_ids": [ - "##id-4##", - "##id-3##" + "##id-3##", + "##id-4##" ], "security_groups": [ - { - "security_group_id": "##id-4##", - "security_group_name": "terraform-sg-TF66-1" - }, { "security_group_id": "##id-3##", "security_group_name": "terraform-sg-TF66-0" + }, + { + "security_group_id": "##id-4##", + "security_group_name": "terraform-sg-TF66-1" } ], "state": "in-use", @@ -266,18 +266,18 @@ "root_device_name": "/dev/sda1", "root_device_type": "ebs", "security_group_ids": [ - "##id-4##", - "##id-3##" + "##id-3##", + "##id-4##" ], "security_group_names": null, "security_groups": [ - { - "security_group_id": "##id-4##", - "security_group_name": "terraform-sg-TF66-1" - }, { "security_group_id": "##id-3##", "security_group_name": "terraform-sg-TF66-0" + }, + { + "security_group_id": "##id-4##", + "security_group_name": "terraform-sg-TF66-1" } ], "state": "running", diff --git a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref index 165c022ab..c2461020a 100644 --- a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref +++ b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step1.volumes_datasource_attributes_ok4.ref @@ -21,28 +21,20 @@ "volumes": [ { "creation_date": "########", - "iops": 100, - "linked_volumes": [ - { - "delete_on_vm_deletion": false, - "device_name": "/dev/xvdc", - "state": "attached", - "vm_id": "##id-1##", - "volume_id": "##id-2##" - } - ], - "size": 40, + "iops": 150, + "linked_volumes": [], + "size": 13, "snapshot_id": "", - "state": "in-use", + "state": "available", "subregion_name": "eu-west-2a", "tags": [ { - "key": "type", - "value": "io1" + "key": "Name", + "value": "volume-standard-2" } ], - "volume_id": "##id-2##", - "volume_type": "io1" + "volume_id": "##id-1##", + "volume_type": "standard" }, { "creation_date": "########", @@ -51,32 +43,40 @@ "size": 15, "snapshot_id": "", "state": "available", - "subregion_name": "###region###a", + "subregion_name": "eu-west-2a", "tags": [ { "key": "Name", "value": "volume-standard-1" } ], - "volume_id": "##id-3##", + "volume_id": "##id-2##", "volume_type": "standard" }, { "creation_date": "########", - "iops": 150, - "linked_volumes": [], - "size": 13, + "iops": 100, + "linked_volumes": [ + { + "delete_on_vm_deletion": false, + "device_name": "/dev/xvdc", + "state": "attached", + "vm_id": "##id-3##", + "volume_id": "##id-4##" + } + ], + "size": 40, "snapshot_id": "", - "state": "available", + "state": "in-use", "subregion_name": "eu-west-2a", "tags": [ { - "key": "Name", - "value": "volume-standard-2" + "key": "type", + "value": "io1" } ], "volume_id": "##id-4##", - "volume_type": "standard" + "volume_type": "io1" } ] }, @@ -198,7 +198,7 @@ "schema_version": 0, "attributes": { "creation_date": "########", - "id": "##id-1##", + "id": "##id-2##", "iops": 150, "linked_volumes": [], "request_id": "########", @@ -213,7 +213,7 @@ } ], "termination_snapshot_name": null, - "volume_id": "##id-1##", + "volume_id": "##id-2##", "volume_type": "standard" }, "sensitive_attributes": [], @@ -231,7 +231,7 @@ "schema_version": 0, "attributes": { "creation_date": "########", - "id": "##id-2##", + "id": "##id-1##", "iops": 150, "linked_volumes": [], "request_id": "########", @@ -246,7 +246,7 @@ } ], "termination_snapshot_name": null, - "volume_id": "##id-2##", + "volume_id": "##id-1##", "volume_type": "standard" }, "sensitive_attributes": [], diff --git a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref index 919c22954..832d9cb95 100644 --- a/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref +++ b/tests/qa_provider_oapi/data/volumes/TF-159_volumes_datasource_attributes_ok4/step2.volumes_datasource_attributes_ok4.ref @@ -21,28 +21,20 @@ "volumes": [ { "creation_date": "########", - "iops": 100, - "linked_volumes": [ - { - "delete_on_vm_deletion": false, - "device_name": "/dev/xvdc", - "state": "attached", - "vm_id": "##id-1##", - "volume_id": "##id-2##" - } - ], - "size": 40, + "iops": 150, + "linked_volumes": [], + "size": 13, "snapshot_id": "", - "state": "in-use", + "state": "available", "subregion_name": "eu-west-2a", "tags": [ { - "key": "type", - "value": "io1" + "key": "Name", + "value": "volume-standard-2" } ], - "volume_id": "##id-2##", - "volume_type": "io1" + "volume_id": "##id-1##", + "volume_type": "standard" }, { "creation_date": "########", @@ -51,32 +43,40 @@ "size": 15, "snapshot_id": "", "state": "available", - "subregion_name": "###region###a", + "subregion_name": "eu-west-2a", "tags": [ { "key": "Name", "value": "volume-standard-1" } ], - "volume_id": "##id-3##", + "volume_id": "##id-2##", "volume_type": "standard" }, { "creation_date": "########", - "iops": 150, - "linked_volumes": [], - "size": 13, + "iops": 100, + "linked_volumes": [ + { + "delete_on_vm_deletion": false, + "device_name": "/dev/xvdc", + "state": "attached", + "vm_id": "##id-3##", + "volume_id": "##id-4##" + } + ], + "size": 40, "snapshot_id": "", - "state": "available", + "state": "in-use", "subregion_name": "eu-west-2a", "tags": [ { - "key": "Name", - "value": "volume-standard-2" + "key": "type", + "value": "io1" } ], "volume_id": "##id-4##", - "volume_type": "standard" + "volume_type": "io1" } ] }, @@ -209,7 +209,7 @@ "schema_version": 0, "attributes": { "creation_date": "########", - "id": "##id-1##", + "id": "##id-2##", "iops": 150, "linked_volumes": [], "request_id": "########", @@ -224,7 +224,7 @@ } ], "termination_snapshot_name": null, - "volume_id": "##id-1##", + "volume_id": "##id-2##", "volume_type": "standard" }, "sensitive_attributes": [], @@ -242,7 +242,7 @@ "schema_version": 0, "attributes": { "creation_date": "########", - "id": "##id-2##", + "id": "##id-1##", "iops": 150, "linked_volumes": [], "request_id": "########", @@ -257,7 +257,7 @@ } ], "termination_snapshot_name": null, - "volume_id": "##id-2##", + "volume_id": "##id-1##", "volume_type": "standard" }, "sensitive_attributes": [], diff --git a/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref index 637d15538..6d1f22872 100644 --- a/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/volumes_link/TF-160_volumes_link_resource_attributes_ok/step1.volumes_link_resource_attributes_ok.ref @@ -41,12 +41,14 @@ "block_device_mappings": [], "block_device_mappings_created": [ { - "bsu": { - "delete_on_vm_deletion": "true", - "link_date": "########", - "state": "attached", - "volume_id": "##id-1##" - }, + "bsu": [ + { + "delete_on_vm_deletion": true, + "link_date": "########", + "state": "attached", + "volume_id": "##id-1##" + } + ], "device_name": "/dev/sda1" } ],