providers/aws: Fix issue with removing access_logs from ELB
This commit is contained in:
parent
2f163701e8
commit
7f2244183c
|
@ -239,24 +239,21 @@ func expandElastiCacheParameters(configured []interface{}) ([]*elasticache.Param
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flattens an access log into something that flatmap.Flatten() can handle
|
// Flattens an access log into something that flatmap.Flatten() can handle
|
||||||
func flattenAccessLog(log *elb.AccessLog) []map[string]interface{} {
|
func flattenAccessLog(l *elb.AccessLog) []map[string]interface{} {
|
||||||
result := make([]map[string]interface{}, 0, 1)
|
result := make([]map[string]interface{}, 0, 1)
|
||||||
|
|
||||||
if log != nil {
|
if l != nil && *l.Enabled {
|
||||||
r := make(map[string]interface{})
|
r := make(map[string]interface{})
|
||||||
// enabled is the only value we can rely on to not be nil
|
if l.S3BucketName != nil {
|
||||||
r["enabled"] = *log.Enabled
|
r["bucket"] = *l.S3BucketName
|
||||||
|
|
||||||
if log.S3BucketName != nil {
|
|
||||||
r["bucket"] = *log.S3BucketName
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if log.S3BucketPrefix != nil {
|
if l.S3BucketPrefix != nil {
|
||||||
r["bucket_prefix"] = *log.S3BucketPrefix
|
r["bucket_prefix"] = *l.S3BucketPrefix
|
||||||
}
|
}
|
||||||
|
|
||||||
if log.EmitInterval != nil {
|
if l.EmitInterval != nil {
|
||||||
r["interval"] = *log.EmitInterval
|
r["interval"] = *l.EmitInterval
|
||||||
}
|
}
|
||||||
|
|
||||||
result = append(result, r)
|
result = append(result, r)
|
||||||
|
|
Loading…
Reference in New Issue