From 5e2e2ffa20702452db6720611b4c7320b8dab9b6 Mon Sep 17 00:00:00 2001 From: Stephen Chu Date: Thu, 21 May 2015 21:23:29 +0000 Subject: [PATCH] Use Schema Default declaratively instead of defaulting at each payload creation. --- builtin/providers/aws/resource_aws_route53_zone.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/builtin/providers/aws/resource_aws_route53_zone.go b/builtin/providers/aws/resource_aws_route53_zone.go index cc44df7ab..296dcbacc 100644 --- a/builtin/providers/aws/resource_aws_route53_zone.go +++ b/builtin/providers/aws/resource_aws_route53_zone.go @@ -32,6 +32,7 @@ func resourceAwsRoute53Zone() *schema.Resource { "comment": &schema.Schema{ Type: schema.TypeString, Optional: true, + Default: "Managed by Terraform", }, "vpc_id": &schema.Schema{ @@ -66,13 +67,9 @@ func resourceAwsRoute53Zone() *schema.Resource { func resourceAwsRoute53ZoneCreate(d *schema.ResourceData, meta interface{}) error { r53 := meta.(*AWSClient).r53conn - comment := "Managed by Terraform" - if c := d.Get("comment"); c != "" { - comment = c.(string) - } req := &route53.CreateHostedZoneInput{ Name: aws.String(d.Get("name").(string)), - HostedZoneConfig: &route53.HostedZoneConfig{Comment: aws.String(comment)}, + HostedZoneConfig: &route53.HostedZoneConfig{Comment: aws.String(d.Get("comment").(string))}, CallerReference: aws.String(time.Now().Format(time.RFC3339Nano)), } if v := d.Get("vpc_id"); v != "" {