Merge pull request #897 from bitglue/apply_method

provider/aws: Implement apply_method for RDS parameters
This commit is contained in:
Mitchell Hashimoto 2015-02-17 09:28:24 -08:00
commit f63aa41d67
3 changed files with 17 additions and 3 deletions

View File

@ -48,6 +48,19 @@ func resourceAwsDbParameterGroup() *schema.Resource {
Type: schema.TypeString,
Required: true,
},
"apply_method": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Default: "immediate",
// this parameter is not actually state, but a
// meta-parameter describing how the RDS API call
// to modify the parameter group should be made.
// Future reads of the resource from AWS don't tell
// us what we used for apply_method previously, so
// by squashing state to an empty string we avoid
// needing to do an update for every future run.
StateFunc: func(interface{}) string { return "" },
},
},
},
Set: resourceAwsDbParameterHash,

View File

@ -99,9 +99,7 @@ func expandParameters(configured []interface{}) ([]rds.Parameter, error) {
data := pRaw.(map[string]interface{})
p := rds.Parameter{
// Only immediate is supported for now; should add in pending-reboot at some point
// but gets tricky as the DescribeParameterGroups AWS call doesn't return this data
ApplyMethod: "immediate",
ApplyMethod: data["apply_method"].(string),
ParameterName: data["name"].(string),
ParameterValue: data["value"].(string),
}

View File

@ -41,6 +41,9 @@ Parameter blocks support the following:
* `name` - (Required) The name of the DB parameter.
* `value` - (Required) The value of the DB parameter.
* `apply_method` - (Optional) "immediate" (default), or "pending-reboot". Some
engines can't apply some parameters without a reboot, and you will need to
specify "pending-reboot" here.
## Attributes Reference