Merge pull request #2089 from managedbyq/b_fix_route53_required_attrs

providers/aws: Requires ttl and records attributes to be set if there isn't an ALIAS block.
This commit is contained in:
Radek Simko 2015-05-27 04:15:24 +01:00
commit 7aeeb14d28
1 changed files with 8 additions and 0 deletions

View File

@ -380,6 +380,14 @@ func resourceAwsRoute53RecordBuildSet(d *schema.ResourceData, zoneName string) (
HostedZoneID: aws.String(alias["zone_id"].(string)),
}
log.Printf("[DEBUG] Creating alias: %#v", alias)
} else {
if _, ok := d.GetOk("ttl"); !ok {
return nil, fmt.Errorf(`provider.aws: aws_route53_record: %s: "ttl": required field is not set`, d.Get("name").(string))
}
if _, ok := d.GetOk("records"); !ok {
return nil, fmt.Errorf(`provider.aws: aws_route53_record: %s: "records": required field is not set`, d.Get("name").(string))
}
}
if v, ok := d.GetOk("weight"); ok {