Add JSON validation to the aws_iam_policy resource (#10239)

Although the aws_iam_policy has a problem of normalization (refs #8350),
I think it would be useful simply to add JSON syntax validation.
I wasted a lot of time with JSON syntax errors.

Validate the aws_iam_policy using the validateJsonString helper.
This commit is contained in:
Masayuki Morita 2016-11-22 20:35:15 +09:00 committed by Paul Stack
parent 4caf7e082d
commit f85e0b7249
1 changed files with 3 additions and 2 deletions

View File

@ -32,8 +32,9 @@ func resourceAwsIamPolicy() *schema.Resource {
ForceNew: true, ForceNew: true,
}, },
"policy": &schema.Schema{ "policy": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Required: true, Required: true,
ValidateFunc: validateJsonString,
}, },
"name": &schema.Schema{ "name": &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,