I got the following playbook to update IAM policy and it works fine. But it wipes out what the IAM policy has currently and replaces it with what I have. I want to just append to the policy. How do I do it?
---
- name: test
hosts: localhost
tasks:
- name: Create IAM Managed Policy
amazon.aws.iam_policy:
iam_type: role
iam_name: "aws_test_role"
policy_name: "PrismaCloud-IAM-ReadOnly-Policy"
policy_json: "{{ lookup('template','policy.json.j2') }}"
state: present