Skip to content

Commit

Permalink
Add JSON validation to the aws_iam_policy resource (#10239)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
minamijoyo authored and stack72 committed Nov 22, 2016
1 parent 4caf7e0 commit f85e0b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions builtin/providers/aws/resource_aws_iam_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ func resourceAwsIamPolicy() *schema.Resource {
ForceNew: true,
},
"policy": &schema.Schema{
Type: schema.TypeString,
Required: true,
Type: schema.TypeString,
Required: true,
ValidateFunc: validateJsonString,
},
"name": &schema.Schema{
Type: schema.TypeString,
Expand Down

0 comments on commit f85e0b7

Please sign in to comment.