provider/aws: Guard against nil DB Parameter vaules

This commit is contained in:
clint shryock 2015-12-14 14:41:54 -06:00
parent 86882e39ed
commit d7a73937eb
1 changed files with 10 additions and 4 deletions

View File

@ -399,10 +399,16 @@ func flattenEcsContainerDefinitions(definitions []*ecs.ContainerDefinition) (str
func flattenParameters(list []*rds.Parameter) []map[string]interface{} {
result := make([]map[string]interface{}, 0, len(list))
for _, i := range list {
result = append(result, map[string]interface{}{
"name": strings.ToLower(*i.ParameterName),
"value": strings.ToLower(*i.ParameterValue),
})
if i.ParameterName != nil {
r := make(map[string]interface{})
r["name"] = strings.ToLower(*i.ParameterName)
// Default empty string, guard against nil parameter values
r["value"] = ""
if i.ParameterValue != nil {
r["value"] = strings.ToLower(*i.ParameterValue)
}
result = append(result, r)
}
}
return result
}