Merge pull request #13140 from hashicorp/b-rds-snapshot-restore-db-name

provider/aws: Don't set DBName on `aws_db_instance` from snapshot
This commit is contained in:
Paul Hinze 2017-03-29 14:17:32 -05:00 committed by GitHub
commit 43242bbeae
1 changed files with 8 additions and 1 deletions

View File

@ -407,7 +407,14 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error
}
if attr, ok := d.GetOk("name"); ok {
opts.DBName = aws.String(attr.(string))
// "Note: This parameter [DBName] doesn't apply to the MySQL, PostgreSQL, or MariaDB engines."
// https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RestoreDBInstanceFromDBSnapshot.html
switch strings.ToLower(d.Get("engine").(string)) {
case "mysql", "postgres", "mariadb":
// skip
default:
opts.DBName = aws.String(attr.(string))
}
}
if attr, ok := d.GetOk("availability_zone"); ok {