diff --git a/builtin/providers/aws/resource_aws_elb.go b/builtin/providers/aws/resource_aws_elb.go index e036928dcf..79dc5fe7a8 100644 --- a/builtin/providers/aws/resource_aws_elb.go +++ b/builtin/providers/aws/resource_aws_elb.go @@ -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)), } diff --git a/builtin/providers/aws/structure.go b/builtin/providers/aws/structure.go index cb3e76a6f4..149dade0e5 100644 --- a/builtin/providers/aws/structure.go +++ b/builtin/providers/aws/structure.go @@ -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) } diff --git a/website/source/docs/providers/aws/r/elb.html.markdown b/website/source/docs/providers/aws/r/elb.html.markdown index 033b2a6218..5451f7f4c0 100644 --- a/website/source/docs/providers/aws/r/elb.html.markdown +++ b/website/source/docs/providers/aws/r/elb.html.markdown @@ -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: