Skip to content

Commit d4589e2

Browse files
committed
Merge branch 'optimisticanshul-7721-enable-disable-access-logs'
2 parents d8ebe67 + d330ac4 commit d4589e2

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

builtin/providers/aws/resource_aws_elb.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ func resourceAwsElb() *schema.Resource {
127127
Type: schema.TypeString,
128128
Optional: true,
129129
},
130+
"enabled": &schema.Schema{
131+
Type: schema.TypeBool,
132+
Optional: true,
133+
Default: true,
134+
},
130135
},
131136
},
132137
},
@@ -520,7 +525,7 @@ func resourceAwsElbUpdate(d *schema.ResourceData, meta interface{}) error {
520525
} else if len(logs) == 1 {
521526
log := logs[0].(map[string]interface{})
522527
accessLog := &elb.AccessLog{
523-
Enabled: aws.Bool(true),
528+
Enabled: aws.Bool(log["enabled"].(bool)),
524529
EmitInterval: aws.Int64(int64(log["interval"].(int))),
525530
S3BucketName: aws.String(log["bucket"].(string)),
526531
}

builtin/providers/aws/structure.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ func flattenAccessLog(l *elb.AccessLog) []map[string]interface{} {
374374
r["interval"] = *l.EmitInterval
375375
}
376376

377+
if l.Enabled != nil {
378+
r["enabled"] = *l.Enabled
379+
}
380+
377381
result = append(result, r)
378382
}
379383

website/source/docs/providers/aws/r/elb.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Access Logs (`access_logs`) support the following:
9393
* `bucket` - (Required) The S3 bucket name to store the logs in.
9494
* `bucket_prefix` - (Optional) The S3 bucket prefix. Logs are stored in the root if not configured.
9595
* `interval` - (Optional) The publishing interval in minutes. Default: 60 minutes.
96+
* `enabled` - (Optional) Boolean to enable / disable `access_logs`. Default is `true`
9697

9798
Listeners (`listener`) support the following:
9899

0 commit comments

Comments
 (0)