Skip to content

Commit

Permalink
Merge pull request #5777 from edmundcraske/edmundcraske-patch-1
Browse files Browse the repository at this point in the history
Fix route53 set_identifier logic
  • Loading branch information
phinze committed Mar 22, 2016
2 parents 11c831e + edbc4fa commit 9000883
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions builtin/providers/aws/resource_aws_route53_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ func resourceAwsRoute53RecordBuildSet(d *schema.ResourceData, zoneName string) (
}

if v, ok := d.GetOk("failover"); ok {
if _, ok := d.GetOk("set_identifier"); !ok {
return nil, fmt.Errorf(`provider.aws: aws_route53_record: %s: "set_identifier": required field is not set when "failover" is set`, d.Get("name").(string))
}
rec.Failover = aws.String(v.(string))
}

Expand All @@ -468,6 +471,9 @@ func resourceAwsRoute53RecordBuildSet(d *schema.ResourceData, zoneName string) (

w := d.Get("weight").(int)
if w > -1 {
if _, ok := d.GetOk("set_identifier"); !ok {
return nil, fmt.Errorf(`provider.aws: aws_route53_record: %s: "set_identifier": required field is not set when "weight" is set`, d.Get("name").(string))
}
rec.Weight = aws.Int64(int64(w))
}

Expand Down

0 comments on commit 9000883

Please sign in to comment.