Add JSON validation to the aws_sqs_queue resource.

This commit adds support for new helper function which is used to
normalise and validate JSON string.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
This commit is contained in:
Krzysztof Wilczynski 2016-09-14 12:33:52 +01:00
parent 5697a52b4f
commit 538327b61f
No known key found for this signature in database
GPG Key ID: B89F6447B63419A6

View File

@ -73,13 +73,18 @@ func resourceAwsSqsQueue() *schema.Resource {
"policy": {
Type: schema.TypeString,
Optional: true,
DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs,
Computed: true,
ValidateFunc: validateJsonString,
DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs,
},
"redrive_policy": {
Type: schema.TypeString,
Optional: true,
StateFunc: normalizeJson,
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateJsonString,
StateFunc: func(v interface{}) string {
json, _ := normalizeJsonString(v)
return json
},
},
"arn": {
Type: schema.TypeString,