in cloudstack/resource_cloudstack_ipaddress.go [213:229]
func verifyIPAddressParams(d *schema.ResourceData) error {
_, portable := d.GetOk("is_portable")
_, network := d.GetOk("network_id")
_, vpc := d.GetOk("vpc_id")
_, zone := d.GetOk("zone")
if portable && ((network && vpc) || (!network && !vpc)) {
return fmt.Errorf(
"You must supply a value for either (so not both) the 'network_id' or 'vpc_id' parameter for a portable IP")
}
if !portable && !zone && !network {
return fmt.Errorf("You must supply a value for the 'network_id' and/or 'zone' parameters for a non portable IP")
}
return nil
}