From c346da698184d4be3db566416bd3a922a4be4fed Mon Sep 17 00:00:00 2001 From: Camilo Aguilar Date: Tue, 26 May 2015 19:27:18 -0400 Subject: [PATCH] providers/aws: Requires ttl and records attributes if there isn't an ALIAS block. --- builtin/providers/aws/resource_aws_route53_record.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builtin/providers/aws/resource_aws_route53_record.go b/builtin/providers/aws/resource_aws_route53_record.go index e59d8e50e..f506355a3 100644 --- a/builtin/providers/aws/resource_aws_route53_record.go +++ b/builtin/providers/aws/resource_aws_route53_record.go @@ -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 {