Avoid panics when DBName is not set

provider/aws: The DBName in RDS instance is optional and when
not set, the Read function return null.
This commit is contained in:
Michał Guminiak 2015-04-01 14:33:08 +02:00
parent 766b4902d4
commit dc67b043fa
1 changed files with 5 additions and 1 deletions

View File

@ -304,7 +304,11 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error {
return nil
}
d.Set("name", *v.DBName)
if v.DBName != nil {
d.Set("name", *v.DBName)
} else {
d.Set("name", "")
}
d.Set("username", *v.MasterUsername)
d.Set("engine", *v.Engine)
d.Set("engine_version", *v.EngineVersion)