I am getting the following error when running terraform:
* aws_iam_role_policy.rds_policy: Error putting IAM role policy my-rds-policy: MalformedPolicyDocume
You need to make sure that you don't have any indentation at the start of your EOF heredoc because your JSON policy should not start with an indented brace.
So you should be fine with this small change:
resource "aws_iam_role_policy" "rds_policy" {
name = "my-rds-policy"
role = "${aws_iam_role.rds_role.id}"
policy = <