Skip to content

Commit

Permalink
Set firewall rule direction to ingress if it's not set (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
zulh-civo committed Sep 6, 2021
1 parent e7f5333 commit 8d2f4c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion civo/resource_firewall_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,17 @@ func resourceFirewallRuleCreate(d *schema.ResourceData, m interface{}) error {
cird[i] = tfCird.(string)
}

direction := d.Get("direction").(string)
if direction == "" {
direction = "ingress"
}

log.Printf("[INFO] configuring a new firewall rule for firewall %s", d.Get("firewall_id").(string))
config := &civogo.FirewallRuleConfig{
FirewallID: d.Get("firewall_id").(string),
Protocol: d.Get("protocol").(string),
StartPort: d.Get("start_port").(string),
Direction: d.Get("direction").(string),
Direction: direction,
Cidr: cird,
}

Expand Down

0 comments on commit 8d2f4c5

Please sign in to comment.