1
votes

I have my EKS specific user configuration in a json file that I want to load into terraform to apply it.

I use the data_source aws_iam_policy_document

resource "aws_iam_policy_document" "ops_manager" {                                                                                                       
policy = file("templates/eks_user_policy.json")         
    } 

Unfortunately when i run terraform plan i got this:

The provider provider.aws does not support resource type
"aws_iam_policy_document".

terraform version: v0.14.9

2
How did it go. Is it still unclear why you have the error?Marcin

2 Answers

2
votes

aws_iam_policy_document is a data source, not a resource.

Probably you want aws_iam_policy:

resource "aws_iam_policy" "ops_manager" {                                                                                                       
    policy = file("templates/eks_user_policy.json")         
} 
-1
votes

The problem was that in the JSON file there was a comment "//". By deleting the comment the problem was solved. maybe it help someone .