From 15533dca0908815f4172bf6c6571288c406831b3 Mon Sep 17 00:00:00 2001 From: clint shryock Date: Fri, 6 Nov 2015 14:06:50 -0600 Subject: [PATCH] actually use the value --- builtin/providers/aws/resource_aws_sns_topic.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_sns_topic.go b/builtin/providers/aws/resource_aws_sns_topic.go index b0d6fecf5..6bf0127d0 100644 --- a/builtin/providers/aws/resource_aws_sns_topic.go +++ b/builtin/providers/aws/resource_aws_sns_topic.go @@ -46,10 +46,11 @@ func resourceAwsSnsTopic() *schema.Resource { Optional: true, Computed: true, StateFunc: func(v interface{}) string { - if v == nil { + s, ok := v.(string) + if !ok || s == "" { return "" } - jsonb := []byte{} + jsonb := []byte(s) buffer := new(bytes.Buffer) if err := json.Compact(buffer, jsonb); err != nil { log.Printf("[WARN] Error compacting JSON for Policy in SNS Topic")