From a14da63a3918e4011a0913247d704f2969c23c53 Mon Sep 17 00:00:00 2001 From: Rob Costanzo Date: Thu, 23 Oct 2014 14:07:31 -0700 Subject: [PATCH] Fixed bug with final_snapshot_identifier and skip_final_snapshot and removed apply_method as an option for now and am only supporting immediate mode --- builtin/providers/aws/resource_aws_db_instance.go | 2 ++ builtin/providers/aws/resource_aws_db_parameter_group.go | 7 ------- .../providers/aws/resource_aws_db_parameter_group_test.go | 8 -------- builtin/providers/aws/structure.go | 7 +++---- builtin/providers/aws/structure_test.go | 1 - .../docs/providers/aws/r/db_parameter_group.html.markdown | 3 --- 6 files changed, 5 insertions(+), 23 deletions(-) diff --git a/builtin/providers/aws/resource_aws_db_instance.go b/builtin/providers/aws/resource_aws_db_instance.go index 49e6be537..9c02504f6 100644 --- a/builtin/providers/aws/resource_aws_db_instance.go +++ b/builtin/providers/aws/resource_aws_db_instance.go @@ -347,6 +347,8 @@ func resource_aws_db_instance_validation() *config.Validator { "security_group_names.*", "db_subnet_group_name", "parameter_group_name", + "skip_final_snapshot", + "final_snapshot_identifier", }, } } diff --git a/builtin/providers/aws/resource_aws_db_parameter_group.go b/builtin/providers/aws/resource_aws_db_parameter_group.go index 93f0efa4f..af5d0b32d 100644 --- a/builtin/providers/aws/resource_aws_db_parameter_group.go +++ b/builtin/providers/aws/resource_aws_db_parameter_group.go @@ -40,10 +40,6 @@ func resourceAwsDbParameterGroup() *schema.Resource { ForceNew: false, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - "apply_method": &schema.Schema{ - Type: schema.TypeString, - Required: true, - }, "name": &schema.Schema{ Type: schema.TypeString, Required: true, @@ -186,9 +182,6 @@ func resourceAwsDbParameterGroupRead(d *schema.ResourceData, meta interface{}) e return err } - // apply_method is only relevant for creates and AWS does not maintain its state. - - d.Set("parameter", flattenParameters(describeParametersResp.Parameters)) return nil diff --git a/builtin/providers/aws/resource_aws_db_parameter_group_test.go b/builtin/providers/aws/resource_aws_db_parameter_group_test.go index f406a3986..93f61cd68 100644 --- a/builtin/providers/aws/resource_aws_db_parameter_group_test.go +++ b/builtin/providers/aws/resource_aws_db_parameter_group_test.go @@ -199,17 +199,14 @@ resource "aws_db_parameter_group" "bar" { parameter { name = "character_set_server" value = "utf8" - apply_method = "immediate" } parameter { name = "character_set_client" value = "utf8" - apply_method = "immediate" } parameter{ name = "character_set_results" value = "utf8" - apply_method = "immediate" } } ` @@ -222,27 +219,22 @@ resource "aws_db_parameter_group" "bar" { parameter { name = "character_set_server" value = "utf8" - apply_method = "immediate" } parameter { name = "character_set_client" value = "utf8" - apply_method = "immediate" } parameter{ name = "character_set_results" value = "utf8" - apply_method = "immediate" } parameter { name = "collation_server" value = "utf8_unicode_ci" - apply_method = "immediate" } parameter { name = "collation_connection" value = "utf8_unicode_ci" - apply_method = "immediate" } } ` diff --git a/builtin/providers/aws/structure.go b/builtin/providers/aws/structure.go index 3e00a0308..45ccbf093 100644 --- a/builtin/providers/aws/structure.go +++ b/builtin/providers/aws/structure.go @@ -99,7 +99,9 @@ func expandParameters(configured []interface{}) ([]rds.Parameter, error) { data := pRaw.(map[string]interface{}) p := rds.Parameter{ - ApplyMethod: data["apply_method"].(string), + // 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", ParameterName: data["name"].(string), ParameterValue: data["value"].(string), } @@ -192,9 +194,6 @@ func flattenParameters(list []rds.Parameter) []map[string]interface{} { result = append(result, map[string]interface{}{ "name": strings.ToLower(i.ParameterName), "value": strings.ToLower(i.ParameterValue), - // apply_method is only used on create/modify and is not returned when reading from AWS. - // This is a dummy value to print out as it's not used when doing the state diff for updating - "apply_method": "applied", }) } return result diff --git a/builtin/providers/aws/structure_test.go b/builtin/providers/aws/structure_test.go index de72c59a3..09ae987c8 100644 --- a/builtin/providers/aws/structure_test.go +++ b/builtin/providers/aws/structure_test.go @@ -299,7 +299,6 @@ func Test_flattenParameters(t *testing.T) { map[string]interface{}{ "name": "character_set_client", "value": "utf8", - "apply_method": "applied", }, }, }, diff --git a/website/source/docs/providers/aws/r/db_parameter_group.html.markdown b/website/source/docs/providers/aws/r/db_parameter_group.html.markdown index 04982aa1e..855665f66 100644 --- a/website/source/docs/providers/aws/r/db_parameter_group.html.markdown +++ b/website/source/docs/providers/aws/r/db_parameter_group.html.markdown @@ -19,13 +19,11 @@ resource "aws_db_parameter_group" "default" { parameter { name = "character_set_server" value = "utf8" - apply_method = "immediate" } parameter { name = "character_set_client" value = "utf8" - apply_method = "immediate" } } ``` @@ -43,7 +41,6 @@ Parameter blocks support the following: * `name` - (Required) The name of the DB parameter. * `value` - (Required) The value of the DB parameter. -* `apply_method` - (Required) Indicates when to apply parameter updates. Either immediate or pending-reboot. ## Attributes Reference