Changing the db_instance to throw an error is a final snapshot is required but yet no identified is given
This commit is contained in:
parent
5796b13373
commit
6082e3e732
|
@ -628,8 +628,12 @@ func resourceAwsDbInstanceDelete(d *schema.ResourceData, meta interface{}) error
|
||||||
skipFinalSnapshot := d.Get("skip_final_snapshot").(bool)
|
skipFinalSnapshot := d.Get("skip_final_snapshot").(bool)
|
||||||
opts.SkipFinalSnapshot = aws.Bool(skipFinalSnapshot)
|
opts.SkipFinalSnapshot = aws.Bool(skipFinalSnapshot)
|
||||||
|
|
||||||
if name, present := d.GetOk("final_snapshot_identifier"); present && !skipFinalSnapshot {
|
if !skipFinalSnapshot {
|
||||||
opts.FinalDBSnapshotIdentifier = aws.String(name.(string))
|
if name, present := d.GetOk("final_snapshot_identifier"); present {
|
||||||
|
opts.FinalDBSnapshotIdentifier = aws.String(name.(string))
|
||||||
|
} else {
|
||||||
|
return fmt.Errorf("DB Instance FinalSnapshotIdentifier is required when a final snapshot is required")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("[DEBUG] DB Instance destroy configuration: %v", opts)
|
log.Printf("[DEBUG] DB Instance destroy configuration: %v", opts)
|
||||||
|
|
Loading…
Reference in New Issue