Workaround to allow weight = 0 in Route53 RRs

Moved the GetOk to a Get in the set_identifier block so
we can create a zero-weighted RR - otherwise this falls foul
of a check in GetOk.

See https://github.com/hashicorp/terraform/issues/3189
This commit is contained in:
Anthony Stanton 2015-09-09 16:01:58 +02:00
parent 6cf126defa
commit a0d9a4c96f
1 changed files with 1 additions and 4 deletions

View File

@ -407,12 +407,9 @@ func resourceAwsRoute53RecordBuildSet(d *schema.ResourceData, zoneName string) (
rec.HealthCheckId = aws.String(v.(string))
}
if v, ok := d.GetOk("weight"); ok {
rec.Weight = aws.Int64(int64(v.(int)))
}
if v, ok := d.GetOk("set_identifier"); ok {
rec.SetIdentifier = aws.String(v.(string))
rec.Weight = aws.Int64(int64(d.Get("weight").(int)))
}
return rec, nil