Fail if failover set when set_identifier unset

Added as per
https://github.com/hashicorp/terraform/pull/5777#issuecomment-199802514
This commit is contained in:
Edmund Craske 2016-03-22 13:19:24 +00:00
parent 4aa7d4f7db
commit edbc4fad13
1 changed files with 3 additions and 0 deletions

View File

@ -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))
}