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) }