Enable/Disbale Option For ELB Access logs
This commit is contained in:
parent
70cc108614
commit
f034638026
|
@ -127,6 +127,11 @@ func resourceAwsElb() *schema.Resource {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
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 {
|
} else if len(logs) == 1 {
|
||||||
log := logs[0].(map[string]interface{})
|
log := logs[0].(map[string]interface{})
|
||||||
accessLog := &elb.AccessLog{
|
accessLog := &elb.AccessLog{
|
||||||
Enabled: aws.Bool(true),
|
Enabled: aws.Bool(log["enabled"].(bool)),
|
||||||
EmitInterval: aws.Int64(int64(log["interval"].(int))),
|
EmitInterval: aws.Int64(int64(log["interval"].(int))),
|
||||||
S3BucketName: aws.String(log["bucket"].(string)),
|
S3BucketName: aws.String(log["bucket"].(string)),
|
||||||
}
|
}
|
||||||
|
|
|
@ -374,6 +374,10 @@ func flattenAccessLog(l *elb.AccessLog) []map[string]interface{} {
|
||||||
r["interval"] = *l.EmitInterval
|
r["interval"] = *l.EmitInterval
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if l.Enabled != nil {
|
||||||
|
r["enabled"] = *l.Enabled
|
||||||
|
}
|
||||||
|
|
||||||
result = append(result, r)
|
result = append(result, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue