I'm trying to create a role that once assumed should provide access to a specific bucket to certain users outside the AWS account

```
resource "aws_iam_role" "s3_role_access" {
  name               = "${var.s3_role_name}"
  assume_role_policy = "${data.template_file.iam_policy_s3_assume.rendered}"
  description        =  "Role providing access to ${var.s3_role_bucket_name}/${var.s3_role_bucket_path}"
}

resource "aws_iam_role_policy" "s3_role_access" {
  name   = "${var.s3_role_name}"
  role   = "${aws_iam_role.s3_role_access.id}"
  policy = "${data.template_file.iam_policy_s3_permissions.rendered}"
}

```

I'm expecting the plan to succeed but I am getting the following:

> 
> Error: Error running plan: 1 error occurred:
>  \* module.xxx.aws\_iam\_role\_policy.s3\_role\_access: 1 error occurred:
>  \* module.xxx.aws\_iam\_role\_policy.s3\_role\_access: Resource 'aws\_iam\_role.s3\_role\_access' not found for variable
>  'aws\_iam\_role.s3\_role\_access.id'
> 
> 
> 

The id attribute should be exported as described at <https://www.terraform.io/docs/providers/aws/r/iam_role.html#id>