Merge pull request #13281 from ameir/fix-aws_s3_bucket-logging-diff

Fix `aws_s3_bucket` diff of logging options
This commit is contained in:
Clint 2017-04-05 14:38:39 -05:00 committed by GitHub
commit 7cd0708402
1 changed files with 4 additions and 4 deletions

View File

@ -728,8 +728,8 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error {
}
log.Printf("[DEBUG] S3 Bucket: %s, logging: %v", d.Id(), logging)
lcl := make([]map[string]interface{}, 0, 1)
if v := logging.LoggingEnabled; v != nil {
lcl := make([]map[string]interface{}, 0, 1)
lc := make(map[string]interface{})
if *v.TargetBucket != "" {
lc["target_bucket"] = *v.TargetBucket
@ -738,9 +738,9 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error {
lc["target_prefix"] = *v.TargetPrefix
}
lcl = append(lcl, lc)
if err := d.Set("logging", lcl); err != nil {
return err
}
}
if err := d.Set("logging", lcl); err != nil {
return err
}
// Read the lifecycle configuration