diff --git a/aws/resource_aws_launch_template.go b/aws/resource_aws_launch_template.go index f91c9a174b8..77d5cf73393 100644 --- a/aws/resource_aws_launch_template.go +++ b/aws/resource_aws_launch_template.go @@ -47,7 +47,6 @@ func resourceAwsLaunchTemplate() *schema.Resource { "description": { Type: schema.TypeString, Optional: true, - Default: "Managed by Terraform", ValidateFunc: validation.StringLenBetween(0, 255), }, @@ -518,7 +517,10 @@ func resourceAwsLaunchTemplateCreate(d *schema.ResourceData, meta interface{}) e ClientToken: aws.String(resource.UniqueId()), LaunchTemplateName: aws.String(ltName), LaunchTemplateData: launchTemplateData, - VersionDescription: aws.String(d.Get("description").(string)), + } + + if v, ok := d.GetOk("description"); ok && v.(string) != "" { + launchTemplateOpts.VersionDescription = aws.String(v.(string)) } resp, err := conn.CreateLaunchTemplate(launchTemplateOpts) @@ -681,7 +683,10 @@ func resourceAwsLaunchTemplateUpdate(d *schema.ResourceData, meta interface{}) e ClientToken: aws.String(resource.UniqueId()), LaunchTemplateId: aws.String(d.Id()), LaunchTemplateData: launchTemplateData, - VersionDescription: aws.String(d.Get("description").(string)), + } + + if v, ok := d.GetOk("description"); ok && v.(string) != "" { + launchTemplateVersionOpts.VersionDescription = aws.String(v.(string)) } _, createErr := conn.CreateLaunchTemplateVersion(launchTemplateVersionOpts) diff --git a/aws/resource_aws_launch_template_test.go b/aws/resource_aws_launch_template_test.go index ca6eb317c6e..f1a3b011897 100644 --- a/aws/resource_aws_launch_template_test.go +++ b/aws/resource_aws_launch_template_test.go @@ -73,7 +73,6 @@ func TestAccAWSLaunchTemplate_basic(t *testing.T) { resource.TestCheckResourceAttr(resName, "latest_version", "1"), resource.TestCheckResourceAttrSet(resName, "arn"), resource.TestCheckResourceAttr(resName, "ebs_optimized", ""), - resource.TestCheckResourceAttr(resName, "description", "Managed by Terraform"), ), }, },