Merge branch 'optimisticanshul-7721-enable-disable-access-logs'

This commit is contained in:
stack72 2016-08-29 21:15:48 +01:00
commit d4589e2581
No known key found for this signature in database
GPG Key ID: 8619A619B085CB16
3 changed files with 11 additions and 1 deletions

View File

@ -127,6 +127,11 @@ func resourceAwsElb() *schema.Resource {
Type: schema.TypeString,
Optional: true,
},
"enabled": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Default: true,
},
},
},
},
@ -520,7 +525,7 @@ func resourceAwsElbUpdate(d *schema.ResourceData, meta interface{}) error {
} else if len(logs) == 1 {
log := logs[0].(map[string]interface{})
accessLog := &elb.AccessLog{
Enabled: aws.Bool(true),
Enabled: aws.Bool(log["enabled"].(bool)),
EmitInterval: aws.Int64(int64(log["interval"].(int))),
S3BucketName: aws.String(log["bucket"].(string)),
}

View File

@ -374,6 +374,10 @@ func flattenAccessLog(l *elb.AccessLog) []map[string]interface{} {
r["interval"] = *l.EmitInterval
}
if l.Enabled != nil {
r["enabled"] = *l.Enabled
}
result = append(result, r)
}

View File

@ -93,6 +93,7 @@ Access Logs (`access_logs`) support the following:
* `bucket` - (Required) The S3 bucket name to store the logs in.
* `bucket_prefix` - (Optional) The S3 bucket prefix. Logs are stored in the root if not configured.
* `interval` - (Optional) The publishing interval in minutes. Default: 60 minutes.
* `enabled` - (Optional) Boolean to enable / disable `access_logs`. Default is `true`
Listeners (`listener`) support the following: