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:
parent
766b4902d4
commit
dc67b043fa
|
@ -304,7 +304,11 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
return nil
|
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("username", *v.MasterUsername)
|
||||||
d.Set("engine", *v.Engine)
|
d.Set("engine", *v.Engine)
|
||||||
d.Set("engine_version", *v.EngineVersion)
|
d.Set("engine_version", *v.EngineVersion)
|
||||||
|
|
Loading…
Reference in New Issue