Skip to content

Commit

Permalink
Fix error when you try to create a firewall witout region (#150)
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro J. Nuñez Madrazo <alejandrojnm@gmail.com>

Signed-off-by: Alejandro J. Nuñez Madrazo <alejandrojnm@gmail.com>
  • Loading branch information
alejandrojnm committed Sep 26, 2022
1 parent 075eaad commit 04c3766
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion civo/resource_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ func resourceFirewallCreate(ctx context.Context, d *schema.ResourceData, m inter
if err != nil {
return diag.Errorf("[ERR] an error occurred while tring to build the firewall request, %s", err)
}
firewall, err := apiClient.NewFirewall(firewallConfig)

firewall, err := apiClient.NewFirewall(firewallConfig)
if err != nil {
return diag.Errorf("[ERR] failed to create a new firewall: %s", err)
}
Expand Down Expand Up @@ -389,6 +389,7 @@ func firewallRequestBuild(d *schema.ResourceData, client *civogo.Client) (*civog

firewallCofig := &civogo.FirewallConfig{
Name: d.Get("name").(string),
Region: client.Region,
NetworkID: networkID,
CreateRules: &createFirewallRules,
}
Expand Down

0 comments on commit 04c3766

Please sign in to comment.