diff --git a/builtin/providers/aws/resource_aws_alb_listener_rule.go b/builtin/providers/aws/resource_aws_alb_listener_rule.go index f1dc944b5..1d5ba163f 100644 --- a/builtin/providers/aws/resource_aws_alb_listener_rule.go +++ b/builtin/providers/aws/resource_aws_alb_listener_rule.go @@ -144,10 +144,15 @@ func resourceAwsAlbListenerRuleRead(d *schema.ResourceData, meta interface{}) er rule := resp.Rules[0] d.Set("arn", rule.RuleArn) - if priority, err := strconv.Atoi(*rule.Priority); err != nil { - return errwrap.Wrapf("Cannot convert rule priority %q to int: {{err}}", err) + // Rules are evaluated in priority order, from the lowest value to the highest value. The default rule has the lowest priority. + if *rule.Priority == "default" { + d.Set("priority", 99999) } else { - d.Set("priority", priority) + if priority, err := strconv.Atoi(*rule.Priority); err != nil { + return errwrap.Wrapf("Cannot convert rule priority %q to int: {{err}}", err) + } else { + d.Set("priority", priority) + } } actions := make([]interface{}, len(rule.Actions))