title: aws / terraform Iam - inline
body: <p>so here what I'm trying to do: is to create inline policies and attach it to an existing user?</p>
  <p>aws_iam_user does create but instead, I would want to attach it to an existing user.</p>
  <p>thanks</p>
  <blockquote>
  <pre><code>resource &quot;aws_iam_user&quot; &quot;user&quot; {
    name = &quot;arthur&quot;
  }
  
  #Create Inline Policies for de-test 
  resource &quot;aws_iam_user_policy&quot; &quot;arthur&quot; {
    name = &quot;arthur inline&quot;
    user = aws_iam_user.user.name
  
    policy = &lt;&lt;EOF
  {
      &quot;Version&quot;: &quot;2012-10-17&quot;,
      &quot;Statement&quot;: [
          {
              &quot;Sid&quot;: &quot;s3inline&quot;,
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Action&quot;: [
                  &quot;s3:GetAccountPublicAccessBlock&quot;,
                  &quot;s3:ListAllMyBuckets&quot;,
                  &quot;s3:ListAccessPoints&quot;,
                  &quot;s3:GetBucketLocation&quot;
              ],
              &quot;Resource&quot;: &quot;*&quot;
          },
          {
              &quot;Sid&quot;: &quot;s3inline&quot;,
              &quot;Effect&quot;: &quot;Allow&quot;,
              &quot;Action&quot;: [
                  &quot;s3:GetBucketPublicAccessBlock&quot;,
                  &quot;s3:GetBucketPolicyStatus&quot;,
                  &quot;s3:ListBucket&quot;,
                  &quot;s3:GetBucketAcl&quot;
              ],
              &quot;Resource&quot;: &quot;arn:aws:s3:::arthur-store&quot;
          }
      ]
  }
  EOF
  }
  </code></pre>
  </blockquote>