From dfe0efaf175653b7ea34a6776a9b882e055f060b Mon Sep 17 00:00:00 2001 From: Christopher Tiwald Date: Thu, 16 Jul 2015 01:37:21 -0400 Subject: [PATCH] aws_db_instance: Only write lowercase engines to the state file. Amazon accepts mixed-case engines, but only returns lowercase. Without the proper StateFunc, every apply of a mixed-case engine will result in a new db instance. Standardize on lowercase. --- builtin/providers/aws/resource_aws_db_instance.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/providers/aws/resource_aws_db_instance.go b/builtin/providers/aws/resource_aws_db_instance.go index 47a98b73d3..6ca1916b51 100644 --- a/builtin/providers/aws/resource_aws_db_instance.go +++ b/builtin/providers/aws/resource_aws_db_instance.go @@ -46,6 +46,10 @@ func resourceAwsDbInstance() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, + StateFunc: func(v interface{}) string { + value := v.(string) + return strings.ToLower(value) + }, }, "engine_version": &schema.Schema{