title: Terraform: correct way to attach AWS managed policies to a role?
body: <p>I want to attach one of the pre-existing AWS managed roles to a policy, here's my current code:</p>
  
  <pre class="lang-hcl prettyprint-override"><code>resource "aws_iam_role_policy_attachment" "sto-readonly-role-policy-attach" {
    role       = "${aws_iam_role.sto-test-role.name}"
    policy_arn = "arn:aws:iam::aws:policy/ReadOnlyAccess"
  }
  </code></pre>
  
  <p>Is there a better way to model the managed policy and then reference it instead of hardcoding the ARN?  It just seems like whenever I hardcode ARNs / paths or other stuff like this, I usually find out later there was a better way.</p>
  
  <p>Is there something already existing in Terraform that models managed policies?  Or is hardcoding the ARN the "right" way to do it?</p>