Skip to content

Commit

Permalink
provider/aws: Fix Read of AWS CloudWatch Log when Update was called (h…
Browse files Browse the repository at this point in the history
…ashicorp#6384)

Fixes hashicorp#6169

The Update func was hitting a return err and when the err was empty, it
was skipping over the subsequent read func
  • Loading branch information
stack72 authored and Xavier Sellier committed May 17, 2016
1 parent 3691553 commit 9e40310
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions builtin/providers/aws/resource_aws_cloudwatch_log_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,18 @@ func resourceAwsCloudWatchLogGroupUpdate(d *schema.ResourceData, meta interface{
}
log.Printf("[DEBUG] Setting retention for CloudWatch Log Group: %q: %s", name, input)
_, err = conn.PutRetentionPolicy(&input)
if err != nil {
return err
}
} else {
log.Printf("[DEBUG] Deleting retention for CloudWatch Log Group: %q", name)
_, err = conn.DeleteRetentionPolicy(&cloudwatchlogs.DeleteRetentionPolicyInput{
LogGroupName: aws.String(name),
})
if err != nil {
return err
}
}

return err
}

return resourceAwsCloudWatchLogGroupRead(d, meta)
Expand Down

0 comments on commit 9e40310

Please sign in to comment.