diff --git a/outscale/data_source_outscale_security_group.go b/outscale/data_source_outscale_security_group.go index c1ad10d72..b17ff9132 100644 --- a/outscale/data_source_outscale_security_group.go +++ b/outscale/data_source_outscale_security_group.go @@ -250,8 +250,6 @@ func buildOutscaleOAPIDataSourceSecurityGroupFilters(set *schema.Set) oscgo.Filt } switch name := m["name"].(string); name { - case "account_ids": - filters.SetAccountIds(filterValues) case "descriptions": filters.SetDescriptions(filterValues) case "inbound_rule_account_ids": diff --git a/outscale/resource_outscale_route_table_link.go b/outscale/resource_outscale_route_table_link.go index b974155bb..1f3170a89 100644 --- a/outscale/resource_outscale_route_table_link.go +++ b/outscale/resource_outscale_route_table_link.go @@ -4,8 +4,6 @@ import ( "context" "errors" "fmt" - "log" - "net/http" "strings" "time" @@ -57,16 +55,13 @@ func resourceOutscaleOAPILinkRouteTable() *schema.Resource { func resourceOutscaleOAPILinkRouteTableCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI - subnetID := d.Get("subnet_id").(string) - routeTableID := d.Get("route_table_id").(string) - log.Printf("[INFO] Creating route table link: %s => %s", subnetID, routeTableID) - linkRouteTableOpts := oscgo.LinkRouteTableRequest{ - RouteTableId: routeTableID, - SubnetId: subnetID, - } - var resp oscgo.LinkRouteTableResponse var err error + + linkRouteTableOpts := oscgo.LinkRouteTableRequest{ + RouteTableId: d.Get("route_table_id").(string), + SubnetId: d.Get("subnet_id").(string), + } err = resource.Retry(5*time.Minute, func() *resource.RetryError { var err error rp, httpResp, err := conn.RouteTableApi.LinkRouteTable(context.Background()).LinkRouteTableRequest(linkRouteTableOpts).Execute() @@ -120,25 +115,16 @@ func resourceOutscaleOAPILinkRouteTableRead(d *schema.ResourceData, meta interfa func resourceOutscaleOAPILinkRouteTableDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*OutscaleClient).OSCAPI - log.Printf("[INFO] Deleting link route table: %s", d.Id()) - - var err error - var statusCode int - err = resource.Retry(5*time.Minute, func() *resource.RetryError { + err := resource.Retry(5*time.Minute, func() *resource.RetryError { _, httpResp, err := conn.RouteTableApi.UnlinkRouteTable(context.Background()).UnlinkRouteTableRequest(oscgo.UnlinkRouteTableRequest{ LinkRouteTableId: d.Id(), }).Execute() if err != nil { return utils.CheckThrottling(httpResp, err) } - statusCode = httpResp.StatusCode return nil }) - if err != nil { - if statusCode == http.StatusNotFound { - return nil - } return fmt.Errorf("Error deleting link route table: %s", err) } diff --git a/outscale/resource_outscale_route_table_link_test.go b/outscale/resource_outscale_route_table_link_test.go index 1ce60de2d..13143d411 100644 --- a/outscale/resource_outscale_route_table_link_test.go +++ b/outscale/resource_outscale_route_table_link_test.go @@ -163,16 +163,16 @@ const testAccOAPILinkRouteTableConfig = ` } resource "outscale_subnet" "foo" { - net_id = "${outscale_net.foo.id}" + net_id = outscale_net.foo.id ip_range = "10.1.1.0/24" } resource "outscale_route_table" "foo" { - net_id = "${outscale_net.foo.id}" + net_id = outscale_net.foo.id } resource "outscale_route_table_link" "foo" { - route_table_id = "${outscale_route_table.foo.id}" - subnet_id = "${outscale_subnet.foo.id}" + route_table_id = outscale_route_table.foo.id + subnet_id = outscale_subnet.foo.id } `