add ForceNew to firewall direction field. (#2917)

Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
The Magician 2019-01-23 16:19:03 -08:00 committed by Nathan McKinley
parent 6e5bd62ee6
commit e533068957

View File

@ -112,6 +112,7 @@ func resourceComputeFirewall() *schema.Resource {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{"INGRESS", "EGRESS", ""}, false),
},
"disabled": {
@ -457,12 +458,6 @@ func resourceComputeFirewallUpdate(d *schema.ResourceData, meta interface{}) err
} else if v, ok := d.GetOkExists("destination_ranges"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, destinationRangesProp)) {
obj["destinationRanges"] = destinationRangesProp
}
directionProp, err := expandComputeFirewallDirection(d.Get("direction"), d, config)
if err != nil {
return err
} else if v, ok := d.GetOkExists("direction"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, directionProp)) {
obj["direction"] = directionProp
}
disabledProp, err := expandComputeFirewallDisabled(d.Get("disabled"), d, config)
if err != nil {
return err