Skip to content

Commit

Permalink
Remove default description
Browse files Browse the repository at this point in the history
  • Loading branch information
teraken0509 committed Feb 22, 2019
1 parent 6583d81 commit ffaf5c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 8 additions & 3 deletions aws/resource_aws_launch_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func resourceAwsLaunchTemplate() *schema.Resource {
"description": {
Type: schema.TypeString,
Optional: true,
Default: "Managed by Terraform",
ValidateFunc: validation.StringLenBetween(0, 255),
},

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion aws/resource_aws_launch_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
),
},
},
Expand Down

0 comments on commit ffaf5c7

Please sign in to comment.