diff --git a/outscale/data_source_outscale_vm.go b/outscale/data_source_outscale_vm.go index ec816123f..e97bd14d4 100644 --- a/outscale/data_source_outscale_vm.go +++ b/outscale/data_source_outscale_vm.go @@ -28,7 +28,7 @@ func DataSourceOutscaleVMRead(d *schema.ResourceData, meta interface{}) error { instanceID, instanceIDOk := d.GetOk("vm_id") var err error if !filtersOk && !instanceIDOk { - return fmt.Errorf("One of filters, or instance_id must be assigned") + return fmt.Errorf("one of filters, or instance_id must be assigned") } // Build up search parameters params := oscgo.ReadVmsRequest{} diff --git a/outscale/data_source_outscale_vm_types_test.go b/outscale/data_source_outscale_vm_types_test.go index 328e8c8c5..cb8d5effe 100644 --- a/outscale/data_source_outscale_vm_types_test.go +++ b/outscale/data_source_outscale_vm_types_test.go @@ -19,7 +19,7 @@ func TestAccVM_TypesDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceOutscaleVMTypesConfig(omi, "tinav4.c1r1p1"), + Config: testAccDataSourceOutscaleVMTypesConfig(omi, "tinav5.c2r2p2"), }, }, }) diff --git a/outscale/resource_outscale_access_key_test.go b/outscale/resource_outscale_access_key_test.go index 8e0fe308a..77af4f01a 100644 --- a/outscale/resource_outscale_access_key_test.go +++ b/outscale/resource_outscale_access_key_test.go @@ -170,12 +170,15 @@ func testAccCheckOutscaleAccessKeyExists(resourceName string) resource.TestCheck return fmt.Errorf("No Access ID is set") } conn := testAccProvider.Meta().(*OutscaleClient).OSCAPI - - filter := oscgo.ReadSecretAccessKeyRequest{ - AccessKeyId: rs.Primary.ID, + filter := oscgo.FiltersAccessKeys{ + AccessKeyIds: &[]string{rs.Primary.ID}, + } + req := oscgo.ReadAccessKeysRequest{ + Filters: &filter, } + err := resource.Retry(2*time.Minute, func() *resource.RetryError { - _, httpResp, err := conn.AccessKeyApi.ReadSecretAccessKey(context.Background()).ReadSecretAccessKeyRequest(filter).Execute() + _, httpResp, err := conn.AccessKeyApi.ReadAccessKeys(context.Background()).ReadAccessKeysRequest(req).Execute() if err != nil { return utils.CheckThrottling(httpResp, err) } @@ -195,12 +198,15 @@ func testAccCheckOutscaleAccessKeyDestroy(s *terraform.State) error { if rs.Type != "outscale_access_key" { continue } - - filter := oscgo.ReadSecretAccessKeyRequest{ - AccessKeyId: rs.Primary.ID, + filter := oscgo.FiltersAccessKeys{ + AccessKeyIds: &[]string{rs.Primary.ID}, + } + req := oscgo.ReadAccessKeysRequest{ + Filters: &filter, } + err := resource.Retry(2*time.Minute, func() *resource.RetryError { - _, httpResp, err := conn.AccessKeyApi.ReadSecretAccessKey(context.Background()).ReadSecretAccessKeyRequest(filter).Execute() + _, httpResp, err := conn.AccessKeyApi.ReadAccessKeys(context.Background()).ReadAccessKeysRequest(req).Execute() if err != nil { return utils.CheckThrottling(httpResp, err) } diff --git a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-87_load_balancer_listener_rule_datasource_attributes_ok/step1.load_balancer_listener_rule_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-87_load_balancer_listener_rule_datasource_attributes_ok/step1.load_balancer_listener_rule_datasource_attributes_ok.ref index 5b301fc06..4f16cd6a9 100644 --- a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-87_load_balancer_listener_rule_datasource_attributes_ok/step1.load_balancer_listener_rule_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-87_load_balancer_listener_rule_datasource_attributes_ok/step1.load_balancer_listener_rule_datasource_attributes_ok.ref @@ -221,6 +221,7 @@ { "schema_version": 0, "attributes": { + "backend_ips": null, "backend_vm_ids": [ "##id-3##" ], diff --git a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step1.load_balancer_listener_rule_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step1.load_balancer_listener_rule_resource_attributes_ok.ref index e38598a83..a576438ab 100644 --- a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step1.load_balancer_listener_rule_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step1.load_balancer_listener_rule_resource_attributes_ok.ref @@ -237,6 +237,7 @@ { "schema_version": 0, "attributes": { + "backend_ips": null, "backend_vm_ids": [ "##id-6##" ], diff --git a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step2.load_balancer_listener_rule_resource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step2.load_balancer_listener_rule_resource_attributes_ok.ref index fdbfb5186..f2f61d073 100644 --- a/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step2.load_balancer_listener_rule_resource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_listener_rule/TF-88_load_balancer_listener_rule_resource_attributes_ok/step2.load_balancer_listener_rule_resource_attributes_ok.ref @@ -239,6 +239,7 @@ { "schema_version": 0, "attributes": { + "backend_ips": [], "backend_vm_ids": [ "##id-1##" ], diff --git a/tests/qa_provider_oapi/data/load_balancer_listener_rules/TF-89_load_balancer_listener_rules_datasource_attributes_ok/step1.load_balancer_listener_rules_datasource_attributes_ok.ref b/tests/qa_provider_oapi/data/load_balancer_listener_rules/TF-89_load_balancer_listener_rules_datasource_attributes_ok/step1.load_balancer_listener_rules_datasource_attributes_ok.ref index 6e1455378..7f81ca54d 100644 --- a/tests/qa_provider_oapi/data/load_balancer_listener_rules/TF-89_load_balancer_listener_rules_datasource_attributes_ok/step1.load_balancer_listener_rules_datasource_attributes_ok.ref +++ b/tests/qa_provider_oapi/data/load_balancer_listener_rules/TF-89_load_balancer_listener_rules_datasource_attributes_ok/step1.load_balancer_listener_rules_datasource_attributes_ok.ref @@ -19,24 +19,24 @@ "listener_rules": [ { "action": "forward", - "host_name_pattern": "", + "host_name_pattern": "*.abc.-.abc.*.com", "listener_id": "##id-1##", "listener_rule_id": "##id-2##", "listener_rule_name": "########", - "path_pattern": "*.abc.*.abc.*.com", - "priority": 10, + "path_pattern": "", + "priority": 1, "vm_ids": [ "##id-3##" ] }, { "action": "forward", - "host_name_pattern": "*.abc.-.abc.*.com", + "host_name_pattern": "", "listener_id": "##id-1##", "listener_rule_id": "##id-4##", "listener_rule_name": "########", - "path_pattern": "", - "priority": 1, + "path_pattern": "*.abc.*.abc.*.com", + "priority": 10, "vm_ids": [ "##id-3##" ] @@ -163,7 +163,7 @@ "action": "forward", "host_name_pattern": "", "listener_id": "##id-1##", - "listener_rule_id": "##id-2##", + "listener_rule_id": "##id-4##", "listener_rule_name": "########", "path_pattern": "*.abc.*.abc.*.com", "priority": 10 @@ -206,7 +206,7 @@ "action": "forward", "host_name_pattern": "*.abc.-.abc.*.com", "listener_id": "##id-1##", - "listener_rule_id": "##id-4##", + "listener_rule_id": "##id-2##", "listener_rule_name": "########", "path_pattern": "", "priority": 1 @@ -237,6 +237,7 @@ { "schema_version": 0, "attributes": { + "backend_ips": null, "backend_vm_ids": [ "##id-3##" ], 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 556b9a0bd..3190caae9 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 @@ -212,6 +212,7 @@ { "schema_version": 0, "attributes": { + "backend_ips": null, "backend_vm_ids": [ "##id-0##" ], 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 f9b1a68ae..0a8128aee 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 @@ -116,6 +116,7 @@ { "schema_version": 0, "attributes": { + "backend_ips": null, "backend_vm_ids": [ "##id-3##", "##id-4##" 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 b7a5a8578..c29ddcdc1 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 @@ -119,8 +119,9 @@ { "schema_version": 0, "attributes": { + "backend_ips": [], "backend_vm_ids": [ - "##id-2##" + "##id-1##" ], "id": "##id-5##", "load_balancer_name": "########", @@ -197,7 +198,7 @@ "deletion_protection": false, "get_admin_password": null, "hypervisor": "xen", - "id": "##id-2##", + "id": "##id-1##", "image_id": "##id-9##", "is_source_dest_checked": false, "keypair_name": "KP-TF93", @@ -243,7 +244,7 @@ ], "timeouts": null, "user_data": "ICAgICAjIS9iaW4vYmFzaAogICAgcHVzaGQgL2hvbWUKICAgIG5vaHVwIHB5dGhvbiAtbSBTaW1wbGVIVFRQU2VydmVyIDgwODAK", - "vm_id": "##id-2##", + "vm_id": "##id-1##", "vm_initiated_shutdown_behavior": "stop", "vm_type": "###vm_type###" }, @@ -281,7 +282,7 @@ "deletion_protection": false, "get_admin_password": null, "hypervisor": "xen", - "id": "##id-1##", + "id": "##id-2##", "image_id": "##id-9##", "is_source_dest_checked": false, "keypair_name": "KP-TF93", @@ -327,7 +328,7 @@ ], "timeouts": null, "user_data": "ICAgICAjIS9iaW4vYmFzaAogICAgcHVzaGQgL2hvbWUKICAgIG5vaHVwIHB5dGhvbiAtbSBTaW1wbGVIVFRQU2VydmVyIDgwODAK", - "vm_id": "##id-1##", + "vm_id": "##id-2##", "vm_initiated_shutdown_behavior": "stop", "vm_type": "###vm_type###" }, 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 8fcf630f4..6c204e02a 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 @@ -150,11 +150,20 @@ "account_id": "##id-1##", "description": "", "is_source_dest_checked": true, - "link_nic": [], + "link_nic": [ + { + "delete_on_vm_deletion": false, + "device_number": 2, + "link_nic_id": "##id-12##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-12##", + "nic_id": "##id-13##", "private_dns_name": "########", "private_ips": [ { @@ -162,6 +171,12 @@ "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" + }, + { + "is_primary": false, + "link_public_ip": [], + "private_dns_name": "########", + "private_ip": "########" } ], "security_groups": [ @@ -170,17 +185,13 @@ "security_group_name": "Terraform-SG-TF113" } ], - "state": "available", - "subnet_id": "##id-13##", - "subregion_name": "us-east-2b", + "state": "in-use", + "subnet_id": "##id-7##", + "subregion_name": "us-east-2a", "tags": [ { - "key": "Key:", - "value": ":value-tags" - }, - { - "key": "Key-2", - "value": "value-tags-2" + "key": "Name", + "value": "Nic-2" } ] }, @@ -188,20 +199,11 @@ "account_id": "##id-1##", "description": "", "is_source_dest_checked": true, - "link_nic": [ - { - "delete_on_vm_deletion": false, - "device_number": 2, - "link_nic_id": "##id-14##", - "state": "attached", - "vm_account_id": "##id-1##", - "vm_id": "##id-3##" - } - ], + "link_nic": [], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-15##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ips": [ { @@ -209,12 +211,6 @@ "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" - }, - { - "is_primary": false, - "link_public_ip": [], - "private_dns_name": "########", - "private_ip": "########" } ], "security_groups": [ @@ -223,13 +219,17 @@ "security_group_name": "Terraform-SG-TF113" } ], - "state": "in-use", - "subnet_id": "##id-7##", - "subregion_name": "us-east-2a", + "state": "available", + "subnet_id": "##id-15##", + "subregion_name": "us-east-2b", "tags": [ { - "key": "Name", - "value": "Nic-2" + "key": "Key:", + "value": ":value-tags" + }, + { + "key": "Key-2", + "value": "value-tags-2" } ] } @@ -256,11 +256,20 @@ "account_id": "##id-1##", "description": "", "is_source_dest_checked": true, - "link_nic": [], + "link_nic": [ + { + "delete_on_vm_deletion": false, + "device_number": 2, + "link_nic_id": "##id-12##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-12##", + "nic_id": "##id-13##", "private_dns_name": "########", "private_ips": [ { @@ -268,6 +277,12 @@ "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" + }, + { + "is_primary": false, + "link_public_ip": [], + "private_dns_name": "########", + "private_ip": "########" } ], "security_groups": [ @@ -276,38 +291,25 @@ "security_group_name": "Terraform-SG-TF113" } ], - "state": "available", - "subnet_id": "##id-13##", - "subregion_name": "us-east-2b", + "state": "in-use", + "subnet_id": "##id-7##", + "subregion_name": "us-east-2a", "tags": [ { - "key": "Key:", - "value": ":value-tags" - }, - { - "key": "Key-2", - "value": "value-tags-2" + "key": "Name", + "value": "Nic-2" } ] }, { "account_id": "##id-1##", - "description": "Primary network interface", + "description": "", "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_nic": [], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-10##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ips": [ { @@ -323,20 +325,29 @@ "security_group_name": "Terraform-SG-TF113" } ], - "state": "in-use", - "subnet_id": "##id-7##", - "subregion_name": "us-east-2a", - "tags": [] + "state": "available", + "subnet_id": "##id-15##", + "subregion_name": "us-east-2b", + "tags": [ + { + "key": "Key-2", + "value": "value-tags-2" + }, + { + "key": "Key:", + "value": ":value-tags" + } + ] }, { "account_id": "##id-1##", - "description": "", + "description": "TF-113", "is_source_dest_checked": true, "link_nic": [ { "delete_on_vm_deletion": false, - "device_number": 2, - "link_nic_id": "##id-14##", + "device_number": 1, + "link_nic_id": "##id-2##", "state": "attached", "vm_account_id": "##id-1##", "vm_id": "##id-3##" @@ -345,7 +356,7 @@ "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-15##", + "nic_id": "##id-5##", "private_dns_name": "########", "private_ips": [ { @@ -372,20 +383,24 @@ "subregion_name": "us-east-2a", "tags": [ { - "key": "Name", - "value": "Nic-2" + "key": "Key-2", + "value": "value-tags-2" + }, + { + "key": "Key:", + "value": ":value-tags" } ] }, { "account_id": "##id-1##", - "description": "TF-113", + "description": "Primary network interface", "is_source_dest_checked": true, "link_nic": [ { - "delete_on_vm_deletion": false, - "device_number": 1, - "link_nic_id": "##id-2##", + "delete_on_vm_deletion": true, + "device_number": 0, + "link_nic_id": "##id-9##", "state": "attached", "vm_account_id": "##id-1##", "vm_id": "##id-3##" @@ -394,7 +409,7 @@ "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-5##", + "nic_id": "##id-10##", "private_dns_name": "########", "private_ips": [ { @@ -402,12 +417,6 @@ "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" - }, - { - "is_primary": false, - "link_public_ip": [], - "private_dns_name": "########", - "private_ip": "########" } ], "security_groups": [ @@ -419,16 +428,7 @@ "state": "in-use", "subnet_id": "##id-7##", "subregion_name": "us-east-2a", - "tags": [ - { - "key": "Key:", - "value": ":value-tags" - }, - { - "key": "Key-2", - "value": "value-tags-2" - } - ] + "tags": [] } ], "request_id": "########" @@ -453,11 +453,20 @@ "account_id": "##id-1##", "description": "", "is_source_dest_checked": true, - "link_nic": [], + "link_nic": [ + { + "delete_on_vm_deletion": false, + "device_number": 2, + "link_nic_id": "##id-12##", + "state": "attached", + "vm_account_id": "##id-1##", + "vm_id": "##id-3##" + } + ], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-12##", + "nic_id": "##id-13##", "private_dns_name": "########", "private_ips": [ { @@ -465,6 +474,12 @@ "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" + }, + { + "is_primary": false, + "link_public_ip": [], + "private_dns_name": "########", + "private_ip": "########" } ], "security_groups": [ @@ -473,38 +488,25 @@ "security_group_name": "Terraform-SG-TF113" } ], - "state": "available", - "subnet_id": "##id-13##", - "subregion_name": "us-east-2b", + "state": "in-use", + "subnet_id": "##id-7##", + "subregion_name": "us-east-2a", "tags": [ { - "key": "Key-2", - "value": "value-tags-2" - }, - { - "key": "Key:", - "value": ":value-tags" + "key": "Name", + "value": "Nic-2" } ] }, { "account_id": "##id-1##", - "description": "Primary network interface", + "description": "", "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_nic": [], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-10##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ips": [ { @@ -520,20 +522,29 @@ "security_group_name": "Terraform-SG-TF113" } ], - "state": "in-use", - "subnet_id": "##id-7##", - "subregion_name": "us-east-2a", - "tags": [] + "state": "available", + "subnet_id": "##id-15##", + "subregion_name": "us-east-2b", + "tags": [ + { + "key": "Key:", + "value": ":value-tags" + }, + { + "key": "Key-2", + "value": "value-tags-2" + } + ] }, { "account_id": "##id-1##", - "description": "", + "description": "TF-113", "is_source_dest_checked": true, "link_nic": [ { "delete_on_vm_deletion": false, - "device_number": 2, - "link_nic_id": "##id-14##", + "device_number": 1, + "link_nic_id": "##id-2##", "state": "attached", "vm_account_id": "##id-1##", "vm_id": "##id-3##" @@ -542,7 +553,7 @@ "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-15##", + "nic_id": "##id-5##", "private_dns_name": "########", "private_ips": [ { @@ -569,20 +580,24 @@ "subregion_name": "us-east-2a", "tags": [ { - "key": "Name", - "value": "Nic-2" + "key": "Key:", + "value": ":value-tags" + }, + { + "key": "Key-2", + "value": "value-tags-2" } ] }, { "account_id": "##id-1##", - "description": "TF-113", + "description": "Primary network interface", "is_source_dest_checked": true, "link_nic": [ { - "delete_on_vm_deletion": false, - "device_number": 1, - "link_nic_id": "##id-2##", + "delete_on_vm_deletion": true, + "device_number": 0, + "link_nic_id": "##id-9##", "state": "attached", "vm_account_id": "##id-1##", "vm_id": "##id-3##" @@ -591,7 +606,7 @@ "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-5##", + "nic_id": "##id-10##", "private_dns_name": "########", "private_ips": [ { @@ -599,12 +614,6 @@ "link_public_ip": [], "private_dns_name": "########", "private_ip": "########" - }, - { - "is_primary": false, - "link_public_ip": [], - "private_dns_name": "########", - "private_ip": "########" } ], "security_groups": [ @@ -616,16 +625,7 @@ "state": "in-use", "subnet_id": "##id-7##", "subregion_name": "us-east-2a", - "tags": [ - { - "key": "Key-2", - "value": "value-tags-2" - }, - { - "key": "Key:", - "value": ":value-tags" - } - ] + "tags": [] } ], "request_id": "########" @@ -654,7 +654,7 @@ "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-12##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ips": [ { @@ -671,7 +671,7 @@ } ], "state": "available", - "subnet_id": "##id-13##", + "subnet_id": "##id-15##", "subregion_name": "us-east-2b", "tags": [ { @@ -795,13 +795,13 @@ "attributes": { "account_id": "##id-1##", "description": "", - "id": "##id-15##", + "id": "##id-13##", "is_source_dest_checked": true, "link_nic": [], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-15##", + "nic_id": "##id-13##", "private_dns_name": "########", "private_ip": "########", "private_ips": [ @@ -861,13 +861,13 @@ "attributes": { "account_id": "##id-1##", "description": "", - "id": "##id-12##", + "id": "##id-14##", "is_source_dest_checked": true, "link_nic": [], "link_public_ip": [], "mac_address": "########", "net_id": "##id-4##", - "nic_id": "##id-12##", + "nic_id": "##id-14##", "private_dns_name": "########", "private_ip": "########", "private_ips": [ @@ -890,7 +890,7 @@ } ], "state": "available", - "subnet_id": "##id-13##", + "subnet_id": "##id-15##", "subregion_name": "us-east-2b", "tags": [ { @@ -956,9 +956,9 @@ "attributes": { "delete_on_vm_deletion": false, "device_number": 2, - "id": "##id-14##", - "link_nic_id": "##id-14##", - "nic_id": "##id-15##", + "id": "##id-12##", + "link_nic_id": "##id-12##", + "nic_id": "##id-13##", "request_id": "########", "state": null, "vm_account_id": null, @@ -1053,13 +1053,13 @@ "schema_version": 0, "attributes": { "available_ips_count": "########", - "id": "##id-13##", + "id": "##id-15##", "ip_range": "10.5.2.0/24", "map_public_ip_on_launch": false, "net_id": "##id-4##", "request_id": "########", "state": "available", - "subnet_id": "##id-13##", + "subnet_id": "##id-15##", "subregion_name": "us-east-2b", "tags": [], "timeouts": null diff --git a/utils/utils.go b/utils/utils.go index 51fc07512..409888008 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -154,7 +154,7 @@ func StringSliceToFloat32Slice(src []string) (res []float32) { } func LogManuallyDeleted(name, id string) { - log.Printf("[WARN] %s %s not found, probably deleted manually, removing from state", name, id) + log.Printf("\n[WARN] %s %s not found, probably deleted manually, removing from state\n", name, id) } func IsResponseEmpty(len int, name, id string) bool { @@ -167,10 +167,10 @@ func IsResponseEmpty(len int, name, id string) bool { func IsResponseEmptyOrMutiple(rLen int, resName string) error { if rLen == 0 { - return fmt.Errorf("Unable to find %v", resName) + return fmt.Errorf("unable to find %v", resName) } if rLen > 1 { - return fmt.Errorf("Multiple %vs matched; use additional constraints to reduce matches to a single %v", resName, resName) + return fmt.Errorf("multiple %vs matched; use additional constraints to reduce matches to a single %v", resName, resName) } return nil }