Fix DB parameter group name property

It appears that #13232 doesn't work properly if you actually try to set any `parameter`s. Specifically, I was getting the following error:

```
* aws_db_parameter_group.test: 1 error(s) occurred:

* aws_db_parameter_group.test: Error modifying DB Parameter Group: InvalidParameterValue: The parameter DBParameterGroupName must be provided and must not be blank.
	status code: 400, request id: 5783e396-17ff-11e7-87d5-e3fd4c7025ce
```
This commit is contained in:
Joshua Spence 2017-04-03 09:56:25 +10:00
parent 9b55ce5385
commit f15b74b4a4
2 changed files with 11 additions and 0 deletions

View File

@ -98,6 +98,7 @@ func resourceAwsDbParameterGroupCreate(d *schema.ResourceData, meta interface{})
} else { } else {
groupName = resource.UniqueId() groupName = resource.UniqueId()
} }
d.Set("name", groupName)
createOpts := rds.CreateDBParameterGroupInput{ createOpts := rds.CreateDBParameterGroupInput{
DBParameterGroupName: aws.String(groupName), DBParameterGroupName: aws.String(groupName),

View File

@ -715,11 +715,21 @@ const testAccDBParameterGroupConfig_namePrefix = `
resource "aws_db_parameter_group" "test" { resource "aws_db_parameter_group" "test" {
name_prefix = "tf-test-" name_prefix = "tf-test-"
family = "mysql5.6" family = "mysql5.6"
parameter {
name = "sync_binlog"
value = 0
}
} }
` `
const testAccDBParameterGroupConfig_generatedName = ` const testAccDBParameterGroupConfig_generatedName = `
resource "aws_db_parameter_group" "test" { resource "aws_db_parameter_group" "test" {
family = "mysql5.6" family = "mysql5.6"
parameter {
name = "sync_binlog"
value = 0
}
} }
` `