// customizeDiff func for additional checks on google_compute_router properties:
customizeDiff func for additional checks on google_compute_router properties.
// customizeDiff func for additional checks on google_compute_router properties :
func resourceComputeRouterCustomDiff(diff *schema.ResourceDiff, meta interface{}) error {
	block := diff.Get("bgp.0").(map[string]interface{})
	advertiseMode := block["advertise_mode"]
	advertisedGroups := block["advertised_groups"].([]interface{})
	advertisedIPRanges := block["advertised_ip_ranges"].([]interface{})
	if advertiseMode == "DEFAULT" && len(advertisedGroups) != 0 {
		return fmt.Errorf("Error in bgp: advertised_groups cannot be specified when using advertise_mode DEFAULT")
	}
	if advertiseMode == "DEFAULT" && len(advertisedIPRanges) != 0 {
		return fmt.Errorf("Error in bgp: advertised_ip_ranges cannot be specified when using advertise_mode DEFAULT")
	}
	return nil
}
func resourceComputeRouterCustomDiff ( diff * schema . ResourceDiff , meta interface { } ) error { block := diff . Get ( " " ) . ( map [ string ] interface { } ) advertiseMode := block [ " " ] advertisedGroups := block [ " " ] . ( [ ] interface { } ) advertisedIPRanges := block [ " " ] . ( [ ] interface { } ) if advertiseMode == " " && len ( advertisedGroups ) != 0 { return fmt . Errorf ( " " ) } if advertiseMode == " " && len ( advertisedIPRanges ) != 0 { return fmt . Errorf ( " " ) } return nil }
customizeDiff func for additional checks on google_compute_router properties.
customizeDiff func for additional checks on google_compute_router properties .