Merge pull request #8622 from optimisticanshul/8604-snapshot-rds-password
Update rds password if provided while creating from snapshot
This commit is contained in:
commit
7998c3be92
|
@ -442,13 +442,19 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
var sgUpdate bool
|
var sgUpdate bool
|
||||||
|
var passwordUpdate bool
|
||||||
|
|
||||||
|
if _, ok := d.GetOk("password"); ok {
|
||||||
|
passwordUpdate = true
|
||||||
|
}
|
||||||
|
|
||||||
if attr := d.Get("vpc_security_group_ids").(*schema.Set); attr.Len() > 0 {
|
if attr := d.Get("vpc_security_group_ids").(*schema.Set); attr.Len() > 0 {
|
||||||
sgUpdate = true
|
sgUpdate = true
|
||||||
}
|
}
|
||||||
if attr := d.Get("security_group_names").(*schema.Set); attr.Len() > 0 {
|
if attr := d.Get("security_group_names").(*schema.Set); attr.Len() > 0 {
|
||||||
sgUpdate = true
|
sgUpdate = true
|
||||||
}
|
}
|
||||||
if sgUpdate {
|
if sgUpdate || passwordUpdate {
|
||||||
log.Printf("[INFO] DB is restoring from snapshot with default security, but custom security should be set, will now update after snapshot is restored!")
|
log.Printf("[INFO] DB is restoring from snapshot with default security, but custom security should be set, will now update after snapshot is restored!")
|
||||||
|
|
||||||
// wait for instance to get up and then modify security
|
// wait for instance to get up and then modify security
|
||||||
|
|
Loading…
Reference in New Issue