title: How to attach new role permissions to iam_role in aws using python boto3?
body: <p>I'm trying to attach new permissions to the existing IAM role using python boto3. I'm using the <strong>append()</strong> method to attach new permissions to the IAM role but it is not really adding permissions to the role.</p>
  <p><strong>Python:</strong></p>
  <pre><code>import boto3
  iam = boto3.client('iam',aws_access_key_id=ACCESS_KEY,aws_secret_access_key=SECRET_KEY)
  rolename = ROLENAME
  policyname = POLICYNAME
  
  #Get rolepolicy 
  response = iam.get_role_policy(RoleName=rolename,PolicyName=policyname)
  add_permission = response['PolicyDocument']['Statement']
  
  #Assume json_perm is the  permission that needs to be attached inside Statement block of policydocument.
  json_perm = &quot;&quot;&quot; {'Action':'*','Resource':'','Effect':'Allow'})&quot;&quot;&quot; 
  
  #Attaching new permissions to the role
  add_permission.append(json_perm)
  print(add_permission)
  
  #Get response after appending
  new_response = iam.get_role_policy(RoleName=rolename,PolicyName=policyname)
  print(new_response)
  
  </code></pre>
  <p>When printing <code>add_permission</code> I'm able to see the new permissions got appended in the policy document.
  But I'm not able to see that permission in the AWS console and also after appending If I print <code>new_response</code> I'm not able to see the newly added permissions in the output terminal also.</p>
  <p>Appending new permissions to the IAM-role doesn't actually do any change to the role..?
  How to attach new permissions to the IAM role PolicyDocument using python boto3?</p>
  <p>Thanks.</p>