title: Error creating IAM Role. MalformedPolicyDocument: Has prohibited field Resource. Terraform
body: <p>I have seen several links, but I have to see an example.
  I have:</p>
  
  <pre><code>resource "aws_iam_role" "role" {
    name = "role"
  
    assume_role_policy = &lt;&lt;-EOF
  {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "Stmt1590217939125",
          "Action": "s3:*",
          "Effect": "Allow",
          "Resource": "arn:aws:s3:::wwe"
        },
        {
          "Sid": "Stmt1590217939125",
          "Action": "s3:*",
          "Effect": "Allow",
          "Resource": "arn:aws:s3:::wwe/*"
        },
        {
          "Sid": "Stmt1577967806846",
          "Action": [
            "secretsmanager:DescribeSecret",
            "secretsmanager:GetRandomPassword",
            "secretsmanager:GetResourcePolicy",
            "secretsmanager:GetSecretValue",
            "secretsmanager:ListSecretVersionIds",
            "secretsmanager:ListSecrets"
          ],
          "Effect": "Allow",
          "Resource": "*"
        }
      ]
  }
    EOF
    tags = {
      Name        = wwe
      Environment = STAGE
    }
  }
  </code></pre>
  
  <p>When I am making, </p>
  
  <pre><code>terraform apply
  </code></pre>
  
  <p>I see this:</p>
  
  <pre><code>  # aws_iam_role.role will be created
    + resource "aws_iam_role" "role" {
        + arn                   = (known after apply)
        + assume_role_policy    = jsonencode(
              {
                + Statement = [
                    + {
                        + Action   = "s3:*"
                        + Effect   = "Allow"
                        + Resource = "arn:aws:s3:::wwe"
                        + Sid      = "Stmt1590217939125"
                      },
                    + {
                        + Action   = "s3:*"
                        + Effect   = "Allow"
                        + Resource = "arn:aws:s3:::wwe/*"
                        + Sid      = "Stmt1590217939125"
                      },
                    + {
                        + Action   = [
                            + "secretsmanager:DescribeSecret",
                            + "secretsmanager:GetRandomPassword",
                            + "secretsmanager:GetResourcePolicy",
                            + "secretsmanager:GetSecretValue",
                            + "secretsmanager:ListSecretVersionIds",
                            + "secretsmanager:ListSecrets",
                          ]
                        + Effect   = "Allow"
                        + Resource = "*"
                        + Sid      = "Stmt1577967806846"
                      },
                  ]
                + Version   = "2012-10-17"
              }
          )
        + create_date           = (known after apply)
        + force_detach_policies = false
        + id                    = (known after apply)
        + max_session_duration  = 3600
        + name                  = "role"
        + path                  = "/"
        + tags                  = {
            + "Environment" = "STAGE"
            + "Name"        = "wwe"
          }
        + unique_id             = (known after apply)
      }
  </code></pre>
  
  <p>After, when I am writing <code>yes</code>, I see:</p>
  
  <pre><code>Error: Error creating IAM Role role: MalformedPolicyDocument: Has prohibited field Resource
          status code: 400
  </code></pre>
  
  <p>Where, I have an error ? Please don't post links, to the same questions. I don't understand, where I have an error, Could You please write an example, where I have an error, If it possible.
  Thanks for Your attention.</p>